Closed trondarild closed 1 month ago
This is planned for function generators and oscillators by using rate parameters everywhere.
It would be great with an audio output module that could use a matrix as an audio buffer that is filled and converted to audio at each tick.
The new module Oscillator is supposed to replace FunctionGenerator. It will use real time instead of ticks but is not ready yet.
Ok sounds good! OutputAudio checked in that exactly takes a matrix buffer and converts to audio, but it's a little choppy still due to rate issues. I guess we can remove FunctionGenerator when oscillator is ready, I just checked it in for testing the audio module.
The new scheduler will include a priority setting for modules that will increase temporal stability it may still be necessary to hand over the sound buffer to a separate thread with more exact timing if it is not already available as af function in the AudioToolbox. A small delay would limit choppiness.
Would it be useful to generate sound buffers from the oscillator module? This would allow the oscillator module to generate signals with frequencies that are higher than 1/ tick_duration. Not sue what the use case would be though, except for sound synthesis.
Choppiness is probably fixed with some mutexes and double buffering
The function generator and the audiooutput modules need to use the internal timing functions to ensure smooth output