News for hackers. Stuff that matters.
Re:Digital Audio 101: Playing Audio from a Microcontroller by Nihilartikel on Thursday April 15, 2021 @12:30PM (#26822642)
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

There are no comments on this comment yet.