Pitching a 440hz sine wave

I have generated a 2 second sound containing a 440hz sine wave tone.
How would I offset its PlaybackSpeed to reach an another desired tone (for example 186hz)?

In theory, halving the speed should half the frequency so

A playback speed of 186/440 should be 186Hz

I’m less sure about this but, if you use the PitchShiftSoundEffect, setting it to 0.5 should half the frequency and setting it to 2 should double it. This is a nonlinear scale (logarithmic scale) and you may have to make use of math.log or math.log10 functions to calculate the setting to use, although it is limited to a range of 0.5 (1 octave lower) and 2 (one octave higher)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.