Skip to content

Improvement: add SNAP alignment to Octatrack sample editor - #1165

Open
twwwy wants to merge 10 commits into
repeat98:mainfrom
twwwy:feature/beat-slicer-snap-base-api
Open

twwwy wants to merge 10 commits into
repeat98:mainfrom
twwwy:feature/beat-slicer-snap-base-api

Conversation

@twwwy

@twwwy twwwy commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

What was hard

Beat Slicer 0.1.68 needs SNAP-aware grid alignment in the Octatrack sample editor. The shared editor service did not expose it, and the SLICE GRID shortcut needs to cycle safely through installed module actions.

What this changes

Adds an optional SNAP alignment mode to the sample-editor API while preserving the ABI-1 prefix and existing non-SNAP behavior. The beta base passes FUNC+AED from stock SLICE GRID through registered grid actions in order and back to stock; with no actions it stays stock. Actions retire their editor token on FUNC/AED before passing the key through. The guide and changelog describe the behavior beta testers receive when this base is deployed. The shared-base change does not itself publish Beat Slicer 0.1.68.

How I checked it

  • On the RAM-booted beta base efab14e5…, the frontend trialled the usual 17 modules plus published Beat Slicer 0.1.66. The device self-test passed: 18/18 intact and 7/7 DSP effects exercised, zero failures. Whole-set Undo first returned needs-recovery; retry 17 succeeded and a fresh status confirmed the original beta-base active digest and empty baseline. The reason for the recovery responses was not established.
  • On the same beta base, the author reports that FUNC+AED from the published 0.1.66 CREATE BEAT GRID popup opened stock CREATE SLICE GRID. A separate trial of private 0.1.68 package 195d2b46… produced a grid with SNAP OFF and another with SNAP ON; the author reports both completed normally. Each single-module trial was Undone and the beta base's empty baseline verified. These reports do not establish exact boundaries, audible output or persistence.
  • The earlier 19-module full-set Undo on a different measurement base removed nine rows but remained in recovery after the host's bounded retry; its cause is still unknown. Power cycling restored that earlier original base and set, but did not qualify Undo. The exact-build results above do not explain that failure.
  • npm run pr:ready -- --remote upstream: Ready after merging upstream main; 2,799 tests passed and one skipped, with SDK checks, lint, typecheck and build passing.
  • Isolated, network-disabled source builds reproduced the committed Octatrack packages and all 35 current source-only Elemod exports. Two Elemod builds matched. The Octatrack container used an explicit Git safe-directory setting for its isolated source mount on macOS.
  • On the separately instrumented measurement base, SNAP OFF matched five expected grid boundaries; SNAP ON matched [0, 22061, 44111, 66161, 88211, 90000] over 144 pair reads. The author listened and reported no audible problems. This is one alignment case, not general release or persistence qualification.

Guides and remaining review

The sample-editor guide lacked the SNAP contract and FUNC+AED cycle, including token retirement. Updated sdk/machines/octatrack/SAMPLE_EDITOR.md and the dated changelog; the guide records both hardware trials and their limits. No firmware or stock image is committed.

The earlier stalled full-set Undo remains unexplained. #1098 is still open and rebuilds the base; rerun pr:ready and reassess exact-build evidence if that merge changes this base. #1108 closed without merging. Keep this PR in draft while the rollback concern is reviewed.

Related to #1056.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 2, 2026
@repeat98

repeat98 commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Thanks, I read through it. The API shape is good: the options tail keeps the ABI-1 prefix, 0.1.66 keeps working because it only checks bytes >= sizeof *api, and 0.1.68 falls back when the tail is missing, so the module isn't tied to this base. Making FUNC+AED one cycle that every grid action can join is the right way to do it too.

A few things before it can go in:

  1. Changelog and guide wording. Both call this a "private proposal" that "is not part of the released beta base". Merging this rebuilds the beta base, and that base deploys to every tester when main is pushed. The changelog should say what testers get, and the new SAMPLE_EDITOR.md section should describe the contract rather than a review status.
  2. Document FUNC+AED. The base now handles FUNC+AED from the SLICE GRID through each module action and back to stock. The PR description, the guide and the changelog don't mention it. Please add it to SAMPLE_EDITOR.md: when stock keeps the chord, the order of the cycle, and what an action has to do to join it (retire its token on FUNC/AED before passing the key on).
  3. Question: the published 0.1.66. Testers will run this base with Beat Slicer 0.1.66, which was written before the shortcut existed. Have you tried that pair? I'd like to know what a second FUNC+AED does while 0.1.66's popup is open.
  4. Test the exact base. The SNAP result came from an instrumented measurement base. Before merge, please put the beta base this PR builds on a unit over USB and run a base update, a self-test with your usual set, SNAP OFF and ON once, and an Undo. The earlier full-set Undo that got stuck still has no explanation, and that matters more for a base every tester gets.

