Skip to content

Fix GM drum examples: use patch=258 instead of the old wave=amy.PCM recipe#1067

Merged
bwhitman merged 1 commit into
mainfrom
claude/fix-gm-drum-recipe
Jul 1, 2026
Merged

Fix GM drum examples: use patch=258 instead of the old wave=amy.PCM recipe#1067
bwhitman merged 1 commit into
mainfrom
claude/fix-gm-drum-recipe

Conversation

@bwhitman

@bwhitman bwhitman commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

What

The old recipe for GM/808 drums on channel 10 —

amy.send(synth=10, num_voices=N, oscs_per_voice=1, synth_flags=3, wave=amy.PCM, amp=5)
amy.send(synth=10, note=36, vel=1)   # expected: kick

no longer makes any sound on current AMY. This updates the examples and docs that still show it to the working form:

amy.send(synth=10, num_voices=N, synth_flags=3, patch=258)
amy.send(synth=10, note=36, vel=1)   # kick (38 snare, 42 hat, 46 open hat, 49 crash, ...)

Why it broke

Two AMY changes:

  1. synth_flags bit 1 used to be a built-in GM-drum note→sample map (SYNTH_FLAGS_MIDI_DRUMS). That machinery was removed (moved into patch 258) and the bit was later repurposed as SYNTH_FLAGS_NOTES_VIA_MIDI. So GM note numbers alone no longer select a drum sample.
  2. A bare wave=amy.PCM osc with no preset is silent — pcm_note_on() requires a preset, and note=36 doesn't select one.

The drum-kit note→sample mapping now lives in AMY patch 258 (the same kit amy_default_synths() loads on channel 10). Verified by building the AMY Python module and rendering: the old recipe → silence (peak 0.0), patch=258 → kick (peak 0.36) with the full kit mapped across GM notes.

Changes

  • tulip/amyboardweb/sketches/acid_generator.py — synth 10 drum setup → patch=258
  • tulip/amyboardweb/sketches/house_generator.py — synth 10 drum setup → patch=258
  • AMY_AGENTS.md — fixed the four-on-the-floor example + added a note explaining the change
  • docs/amyboard/python.md — fixed the default-sketch drum line; named patch 258 as the GM kit
  • docs/music.md — clarified that channel 10 is the GM drum kit (patch=258)

The other wave=amy.PCM sketches (wavfile.py, sampler.py) already pass an explicit preset=, so they still work and are untouched.

Note on _auto_generated_knobs

acid_generator.py's machine-generated _auto_generated_knobs block still contains the old-style synth-10 wirecodes (i10...w7p1...). I left it alone since it's marked "Do not edit — set automatically by the knobs." It's harmless here: run_sketch() applies the knob block before importing the sketch, so the top-level patch=258 call runs last and wins. Regenerating it through the AMYboard Online knob UI would clear the stale lines if desired.

🤖 Generated with Claude Code

….PCM recipe

The old way to get GM/808 drums on channel 10 —

    amy.send(synth=10, num_voices=N, oscs_per_voice=1, synth_flags=3, wave=amy.PCM, amp=5)

no longer makes sound on current AMY. Two AMY changes broke it:

  * synth_flags bit 1 used to be a built-in GM-drum note map; it was removed
    (moved into patch 258) and later repurposed as SYNTH_FLAGS_NOTES_VIA_MIDI,
    so note numbers alone no longer select a drum sample.
  * a bare wave=amy.PCM osc with no preset is silent (pcm_note_on requires a
    preset), and note=36 does not select one.

The drum-kit note->sample mapping now lives in AMY patch 258, so the fix is:

    amy.send(synth=10, num_voices=N, synth_flags=3, patch=258)

Updates the two affected sketches (acid_generator, house_generator) plus the
docs that showed the old recipe: AMY_AGENTS.md, docs/amyboard/python.md,
docs/music.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bwhitman bwhitman merged commit 7558c43 into main Jul 1, 2026
2 checks passed
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

🔌 AMYboard PR preview

Editor + flasher: https://amyboard-pr-1067.vercel.app/editor/

This preview bundles this PR's firmware — its flasher only flashes this build (not the release). Rebuilt on every push; removed when the PR closes.

The hardware CI has been kicked off and should return within a few minutes, stand by!

@bwhitman

bwhitman commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator Author

I also updated all the broken ABW sketches (there were 38) by grepping

bwhitman added a commit that referenced this pull request Jul 2, 2026
)

Expand the AMYboard HW CI beyond the built-in reference tones: after the
tones, download real AMYboard World sketches (shorepine's acid_generator,
house_generator, universal_hair, woodpiano), push each onto the board over
the SysEx "write to sketch" flow (docs/amyboard/control_api.md), drive it
with a simple MIDI arpeggio, record it, and spectral-compare to a committed
reference. This covers far more of AMY than the tones — the drum-heavy
generators exercise the path PR #1067's drums regression broke, which the
tone-only test missed.

The World sketches are fetched with stdlib urllib (the Pi CI venv has no
requests) and transferred with proper AK flow control — a stdbuf -oL
`amidi -d` reader on the Pi / mido input callback on mac, one frame in
flight. Without it the larger sketches' chunked transfers overflow the
board's SysEx ring buffer and corrupt sketch.py, which self-heals to the
silent default; the generative sketches recorded as silence until this was
added. The random *_generator sketches still reproduce at ~0.98 spectral
similarity run-to-run (timbre is stable even when the notes aren't), so they
compare with the existing timing/phase-invariant avg-spectrum metric.

References captured on the bench against the rolling amyboard release and
listened-to before commit. Disable the suite with --no-flash's sibling
--no-world.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant