olofson / audiality2

A realtime scripted modular audio engine for video games and musical applications.
http://audiality.org/
zlib License
79 stars 5 forks source link

Reverse wave playback #323

Open olofson opened 7 years ago

olofson commented 7 years ago

Add support for reverse wave playback with 'wtosc' by adding a "playback speed" control register.

(Since linear pitch is logarithmic, we can't express negative pitch/frequency, which is why this calls for an extra control register.)

The most natural option would probably be to make this plain "frequency factor", so that 1.0 is "normal" speed, 0.5 is "half speed" (one octave down), -1.0 is "normal speed reverse" etc. Even with the current 16:16 fixed point registers (which will likely become 32 bit floating point soon), accuracy should be sufficient for most uses.