📖 What Pearson does

Chapter 9 builds circuits that “harmonize with themselves” — i.e., take one input signal and produce one or more additional signals that are musically related to the input. Projects:

  • Octave harmonizer. Plays the same note one octave up.
  • Subharmonic generator. Plays the same note one octave down.
  • 10-stage wavetable generator. Plays a sequence of pitches chosen from a 10-element “wavetable”. This is a digital technique using the 4017 decade counter.
  • The FM Yodeler. Frequency-modulates one oscillator with another at audio rate, producing the “yodel” sound.

🎓 Background: harmonization in software

In our firmware, the closest analog of “play the same note one octave up” is the note verb with a different MIDI number:

> note 9 60
> note 9 72

MIDI 60 is C4; MIDI 72 is C5. That is one octave up. Same idea as Pearson’s octave harmonizer; different math.

Frequency modulation in our firmware is AMY’s FM synth:

amy_event e = amy_default_event();
e.synth = 1;        /* FM synth */
e.patch_number = 1; /* patch 1: bell-like FM */
e.frequency = 440.0;
e.midi_note = 60;
amy_add_event(&e);

That makes a bell-ish FM tone. The “yodel” character comes from modulating frequency with another oscillator. AMY exposes this through mod_source and mod_target fields. We have not wired this to a UART verb yet, but the AMY primitive is there.

🔧 Try it on the device

Exercise 1: octave up.

> note 9 60
> note 9 72

You’ll hear the same note one octave apart. That is the simplest “harmonizer” in the world.

Exercise 2: octave down.

> note 9 72
> note 9 60

Same, but down.

Exercise 3: full chord.

Play the C, E, G, B notes of a Cmaj7 chord:

> note 9 60
> note 9 64
> note 9 67
> note 9 71

That’s a 4-note chord. The firmware handles the polyphony.

Exercise 4: load a different waveform via FX.

> fx SCRATCH
> note 9 60

SCRATCH (when fully implemented) loads a different AMY patch. Different patches sound different — one might be a sine, another a saw, another a complex FM sound. This is the closest analog to Pearson’s “10-stage wavetable generator”: a small set of named sounds you can step through.

🛠 Code reference

  • The note verb — main/main.c, cmd_note(). Maps MIDI numbers to AMY frequencies (440 × 2^((note - 69) / 12)).
  • AMY FM synth — components/amy/src/amy.c, function amy_event_set_osc(). Sets up FM operators.
  • Scratch FX — main/audio/amy_bridge.c, apply_fx(), case PO33_FX_SCRATCH:. (Note: this case is currently a no-op in v0.6; the AMY infrastructure is in place but the verb is not wired yet.)

🚫 What we can’t simulate

  • Subharmonic generation. Halving the playback speed of a recorded sample is one way; our firmware doesn’t expose this.
  • Wavetable synthesis. AMY’s oscillator engine is subtractive/additive, not wavetable. A wavetable oscillator is on the AMY roadmap but not currently shipped.
  • FM Yodeler. The AMY FM patch is usable but is not wired to a UART verb. The closest is the implicit direct “FUTURE” plan in TODO.md.