📖 What Pearson does
Chapter 10 builds a family of circuits that modulate other circuits. Modulation means: take a control signal (often from an LFO, envelope, or other source) and use it to vary a parameter of a sound-generating circuit in real time. Projects:
- The Vantastic Vactrol. A light-controlled variable resistor built from an LED and a light-dependent resistor. The brighter the LED, the more current through the LDR.
- Pulse-width modulation. Vary the duty cycle of a square wave. The “PWM” knob on a Moog synth does this.
- Pulse-width modulation with vactrols. Combine the two above.
- A button-controlled VCA. A voltage-controlled amplifier whose gain is set by a button press.
- An LFO-pingable VCA. Like the above, but the gain is set by a slow LFO.
- The piezo drum trigger. A piezo element that, when struck, produces a short trigger pulse that fires an envelope.
- Ring modulation. Multiply two audio signals. The result has sum-and-difference frequencies. The “Dalek voice” effect.
- Stereo tremolo. A stereo modulator: the left and right channels are modulated by LFOs that are out of phase.
🎓 Background: modulation as a software concept
In code, modulation is a parameter that changes over time. There are three main kinds:
- LFO modulation. A slow oscillator (sub-audio frequency) that drives a parameter. Example: an LFO at 4 Hz modulates filter cutoff. The filter “wobbles” at 4 Hz.
- Envelope modulation. A one-shot rise-and-fall shape. Example: an envelope generator produces a quick attack and a slow decay. The amplitude of a note follows that envelope.
- Step modulation. A pre-set sequence of values. Example: a pattern of pitches (this is the sequencer!).
AMY supports all three. LFOs are exposed via amy_event.mod_source
and mod_target fields. Envelopes are exposed via bp0_times
and bp0_values. Step modulation is what our sequencer does
internally — every step is a discrete jump to a new value.
🔧 Try it on the device
Exercise 1: ring modulation via FX.
The PO-33 has a punch-in effect called RING_MOD (when fully implemented). Ring modulation multiplies the slot with a slow sine wave, producing sum-and-difference frequencies. Try:
> fx RING_MOD
> note 9 60
You should hear a metallic, bell-like tone with a slightly detuned quality. That is the ring modulator at work.
(As of v0.6, the RING_MOD case in apply_fx() is a no-op. The
infrastructure is in place; the wiring is the missing piece.)
Exercise 2: pulse-width modulation via FX.
> fx PULSE_WIDTH
> note 9 60
When wired, this will change the duty cycle of the underlying square wave oscillator. A 50% duty cycle sounds bright; a 10% duty cycle sounds thin and “talkbox-y”.
Exercise 3: tremolo via FX.
> fx STUTTER_4
> note 9 60
The note rapidly retriggers 4 times. This is the gating version of tremolo. For a smoother tremolo, we’d need an LFO driving the amplitude of the note — that is supported in AMY but not wired to a verb.
Exercise 4: an envelope on every note.
Every note event has a built-in envelope. AMY’s default envelope
is “fast attack, medium decay, sustain at half”. It’s what makes a
note sound like a note rather than a drone. Try:
> note 9 60
> note 9 60
> note 9 60
You hear the same note three times, each with the default envelope. That envelope is the closest analog of Pearson’s envelope generator — implemented in software.
🛠 Code reference
- LFO modulation — AMY’s
amy_eventstruct hasmod_sourceandmod_target. We have not yet exposed this via UART. - Envelope — AMY’s
bp0_times[]andbp0_values[]. Default envelope is set inamy_default_event(). - Ring mod FX —
main/audio/amy_bridge.c,apply_fx(),case PO33_FX_RING_MOD:. Currently a no-op; the AMY code is there (awaiting_factorand similar).
🚫 What we can’t simulate
- The vactrol. Pearson’s light-controlled resistor is a beautiful analog of a knob that turns itself. We have no light sensor on our device. The closest is the I²S mic, which is a “sound-pressure controlled gain” — not the same.
- The piezo drum trigger. A piezo’s impulse response is fast (sub-millisecond) and short. Our INMP441 mic has its own AGC (automatic gain control) that smooths impulses. They are not the same.