📖 What Pearson does

Chapter 4 builds a battery-powered amplifier (the LM386 chip with a few capacitors), then uses it to build three projects:

  • A breadboard power amp. Drives a small speaker.
  • Stereo panning. A potentiometer splits an audio signal between two speakers. Twist left, more in the left speaker; twist right, more in the right. Pearson’s implementation uses one pot and three resistors.
  • A plate reverb. A metal plate vibrates. Contact microphones pick up the vibrations. The output is a recognisable reverb sound. This is the “physical reverb” — sound bounces off a physical surface, and the surface re-radiates it back.
  • A talkbox. A small speaker plays audio directly into your mouth. You shape the audio with your mouth. A microphone picks up the result. The effect is the classic “robot voice” from 1970s funk records.

🎓 Background: the digital amp, reverb, and pan

In software, an amplifier is a multiplication: every sample gets multiplied by some gain factor (0…1 for normalise, or higher for “boost”). A pan pot is two multiplications — one for the left channel, one for the right. A reverb is a more interesting operation: a long delay line with feedback, possibly with several parallel delay lines at different lengths.

AMY’s plate reverb is the digital analog of Pearson’s metal plate. Instead of vibrating metal, AMY keeps a circular buffer of audio samples and reads it back at different positions with feedback. The math is similar: Pearson’s metal plate has a “resonance time” of a few seconds; AMY’s reverb has a feedback parameter that controls how long the echoes ring out.

In our firmware, volume is a 5-level scale (F-022: 1…5). Each level is a float multiplier on the velocity field. Level 5 is full velocity; level 1 is 20% velocity. This is the closest thing we have to a volume knob — Pearson’s volume pot is our 5-key BPM + step 1..5 combo.

🔧 Try it on the device

Exercise 1: change the volume.

> volume 1
> note 9 69
> note 9 72

That played A4 and C5 at minimum volume. Now:

> volume 5
> note 9 69
> note 9 72

Same notes, much louder. The “potentiometer” in Pearson’s power amp is the volume verb in our firmware.

Exercise 2: panning.

We don’t expose a pan knob via UART in v0.6. But our hardware has Knob B, which maps to “Tweak Filter” (Knob A = cutoff, Knob B = resonance, F-017). When in tweak mode FILTER, twisting Knob B adjusts the resonance of the low-pass filter on the next triggered note. Pearson’s stereo pan pot is doing a bipolar distribution between two channels; our Knob B is doing a unipolar amplification of a single filter parameter. Different shape, same idea — “a knob that splits one signal into two with different proportions”.

Exercise 3: reverb.

There is no dedicated reverb verb yet, but the AMY library supports a global reverb that all sounds run through. To turn it on, we’d need a UART verb that calls amy_reverb() — which we haven’t exposed yet. The closest available approximation is the LOOP_16 punch-in effect, which loops a slice of the played note and feeds it back on itself — that is, a 1-sample delay with feedback, which sounds similar to a short reverb tail.

> fx LOOP_16
> note 9 69

You’ll hear the A note, then a soft repeating fragment of it that fades out. Not exactly a plate reverb, but conceptually adjacent: a delayed-and-fed-back audio signal is the building block of all reverb algorithms, including the algorithm that builds AMY’s.

🛠 Code reference

  • The 5-level volume scale — main/audio/amy_bridge.c, volume_multiplier(). Levels: 0.20, 0.40, 0.60, 0.80, 1.00. This is applied per-note as a velocity scalar.
  • AMY’s reverb — components/amy/src/amy.c, amy_reverb() function. Sets the global reverb level. We have not yet wired this to a UART verb.
  • The PCM5102A DAC — main/audio/i2s_driver.c (or its successor). Talks to the DAC over I²S, with the DMA feeding samples from AMY’s render buffer.

🚫 What we can’t simulate

  • The talkbox. This requires a plastic tube, a small speaker, and a microphone — all hardware, none of which our firmware controls. The digital analog would be a vocoder, which AMY does support (amy_event.mod_source = ...), but we haven’t wired it to a UART verb.
  • Stereo panning. The PCM5102A outputs stereo, but our firmware mixes everything to mono internally. Panning is a v2 feature.