fm1-dockfm1-dock

Effects

An effect is an add-on that changes the sound of whatever synth plays. One effect runs at a time, under every synth, before the EQ. You add it as you add a synth, pick it under OPTIONS, and turn its knobs. Eight are in the catalog: CHORUS, FLANGER, DELAY, TRIO, and the four below, which have clips you can play on this page.

  1. Add it

    Open the page in Chrome or Edge, press Connect over USB, choose the Effects filter in the catalog and press Add to my FM-1 on the one you want. It takes a second, as an effect is only a few hundred bytes.

  2. Open OPTIONS

    On the unit, hold HOME, then turn SELECT past the last synth to OPTIONS and go to the line EFFECT.

  3. Pick it

    Press SEL to open the effect's page. SEL there picks the next effect in the dock, and after the last one, OFF. The page draws the effect's own values.

  4. Play and turn

    KNOB1–4 turn its values, and every synth you play goes through it. The values and the choice are kept when you switch off.

With a cable and a computer

tools/dock.py deploy fxdrive.dock adds it and picks it at once. Remove on the card takes an effect out, as it does a synth. The effect's room is its own, so a synth keeps all of its RAM.

If it says TOO SLOW

A heavy synth with a heavy effect can run the audio late. fm1-dock then drops the effect and the synth plays on. Pick a lighter effect, or a lighter synth setting. The table below says what each costs.

Good together

  • DRIVE on a bass or an organ, with TONE down.
  • PHASER on pads and electric pianos.
  • CRUSH on drums and plucks, at 8 bits and RATE 2 to 4.
  • TREMOLO on a guitar-like synth, at 4 Hz.

What each one costs

EffectKnobsAdd-on sizeTime
DRIVEDRIVE, TONE, LEVEL, MIX700 bytesabout 1.4 % of a block
PHASERRATE, DEPTH, FEEDBACK, MIX916 bytesabout 3.4 % of a block
CRUSHBITS, RATE, MIX608 bytesabout 0.6 % of a block
TREMOLORATE, DEPTH468 bytesabout 0.4 % of a block
CHORUSRATE, DEPTH, MIX1 000 bytesabout 2 %
FLANGERRATE, DEPTH, FEEDBACK, MIX1 024 bytesabout 2 %
DELAYTIME, FEEDBACK, MIX828 bytesabout 1 %
TRIOa chorus, a flanger or a delay1 856 bytes1 to 3 %

A block is 256 frames, 5.8 ms. The times for the four new effects are the worst block over a bare sine, measured in the emulator; the older ones are from their catalog entries. They have been run in the emulator and on the computer, and not yet on a real FM-1 or SMK-37; the cards say so until someone has.

DRIVE

Overdrive and distortion

Lifts the sound into a smooth shaper that flattens the tops, then rounds off the highs and sets the level. A little warms and thickens; a lot is a fuzz.

KnobWhat it does
KNOB1 DRIVEhow hard the sound is pushed, 1× to 20×
KNOB2 TONEhow bright it stays after the shaper
KNOB3 LEVELthe output level
KNOB4 MIXhow much clean sound stays
level inlevel out
DRIVE 0DRIVE 20DRIVE 40DRIVE 70DRIVE 100What goes in against what comes out, measured by running the effect on a slow ramp. A straight diagonal would change nothing. Even DRIVE 0 bends it a little. Turning DRIVE up steepens the middle and flattens the ends, and the flat ends are the distortion.

The four clips are set to the same loudness, so you hear the tone and not the volume. The distortion clip has a far lower peak: flat tops carry loudness without height.

  • Cleanno effect

    The source: a plucked saw arpeggio, as a synth hands it to the effect.

  • Crunch60 · 75 · 13 · 100

    DRIVE 60, TONE 75: the pluck gets teeth and the decay stays loud.

  • Overdrive70 · 65 · 12 · 100

    DRIVE 70, TONE 65: thick and compressed, a guitar amp pushed.

  • Fuzz100 · 95 · 10 · 100

    DRIVE 100, TONE 95: all the way up and bright, a square-wave fuzz.

  • Dark fuzz100 · 25 · 10 · 100

    DRIVE 100, TONE 25: the same fuzz with the top cut off, a thick wall.

