[sdiy] In praise of the ATM STM32F303
Tom Wiltshire
tom at electricdruid.net
Fri Feb 12 12:11:08 CET 2016
Interesting theory, Olivier.
Here's a modified alternative:
Keep the array of amplitudes, but change the way the bank of oscillators is calculated.
Do it using the same method as the original string machines. We have 12 oscillators tuned to the top octave. Twelve NCO updates doesn't take long to do. The oscillators drive binary counters, which then provide all the different octaves you need in their various bits.
In order to provide output waveforms, you shape the square-wave outputs from the counter bits using a one-pole IIR filter. This simulates simple RC filtering and gives you somewhere between a triangle wave and a "shark's fin", depending on your filter coefficient. It *must* be quicker to calculate a IIR filter than do a PolyBLEP.
Tom
On 12 Feb 2016, at 09:11, Olivier Gillet <ol.gillet at gmail.com> wrote:
> 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
>>
> _______________________________________________
> 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