Skip to content

Improvement: a C runtime package can raise an event with no site (build.py --raise) - #1059

Merged
repeat98 merged 15 commits into
repeat98:mainfrom
stigmagit:improvement/build-c-raise
Nov 1, 2026
Merged

repeat98 merged 15 commits into
repeat98:mainfrom
stigmagit:improvement/build-c-raise

Conversation

@stigmagit

@stigmagit stigmagit commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Improvement: a C runtime package can raise an event with no site (build.py --raise)

What was missing. docs/module-guides/machines.md asks a machine that starts its own note from a trig to ask the
base's raised hook ev_trig_muted first, so a mute module's dropped trigs start no note. An octabam module does that
with "raise" in its runtime.json; a C runtime package (the sources rows of octatrack-module-packages.json) had
no way to: build.py took --subscribe only for C sources. SYNTIZ (#1028), the first native machine written in C,
needs it, and so will the next ones.

What changes.

  • build.py takes --raise EVENT for C sources (repeatable). It goes through the same subscribe(..., raises=...)
    that runtime.json's raise already uses: the module defines its zero word raise_EVENT in initialized data,
    and the event's hook word takes RAISE and that word's offset. A package that only raises is ABI 8, as one that
    subscribes.
  • scripts/octatrack-module-packages.py passes a row's "raise" list to build.py, beside "subscribe".
  • sdk/runtime/loader/README.md and machines.md say how; a changelog entry.
  • The reviewed recipes name build.py's new source hash, as Fix: enforce ColdFire safety checks for C runtime modules #949 did: the images are unchanged and the recipes still
    check every compiled byte. The beta base is regenerated (build.py is one of its inputs) and the base-bound
    packages are bound to it, their bytes unchanged.

How I checked it.

  • New test_c_sources_raise_an_event_as_a_runtime_json_does (sdk/tests/test_runtime_loader.py): a C source that
    raises ev_trig_muted builds, its hook word at index 35 holds RAISE and the offset of a zero word; --raise ev_voice_bind (a site event) is refused. It and the existing raise test pass with m68k-elf-gcc.
  • npm run octatrack:module-packages -- --check: every package identical. npm run pr:ready: Ready.
  • Existing C packages (Beat Slicer's row) build as before: they pass no --raise.

What the guides lacked. machines.md told a machine to raise ev_trig_muted "in runtime.json", which a C
runtime package cannot have; it now names --raise and the package row's raise list.

Also in this PR: twin lessons for docs/OCTATRACK_DRIVING.md

The USB bridge fix this PR first carried is #1024's, already in main: the owner's refresh (005e517) took the bridge
files from main and dropped the duplicate changelog entry. The driving-guide edits below stay.

What the guides lacked. docs/OCTATRACK_DRIVING.md warned about Keeps on a twin, not that a boot can come back
short of a machine without any Keep: the boot's restore refused SYNTIZ as busy while the project played, then every
submission was refused until a RAM boot of the flashed base's own image with the transport stopped. The guide now
says so and to check inventory after any twin and any power cycle.

Two more (30 October 2026, the author's MKII, twin 04e94075): the guide did not say that npm run device -- lifecycle keeps twice: it
accepts a test module, then its removal. Run on a twin as a read, it rewrote both kept-set files, and the flashed
base booted with no modules until they were tried and kept again. Nor did it say how to listen to a machine on a twin:
a project loaded while the machine was absent keeps its tracks drawn as FLEX until a trig or a Part change, and a
machine's trial that ends while tracks name it answers needs-recovery, with broken audio afterwards. The guide now says
to start the try first, load the project after, and load a project without the machine before the trial ends.

The branch also merges current main: machines.md's muted-trig line keeps main's new START bullet and adds the
--raise sentence; the recipes name the merged build.py's hash, and the beta base and package rows are regenerated.

🤖 Generated with Claude Code

stigmagit and others added 3 commits October 29, 2026 20:04
…ld.py --raise)

An octabam module lists raised events under "raise" in its runtime.json;
a C runtime package had no way to, so a machine written in C could not
ask ev_trig_muted which trigs a mute module drops (machines.md). build.py
takes --raise EVENT for C sources, as subscribe() already does for
runtime.json, and the package rows pass a "raise" list. A test builds a
C package that raises ev_trig_muted and checks its hook word.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es still check every compiled byte)

As repeat98#949 did when build.py changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n octatrack:base -- --beta --write, octatrack:module-packages)

The base-bound packages are bound to the new base identity; their bytes
are unchanged (octatrack:module-packages -- --check: identical).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Oct 29, 2026
stigmagit and others added 4 commits October 30, 2026 01:56
…ent is plugged in

usb.core.find(idVendor=0x1935) took the first Elektron device. With an Analog Rytm on the
same bus it took the Rytm, found no Modwerk vendor interface and reported "No unit running
the test base" (author's MKII and Rytm MKII, 30 October 2026). Both bridges now look through
every Elektron device for the one with the vendor interface; a USB error is still raised
when none has it. New test with a Rytm-like device enumerated first; it fails on the old code.

OCTATRACK_DRIVING.md: a trial with no Keep on a twin, ended in needs-recovery, can also leave
the flashed base with its previous set after the power cycle (same night, observed).

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

# Conflicts:
#	docs/module-guides/machines.md
#	sdk/machines/octatrack/base-binding.json
#	src/engine/assets/octatrack-base-variants.json
#	src/engine/assets/octatrack-base.elemod
#	src/engine/assets/octatrack-module-packages.json
…atrack:base -- --beta --write, octatrack:module-packages)

The base-bound packages are bound to the new identity; npm run octatrack:module-packages -- --check: every package identical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e MKII showed, and the RAM boot that restored it)

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

Copy link
Copy Markdown
Owner

Thanks, --raise fits well: it goes through the same subscribe(..., raises=) path that runtime.json's raise uses, and the new test covers it.

One thing: the USB bridge fix here (usb_bridge.py, scripts/octatrack-usb-bridge.py, its changelog entry and the driving-guide line) is the same fix #1024 has carried since 27 October, for the same Rytm-plugged-in case. Please drop it from this PR so it stays one change. Both PRs also regenerate the beta base, so whichever merges second needs main merged in and npm run pr:ready run again. If you'd rather I push that refresh to your branch, just say so.

repeat98 and others added 2 commits October 30, 2026 09:23
Takes main's USB bridge (repeat98#1024 carries the same fix) and drops this
branch's duplicate; generated base files regenerate next.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ack:base -- --beta --write, octatrack:module-packages)

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

Copy link
Copy Markdown
Owner

I've pushed the refresh to your branch (005e517): main merged in, the bridge files taken from main (#1024's fix, now merged) and the duplicate changelog entry dropped, your driving-guide edit kept, and the beta base regenerated. npm run pr:ready says Ready. Please pull before your next push.

repeat98 and others added 4 commits October 30, 2026 14:59
…a base (npm run octatrack:base -- --beta --write, octatrack:module-packages)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…a base on repeat98#1089's (npm run octatrack:base -- --beta --write, octatrack:module-packages)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…as pushed; this push refreshes it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…chine's trial before loading the project

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rged build.py's hash, beta base regenerated (npm run octatrack:base -- --beta --write, octatrack:module-packages)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@repeat98
repeat98 merged commit a43b859 into repeat98:main Nov 1, 2026
12 checks passed
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