Ok, my math is a bit rusty and I feel like this should be an easy problem, but yet I am here.
For SimpleAudioEngine in Cocos2d, there is a pitch argument. It is defined as follows:
1.0 is original pitch
0.5 is one octave (12 half steps) lower
2.0 is one octave (12 half steps) higher
So if I need:
input: 0 output: 1
input:-12 output: 0.5
input:12 output: 2
The equation has to be something like:
f(x) = f(x-1) * 2
But I don't remember how to solve equations like that. Thanks!