TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ PitchRange

float float maxPitch Terraria.Audio.SoundStyle.PitchRange
getset

Definition at line 164 of file SoundStyle.cs.

165 {
166 get
167 {
169 float item = Math.Max(-1f, Pitch - halfVariance);
170 float maxPitch = Math.Min(1f, Pitch + halfVariance);
171 return (minPitch: item, maxPitch: maxPitch);
172 }
173 set
174 {
175 float minPitch;
176 float maxPitch;
177 (minPitch, maxPitch) = value;
178 if (minPitch > maxPitch)
179 {
180 throw new ArgumentException("Min pitch cannot be greater than max pitch.", "value");
181 }
182 minPitch = Math.Max(-1f, minPitch);
183 maxPitch = Math.Min(1f, maxPitch);
184 Pitch = (minPitch + maxPitch) * 0.5f;
186 }
187 }
float minPitch
A helper property for controlling both Pitch and PitchVariance at once.
float PitchVariance
The pitch offset randomness value. Cannot be negative. With Pitch at 0.0, and PitchVariance at 1....
float Pitch
The pitch offset to play sounds with.

Referenced by Terraria.Audio.SoundStyle.PrintMembers().