[sdiy] In praise of the ATM STM32F303

Olivier Gillet ol.gillet at gmail.com
Fri Feb 12 10:11:24 CET 2016


So many of these string machines have a terrible noise floor! I'm not
surprised that a 12-bit DAC is good enough, and could still be
perceived as an improvement in terms of stability/noise compared to
the original machines.

The most impressive thing for me is how they did with so little
computational power - given that Waldorf claims this thing has full
128-note polyphony!

I wonder how it's done. Here is my theory...

* a big bank of 128 sawtooth oscillators from 8 Hz to 12kHz (all MIDI notes).
* an array of 128 amplitudes for each of these.

The amplitudes array depends on the currently played notes and the
octaves and registration knob. The CPU load is constant - the
oscillators are always rendered even if they have an amplitude of 0.

Assuming the MCU is clocked at 72 MHz, the audio at 32kHz, 5% of the
computational budget is for the filter/FXs and another 5% for
bookkeeping (MIDI decoding, envelopes, modulations, but most
importantly keeping track of the 128 amplitudes), this leaves about 16
CPU cycles per oscillator, including mixing.

That's quite low for a band-limited sawtooth oscillator!

But maybe there's a way of coding a polyBlep oscillator (the simplest
band-limiting scheme I can think of) that makes clever use of the fact
that the frequency is fixed, and known in advance. Firstly, we don't
have to do the costly division by frequency when evaluating the
polyblep function - we can multiply by its reciprocal which would be
precomputed. Secondly, after a phase reset has occurred, we will know
for sure that the next fs/f0 samples will be identical to a naive
sawtooth and won't have any discontinuity, so we can jump to a branch
of code that is specialized for rendering long chunks of samples
without any phase counter overflow check, and no reset handling. This
trick would bring a huge computational gain for the lowest octaves: if
the phase counter is currently at 0.2, the period is 200 samples
(phase increment of 0.005), and we have 64 samples to render, that's
64 samples that can be rendered with naive code, simple enough for an
unrolled loop. Load a few registers, and then go for a long sequence
of two instructions: 1/ increment phase counter, 2/ multiply by
amplitude and store in audio buffer. Now that's fast!

This trick wouldn't allow vibrato/pitch bend. But assuming that the
vibrato rate and amount are sufficiently low - only small wobbles in
pitch - vibrato/bend could be done simply at a global level by messing
with the DAC frequency (easy to do with a built-in DAC, less so if you
use an external audio DAC - another argument for keeping it simple and
do everything with the MCU peripherals).

Olivier

On Fri, Feb 12, 2016 at 7:43 AM, Loscha <loscha at gmail.com> wrote:
> Markus Fuller just uploaded another of his great series of teardown videos.
>
> Today's victim was the Waldorf Streichfett
> https://www.youtube.com/watch?v=umXnCuVBwf0
>
> The entire synthesizer string machine is a single ARM STM32F303 chip.
> There is a power supply chip, an op amp for the audio outs, crystal, but the
> only computational device is the ARM
>
> http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1576/LN1531
>
> Notable for Audio considerations is that the DACs are 12 bit. Given the
> amount of beloved instruments that use 12 bit DACs, and the quality of this
> machine, it hardly seems a limitation.
>
> /Edward
>
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy
>



More information about the Synth-diy mailing list