#1098 and #1108 also rebuild the base. Whichever merges last regenerates it, so expect to run pr:ready once more after them. Mark it ready for review when the points above are done and I'll take it from there.


Generated by Claude Code

@repeat98

repeat98 commented Nov 5, 2026

Copy link
Copy Markdown
Owner

Thanks, this covers my points:

  • The changelog and the guide describe what testers get.
  • FUNC+AED's cycle and the token rule are in SAMPLE_EDITOR.md.
  • 0.1.66 brings up stock CREATE SLICE GRID on a second chord.
  • SNAP OFF and ON ran on the exact base efab14e5…, which is still what this branch builds.

On the rollback: a first needs-recovery that clears on a retry happens on main's bases too. Output Matrix's USB record shows one, and the site retries a rollback from recovery for that reason. So I don't count it against this PR. The Undo that stayed stuck ran on a different measurement base. If it happens again on a shipped base, it gets its own issue.

The only thing left from my list is the base update: these runs RAM-booted the base and nothing was flashed. I'll run that update on my unit myself once I'm back from holiday, before I merge, so please mark it ready for review. #1098 and #1007 also rebuild the base. Whichever of them merges after this one regenerates the base, so pr:ready may need one more run here if one of them goes first.


Generated by Claude Code

@twwwy
twwwy marked this pull request as ready for review November 5, 2026 08:53
@twwwy

twwwy commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

A question for after this merges, not a blocker for it.

Beat Slicer is USB-only because card firmware has no base: manifest.py says it has no card form, and usb-only.ts keeps source packages out of card builds. Members who flash card firmware can't use it at all. Would you want a card form?

A card form could be built the way MIDI generators do it without the base. On card builds only, Beat Slicer would link its own copy of the sample-editor service, including this PR's SNAP addition, and patch the service's five stock sites itself. Over USB it would keep using the base's service. That would need:

  • the card builder to compile or link C runtime code, which it doesn't do today;
  • free-space placement in the card image that passes the pair ledger;
  • a uiClaims entry for the AED SLICE menu, so a later AED SLICE module would clash with it on card builds (over USB they would share the base's menu);
  • separate hardware evidence from a flashed card image.

It reintroduces the per-module patching that SAMPLE_EDITOR.md says the base was meant to avoid, so I'd rather ask first. Which do you prefer?

  1. Keep Beat Slicer USB-only.
  2. A card form carried by the module, as above.
  3. Card builds carrying base services such as the sample editor for any module that needs them.

Whichever you choose, 0.1.68 would ship USB-only, and any card form would come as its own later release.


Generated by Claude Code

@repeat98

repeat98 commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Thanks for asking first. Let's keep Beat Slicer USB-only (1). A card form carried by the module would bring back the per-module patching of the five sample-editor sites, which is exactly what the base's service is there to own, and it would add a card-only uiClaims clash and a second set of hardware evidence. Option 3 is a bigger change to card builds than one module justifies right now, so USB stays the home for modules that use base services.

One thing on this PR: main has regenerated the base since your last merge, so it now conflicts in base-binding.json, octatrack-base.elemod, the base variants and sources, and octatrack-module-packages.json. Please merge main (not a rebase), let npm run pr:ready regenerate them until it says Ready, and push. Then I'll run the base update on my unit with the base it builds, as I said, and merge.

twwwy and others added 2 commits November 8, 2026 04:46
Regenerated the beta base with npm run octatrack:base -- --beta --write.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
npm run octatrack:module-packages -- --base-only --stock OS.bin: only
requiredBase and Recorder Loop Fix's linked bytes moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@twwwy

twwwy commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

Merged main (not a rebase) and regenerated the beta base: af154d00…. The five base-bound packages are relinked with octatrack:module-packages -- --base-only; only requiredBase and Recorder Loop Fix's linked bytes moved. pr:ready says Ready and all checks are green on 10c84274, so it's ready for your base update on the unit.

Guides: one gap. A local base build needs ELEKLOADER_DSP_ASM pointing at a built dsp_asm, and only a note in OCTATRACK_HARDWARE_TRAPS.md says so.


Generated by Claude Code

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants