3 ms·
It's a little bit more complexity, but cheesy 'multitasking' can be achieved with interrupts on HW timers. The main loop sets the synth 'state' and the interrup
by Nihilartikel 6y ago
It's a little bit more complexity, but cheesy 'multitasking' can be achieved with interrupts on HW timers. The main loop sets the synth 'state' and the interrupts act on it.
In DuinoTune [1] the song playback had a per song 'tick' timer interrupt at 12 per beat which handles note on/off, envelope, pitch/audio glides. And a per-sample timer interrupt which does a mixdown of the voices and updates the hardware PWM duty-cycle to generate the waveform.
[1] https://github.com/blakelivingston/DuinoTune https://github.com/blakelivingston/DuinoTune