PHASER

Four moving notches

Each side goes through four all-pass filters whose corner a slow wave sweeps from about 0.4 to 5 kHz, the right a quarter turn behind the left. Mixed with the clean sound, they leave notches that travel through it.

KnobWhat it does
KNOB1 RATE0.05 to 5 Hz
KNOB2 DEPTHhow far the sweep travels
KNOB3 FEEDBACKhow sharp and ringing the notches are
KNOB4 MIXhow much is heard
Spectrogram of noise through PHASER: MIX 50MIX 50
Spectrogram of noise through PHASER: MIX 100MIX 100
Spectrogram of noise through PHASER: MIX 100, FEEDBACK 85MIX 100, FEEDBACK 85
What PHASER does to white noise, frame by frame: the output compared with the input, time left to right (8 s), pitch bottom to top (0 to 5 kHz). Light is unchanged and dark is cut. Notches sweep up and down through the sound, and FEEDBACK adds peaks beside them.

Best on headphones: the two sides sweep out of step.

  • Cleanno effect

    A held chord with a slight left/right detune.

  • Slow swirl20 · 100 · 40 · 100

    RATE 20, DEPTH 100, FEEDBACK 40, MIX 100: a deep, slow sweep through the whole chord.

  • Fast75 · 100 · 50 · 100

    RATE 75, DEPTH 100, FEEDBACK 50, MIX 100: a quick warble.

  • Jet30 · 100 · 90 · 100

    RATE 30, DEPTH 100, FEEDBACK 90, MIX 100: narrow, ringing notches that whistle as they pass.

  • Wide and slow8 · 100 · 70 · 100

    RATE 8, DEPTH 100, FEEDBACK 70, MIX 100: a very slow sweep (12 s a cycle), so this 3-second clip catches only a part of it.

CRUSH

Bits and sample rate

Keeps only the top bits of every sample and holds each value for a few samples: the sound of early samplers and game consoles. Silence stays silent.

KnobWhat it does
KNOB1 BITS2 to 16: how many bits are kept
KNOB2 RATE1 to 40: how many samples each value is held
KNOB3 MIXhow much clean sound stays
16 bit, every frame
4 bit
8 bit, RATE 6
3 bit, RATE 12
A 500 Hz sine, six milliseconds long, after CRUSH. Fewer bits make the steps taller. A longer RATE holds each value for several samples, which makes them wider.
  • Cleanno effect

    The same pluck, untouched.

  • 7 bit, RATE 47 · 4 · 100

    BITS 7, RATE 4 (11 kHz): grain on every note, and the highs fold into a metallic ring.

  • 6 bit, RATE 66 · 6 · 100

    BITS 6, RATE 6 (7.4 kHz): a sampler from the 80s, noisy and buzzy.

  • 4 bit, RATE 104 · 10 · 100

    BITS 4, RATE 10 (4.4 kHz): a handheld game console.

  • 3 bit, RATE 203 · 20 · 100

    BITS 3, RATE 20 (2.2 kHz): wrecked, the notes turn into stepped noise.

TREMOLO

A slow wave in the volume

Moves the level of both sides on a slow triangle. It is the small example in the developer’s guide, now a proper add-on.

