Make sure audio objects are created in order
winder opened this issue · comments
I was reading about the audio connections here:
https://www.pjrc.com/teensy/td_libs_AudioConnection.html
At the end it says:
Audio objects should be created in the order data is processed, inputs, playback and synthesis, then effects, filters, mixers, and lastly outputs.
Connections are most efficient when made from an earlier object (in the order they are created) to a later one. Connections from a later object back to an earlier object can be made, but they add a 1-block delay and consume more memory to implement taht delay.
Most of the objects at the top of AudioPatching.h are not used until the end of the processing, so they should probably be rearranged.
The objects are in their current order because they don't cause any audible problems. Some objects will feedback to earlier ones in the data flow and must be created before these earlier objects. Moving the objects around MUST be done very carefully with frequent testing, as noise artifacts are easily introduced - this is partly what took so long. When the library was created, they probably didn't foresee anyone creating a complicated polysynth.