Bubba Machine

Bubba Machine's audio

Bubba Machine has one goal: the best audio quality the FM-1 allows. This page covers what changed in 0.4.0-beta to get there, what each part costs on the device and, just as plainly, what isn't there yet.

All CPU figures were measured on the author's FM-1 with the firmware console (tools/fm1/traza.py). The details of each measurement are in TRAZA_FM1.md and MOTORES.md (Spanish).

The device

ProcessorJieLi AC791N, two cores at 360 MHz with a single-precision FPU
Outputexternal codec over I2S, 24-bit stereo at 44,117.6 Hz (24 MHz / 544, fixed by hardware)
Memory for recorded sound116 KiB of flash for sampler takes

What improved

1. Everything at 44.1 kHz

In 0.3 the engines ran at 22 kHz and every sample was repeated twice to reach the output. That cuts everything above 11 kHz and leaves images (false highs) above it.

Now the engines and the mix run at the codec's real rate, 44,117.6 Hz, with no oversampling. Highs reach 20 kHz and tuning is exact, because it is computed with the true rate, not with 44,100.

2. Floating-point mixing

0.30.4
Mix businteger, one division per sample and trackfloat, gains computed once per block
Silent tracksstill computedskipped
Live effects capture (stutter, reverse, tape stop)8-bit μ-law16-bit
Delay8-bit μ-law16-bit with interpolated reads
Mix cost with PLAY8.6 % of a core7.3 %, computing twice the samples

Measured on the device, the FPU is 1.5× faster than the 64-bit integer math 0.3 used, so moving to float was both faster and cleaner.

3. Sounds computed live, no low-resolution recordings

0.3 had drum kits recorded at 22 kHz in 8-bit μ-law (nothing above 11 kHz) and low-resolution wavetables. They are all gone. Every sound is now computed on the spot with proven synthesis libraries:

EngineWhat it usesLicense
Modeled drumskick, snare and hi-hat models from Plaits (Mutable Instruments), in float, plus our own clap, cowbell, resonator, noise and FM percussionMIT
ANALOGpolyBLEP oscillators (anti-aliasing), LP 24/12, BP or HP filter with resonance and drive, ADSR, LFO, sync and ringown and MIT (Plaits/stmlib)
6-operator FMmsfa, the engine of Dexed and the same base as the factory firmware; all 32 DX7 algorithmsApache-2.0
ACID4-pole ladder filter with resonance, accent and slideown

Accent doesn't just raise the level: it changes the hit, like a real drum machine.

4. An output without clicks or steps

5. Exact timing

The sequencer counts 96 PPQN from the audio sample counter: there is no separate clock to drift, and every note lands on its exact sample inside the block.

6. Performance: what makes room for quality

Computing twice the samples with better engines only fits if the code is fast. What was measured and changed:

ChangeBeforeAfter
Data cache (SDK setting)4 KiB effective32 KiB: random reads 6-10× faster
Audio compiled for speed (-O2)demo with PLAY: 36.9 % of a core27.7 %
FM, one voice (E.PIANO)6.6 %3.3 %
ANALOG, one voice1757 ns per sample (10 %)654 ns (4.1 %): 7 voices fit with no late blocks

Removing the recorded kits and wavetables made the program 148 KiB smaller and freed 64 KiB of RAM.

What isn't there yet

This is a beta. What limits quality today, plainly:

What's next

  1. Audio on both cores.
  2. Master effects: Mutable Instruments reverb and chorus, tape delay, compressor and leveler.
  3. ACID with Open303 in float.
  4. A higher-quality sampler, within what the flash allows.
  5. Measure the analog output with an audio interface.

See also: sound engines · sound research · FM-1 measurements (Spanish) · changelog.

This page is generated from docs/en/AUDIO.md. Spotted a mistake? Edit the file and send a pull request.