KnobWhat it does
KNOB1 RATE0.1 to 10 Hz
KNOB2 DEPTHhow far the level drops
Clean
RATE 40, DEPTH 85
RATE 100, DEPTH 100
The loudness of the held chord over its 3 seconds, as the effect leaves it. Clean holds steady, apart from the chord’s own fade in and out. TREMOLO cuts a wave into it.
  • Cleanno effect

    The same chord, untouched.

  • Slow pulse15 · 100

    RATE 15 (1.5 Hz), DEPTH 100: the chord swells and fades to nothing.

  • Classic40 · 85

    RATE 40 (4 Hz), DEPTH 85: an amp from the 60s.

  • Fast75 · 100

    RATE 75 (7.5 Hz), DEPTH 100: a fast shimmer.

  • Chop100 · 100

    RATE 100 (10 Hz), DEPTH 100: chopped into pulses.

Develop an effect

An effect is the smallest thing you can write for the dock: three functions and a list of up to four knobs. The four above are 50 to 80 lines each. It is built, tested and shared like a synth, and the whole interface is hb_fx_t in firmware/dock/hb_module.h.

1. Write it

modules/fxmine/module.cfg is three lines: name = MINE, version = 1, kind = effect. The code is one file. The developer's guide has the smallest complete one, TREMOLO.

2. Build it

python3 tools/hbmod.py modules/fxmine makes build/modules/fxmine.dock and refuses what would crash the chip.

3. Test the sound

The effect is plain integer C, so it also builds on your computer. tests/fx_dsp_test.py compiles the four effects with tests/fx_host.c and feeds them sines, chords and noise. Copy its checks for yours.

4. Try it in the emulator

tools/dock.py emu --fwsc build/fm1-dock.fwsc --deploy build/modules/fxmine.dock plays it in the emulated firmware and writes audio.wav. The log says effect on, and the render line says what it cost.

5. Put it on a unit

tools/dock.py info first, to see which unit is attached, then tools/dock.py deploy build/modules/fxmine.dock.

6. Share it

Add an entry with "kind": "effect" to docs/modules/modules.json and open a pull request. The catalog guide has the rest.

What DRIVE's run() looks like

/* in place: n frames, L R interleaved, each sample within +-32767; in the audio interrupt, so integers only */
static void run(int32_t *lr, uint32_t n)
{
    int32_t g = gain, a = lp, lv = level, w = wet, ch = 0;   /* the knobs, read once: set() may interrupt */
    uint32_t i;
    for (i = 0; i < 2 * n; i++, ch ^= 1) {
        int32_t x = lr[i], y = shape(x, g), o;                /* lift, then 1.5 t - 0.5 t^3, flat at the ends */
        z[ch] += (int32_t)(((int64_t)(y - z[ch]) * a) >> 16);  /* TONE: a one-pole low-pass */
        y = (int32_t)(((int64_t)z[ch] * lv) >> 16);           /* LEVEL */
        o = x + (int32_t)(((int64_t)(y - x) * w) >> 16);      /* MIX: clean to shaped */
        lr[i] = o > 32767 ? 32767 : o < -32767 ? -32767 : o;
    }
}

Rules that cost us time

  • Keep it integer. No floats, no 64-bit division, no libc. A 64-bit multiply is one instruction.
  • Silence in, silence out. A rounding that floors leaves a small constant offset, and in a feedback loop it stays for ever. CRUSH did this with a quantiser that had no zero, and PHASER with a floored loop. Round to the nearest, and test it with a second of silence.
  • MIX 0 should be the input, bit for bit. It is an easy check, and it catches a gain that is not quite one.
  • Measure what it does, not only that it changes. PHASER once passed a “the spectrum moves” test with the wrong sign on its filter: the notch sat at 11 kHz, where nobody hears it. An impulse through the effect gives its response; tests/fx_dsp_test.py now checks that the notch is below 8 kHz.
  • set() can be interrupted by run(). Write each value as one word, or prepare a set and flag it last.
  • Keep it light. Its time counts with the synth's, and a late block drops the effect (TOO SLOW).
  • Hardware filters. The AC79's biquad unit could run all-pass or filter stages, but the dock's own EQ uses it and effects have no interface to it yet.

Examples: fxdrive, fxphaser, fxcrush, fxtremolo and the older fxchorus, fxflanger, fxdelay.