shorepine / amy

AMY - A high-performance fixed-point Music synthesizer librarY for microcontrollers
https://shorepine.github.io/amy/
MIT License
184 stars 11 forks source link

Faster Juno voices by stacking oscillators #113

Closed dpwe closed 2 months ago

dpwe commented 5 months ago

The Juno (analog-style subtractive synthesis) voices are quite expensive, giving lower polyphony than the DX7 (FM) voices.

One thing that makes these voices expensive is the dynamic filtering (VCF), which needs some fairly complex computation to achieve good dynamic range in fixed-point.

Because of our oscillator-oriented architecture, identical filtering is applied to each oscillator involved in a voice, before summing the outputs. A Juno voice can involve up to 4 oscillators: PWM, Saw, Sub-osc, and noise.

It would be mathematically equivalent (to first order) to sum the oscillator waveforms then apply filtering once, rather than filtering them all individually then summing. In the extreme case, this would reduce the cost of filtering to 1/4.

But this would require a major restructuring of signal flow during osc rendering. We could tie this to the chained_osc structure.

dpwe commented 2 months ago

Applied in bceca72