A white noise synth at 5513 frequency and up sounds WAY lower than one at 5512. It sounds like a frog croak when it should be a high hiss. More like pops at single-digit Hz.
(Triangle synth does not do this.)
Same on both hardware and simulator. (SDK 2.0.0.)
glitchSound = snd.synth.new(snd.kWaveNoise)
glitchSound:playNote(5513, 1, 1)
(I don't need to go that high, just noting it in case it's something to fix.)
I'll file this one. Thanks!
The noise synth is a little weird.. It outputs a random value, and updates that value at the given frequency--or it did originally, but the perceived "pitch" of the noise was way lower than other synths so I shifted it up four octaves (i.e. multiplied the frequency by 16) to make it sound right. But I didn't think to set an upper limit, which means that it wraps around when
freq * 16 hits the sample rate, or freq = 44100/16 = 2756. At 2757 the actual rendered frequency is just over zero. Same thing happens at 5512-5513, and every multiple of 2756.
Didn't occur to me that anyone would pitch it that high! I'll cap it at 2756 since that's the highest practical frequency, and I'll put a version check there so it doesn't change behavior of existing builds.
FWIW, the reason I went that high (until I changed it) is I had NON-noise synths responding to the crank—and if you went farther than useful in the game, they could get pretty high (intentionally). Then, I switched to noise instead of another synth, and got the unexpected behavior.
I can see why noise and other synths are not interchangeable!