draft: false Name: Canon short-description: Four-voice live canon from a V/oct sequence — 12 presets set up in a web editor, chosen on the card with Z + Main summary: | Canon takes a melody on CV In 1 (with its gate or clock on Pulse In 1) and plays it back as a four-voice canon. Voice 1 is the input line itself; Voices 2, 3 and 4 follow it — delayed in steps or time, at other tempos, or scattered in heterophony — and can be inverted (strict, or tonal in the melody's key or a set key) and shifted by octaves. All settings live in 12 presets, edited in the web editor (Chrome or Edge, over USB MIDI) and stored on the card. On the card: Z Up plays, Z Middle stops, and holding Z Down while turning Main chooses the preset. Presets 1-6 show as one LED lit, presets 7-12 as all lit except one. BEAT Voices enter a set number of steps behind Voice 1, locked to the incoming pulses. Rests are kept. FREE The same, with the delays set as times. STEP All voices share Voice 1's rhythm; each plays the pitch from N notes earlier. TEMPO Tempo canon, each voice at a constant speed ratio. DIVERGE: all start together and drift apart. CONVERGE: the voices enter one by one, meet Voice 1 after N steps (4-2048), then stop. HETEROPHONY Every note is played by all four voices, each a little early or late within a window that drifts smoothly from note to note. Language: C++ (ComputerCard) Creator: James Saunders Version: 0.23.0 Status: WIP License: MIT Editor: web date-created: 2026-10-15 date-updated: 2026-11-15 contact: website: https://www.james-saunders.com tags: - canon - inversion - heterophony - tempo-canon - sequencer - cv - multi-mode panel: inputs: - id: CVIn1 name: Pitch In type: cv description: "V/oct melody to be canonised, quantised to semitones. Calibrate once: patch CV Out 1 -> CV In 1, hold Z Down and power on; an LED bar fills over ~4 s, all six LEDs = saved, LEDs 1+6 blinking = failed." - id: PulseIn1 name: Gate / Clock In type: pulse description: >- Gate (or clock) from the sequencer. Each pulse is a note; the card learns the step length and keeps counting steps through rests. Gates of 20 ms or longer also pass their rests on to the delayed voices. Unpatched, BEAT and STEP run from the internal tempo (set in the web editor). outputs: - id: CVOut1 name: Voice 1 type: cv description: Calibrated 1V/oct — the input line (never inverted) - id: PulseOut1 name: Voice 1 Gate type: pulse description: High while Voice 1 sounds; drops 3 ms before each new note - id: CVOut2 name: Voice 2 type: cv description: Calibrated 1V/oct - id: PulseOut2 name: Voice 2 Gate type: pulse description: High while Voice 2 sounds - id: AudioOut1 name: Voice 3 type: audio description: Built-in triangle synth voice - id: AudioOut2 name: Voice 4 type: audio description: Built-in triangle synth voice controls: switch: up: name: Play description: With Pulse In 1 patched, the canon starts on the next pulse. middle: name: Stop description: All outputs follow the input; LEDs show the active preset. down: name: Choose preset (only while stopped) description: >- Hold and turn Main to choose preset 1-12, shown on the LEDs; release to keep it. Main does nothing until it is turned, so holding Z alone changes nothing. Z held Down at power-on calibrates CV In 1. knobs: - when: { z: up } main: { name: Unused } x: { name: Unused } y: { name: Unused } - when: { z: middle } main: { name: Unused } x: { name: Unused } y: { name: Unused } - when: { z: down } main: name: Preset description: Presets 1-12, set up in the web editor. LED 1-6 alone = presets 1-6; all lit except LED 1-6 = presets 7-12. x: { name: Unused } y: { name: Unused } leds: - when: { z: up } display: list items: - { id: LED0, name: Voice 1, description: Flashes on each Voice 1 note } - { id: LED1, name: Voice 2, description: Flashes on each Voice 2 note } - { id: LED2, name: Voice 3, description: Flashes on each Voice 3 note } - { id: LED3, name: Voice 4, description: Flashes on each Voice 4 note } - { id: LED4, name: Input Pulse, description: Flashes on each pulse at Pulse In 1 } - { id: LED5, name: Clock Present, description: On while a clock is coming in } - when: { z: middle } display: list items: - { id: LED0, name: Preset 1 / 7, description: Alone = preset 1; off with all others on = preset 7 } - { id: LED1, name: Preset 2 / 8, description: Alone = preset 2; off with all others on = preset 8 } - { id: LED2, name: Preset 3 / 9, description: Alone = preset 3; off with all others on = preset 9 } - { id: LED3, name: Preset 4 / 10, description: Alone = preset 4; off with all others on = preset 10 } - { id: LED4, name: Preset 5 / 11, description: Alone = preset 5; off with all others on = preset 11 } - { id: LED5, name: Preset 6 / 12, description: Alone = preset 6; off with all others on = preset 12 } - when: { z: down } display: list items: - { id: LED0, name: Preset 1 / 7, description: Alone = preset 1; off with all others on = preset 7 } - { id: LED1, name: Preset 2 / 8, description: Alone = preset 2; off with all others on = preset 8 } - { id: LED2, name: Preset 3 / 9, description: Alone = preset 3; off with all others on = preset 9 } - { id: LED3, name: Preset 4 / 10, description: Alone = preset 4; off with all others on = preset 10 } - { id: LED4, name: Preset 5 / 11, description: Alone = preset 5; off with all others on = preset 11 } - { id: LED5, name: Preset 6 / 12, description: Alone = preset 6; off with all others on = preset 12 } host: usb: - name: Canon (USB MIDI) role: device description: The web editor reads and writes the 12 presets and the internal tempo over MIDI SysEx (Chrome or Edge), and draws a live score of what is playing. Each voice's notes are also sent as MIDI on channels 1-4 whenever the card is connected. - name: USB serial role: device description: Optional monitor — prints every pulse, note and preset change (Arduino IDE Serial Monitor, any baud).