Skip to content

parse: add 'zY' transfer-layer command to start/stop the sequencer#761

Merged
bwhitman merged 1 commit into
mainfrom
claude/sequencer-run-wire-command
Jun 23, 2026
Merged

parse: add 'zY' transfer-layer command to start/stop the sequencer#761
bwhitman merged 1 commit into
mainfrom
claude/sequencer-run-wire-command

Conversation

@bwhitman

@bwhitman bwhitman commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a z-layer command to start/stop the sequencer transport directly:

  • amy.send(sequencer_run=1)zY1sequencer_midi_start()
  • amy.send(sequencer_run=0)zY0sequencer_midi_stop()

Lives in the z transfer/control-command namespace (next to zT/zF/zS/zO/zD/zA/zP) rather than spending a top-level wire letter — Y stays "still available". sequencer_midi_start/stop() are already called in parse.c (file-transfer pause), so no new declarations.

Why

A host that wants to drive sequencer playback (e.g. the AMYboard Online editor's Start/Stop buttons) otherwise has to send MIDI Start/Stop (0xFA/0xFC). After the external-sync gating change, AMY ignores those unless the user enabled external MIDI clock sync (external_midi_sync) — correct for not letting a DAW hijack transport, but it leaves no un-gated way to start/stop the sequencer from a wire message. This adds one. It's also the only lever available to the wasm build, where AMY runs as a separate module reachable only via amy_add_message.

Changes

  • src/parse.c: zY handler in amy_parse_transfer_layer_message (mirrors zO).
  • amy/__init__.py: map sequencer_runzYI.

Testing

make test99 tests pass (additive). End-to-end verified via the companion tulipcc change (AMYboard editor Start/Stop in control and simulate modes).

sequencer_run is a new public amy.send() param name — happy to rename if you prefer.

@bwhitman

Copy link
Copy Markdown
Collaborator Author

🎛️ AMYboard HW CI

Dispatched this PR's amy SHA to the tulipcc bench — it builds the AMYboard firmware with your change and runs it on the physical board (audio spectral-compared to a committed reference). Results post here in a few minutes.

bwhitman added a commit to shorepine/tulipcc that referenced this pull request Jun 23, 2026
AMY ignores incoming MIDI Start/Stop (0xFA/0xFC) unless external MIDI clock
sync is enabled (external_midi_sync) -- correct, so a DAW can't hijack the
board, but it broke the AMYboard Online editor's Start/Stop buttons, which
drove the sequencer with raw 0xFA/0xFC.

Route the buttons through sequencer.start()/stop(), which now send the new
AMY 'sequencer_run' wire command (shorepine/amy#761). That calls
sequencer_midi_start/stop() directly, regardless of sync state, and -- being
a wire message -- works on both firmware (control mode, over the zP sysex
path) and the wasm build (simulate mode, via amy.send in the in-browser
MicroPython). No tulip C binding needed, so this also drops the firmware-only
approach from the previous revision.

- amy: bump pin to the sequencer_run commit (PR #761).
- tulip/shared/py/sequencer.py: start()/stop() -> amy.send(sequencer_run=).
- tulip/amyboardweb/static/spss.js: control_sequencer_start/stop branch on
  amyboard_mode like the tempo control, instead of sending raw MIDI.

Depends on shorepine/amy#761; the pin will move to the merged amy commit
before this merges.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
amy.send(sequencer_run=1) starts the sequencer; sequencer_run=0 stops it, by
calling sequencer_midi_start()/sequencer_midi_stop() directly. This lets a host
(e.g. the AMYboard Online editor) drive the sequencer transport without sending
MIDI Start/Stop, which AMY only honors when external MIDI clock sync is enabled
(external_midi_sync).

Handled in the 'z' transfer-layer command namespace (zY1/zY0), alongside the
other host/control commands (zT/zF/zS/zO/zD/zA/zP), rather than spending a
top-level wire letter. sequencer_midi_start/stop() are already used in parse.c
(file-transfer pause), so no new declarations needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bwhitman bwhitman force-pushed the claude/sequencer-run-wire-command branch from c95f3f6 to 81114a1 Compare June 23, 2026 18:36
@bwhitman bwhitman changed the title parse: add 'Y' wire command to start/stop the sequencer transport parse: add 'zY' transfer-layer command to start/stop the sequencer Jun 23, 2026
bwhitman added a commit to shorepine/tulipcc that referenced this pull request Jun 23, 2026
AMY ignores incoming MIDI Start/Stop (0xFA/0xFC) unless external MIDI clock
sync is enabled (external_midi_sync) -- correct, so a DAW can't hijack the
board, but it broke the AMYboard Online editor's Start/Stop buttons, which
drove the sequencer with raw 0xFA/0xFC.

Route the buttons through sequencer.start()/stop(), which now send the new
AMY 'sequencer_run' wire command (shorepine/amy#761). That calls
sequencer_midi_start/stop() directly, regardless of sync state, and -- being
a wire message -- works on both firmware (control mode, over the zP sysex
path) and the wasm build (simulate mode, via amy.send in the in-browser
MicroPython). No tulip C binding needed, so this also drops the firmware-only
approach from the previous revision.

- amy: bump pin to the sequencer_run commit (PR #761).
- tulip/shared/py/sequencer.py: start()/stop() -> amy.send(sequencer_run=).
- tulip/amyboardweb/static/spss.js: control_sequencer_start/stop branch on
  amyboard_mode like the tempo control, instead of sending raw MIDI.

Depends on shorepine/amy#761; the pin will move to the merged amy commit
before this merges.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@bwhitman bwhitman merged commit 83541b7 into main Jun 23, 2026
9 checks passed
@bwhitman

Copy link
Copy Markdown
Collaborator Author

🎛️ HW CI (physical bench)

Built from this AMY PR, pinned into the tulipcc amy submodule.

AMYboard (USB-MIDI + AMY zP → audio): ✅ PASS — flashed this PR’s firmware; all checks matched the references.

Tulip (TULIP4_R11; serial-REPL audio + WiFi screenshot): ✅ PASS — flashed this PR’s firmware; all checks matched the references.

⬇️ Artifacts: recordings · screenshot · serial logs · run logs

Self-hosted bench. Audio spectral-compared to ref/hwci_basic.wav + ref/tulip_basic.wav; Tulip screenshot pixel-compared to ref/tulip_screenshot.png. Both analog outs share one capture card, so the tests run sequentially.

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