Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/2026-12-04-fm-take-events-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Octatrack base: unused FM machines leave the frame-path take hooks (LFO depth, frame source, retrig, kill, release, STOP), so a take-only module such as CX OSC costs nothing at rest.
40 changes: 40 additions & 0 deletions docs/verification/2026-12-04-fm-take-events-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Octatrack base: rest unused FM take hooks (4 December 2026)

Status: measured on branch `fix/fm-take-events-rest` (tip `65c533320`, rests commit `7c329fd6f`) for cumulative base `base/octatrack-next`. PR #2603.

## What this proves

Call **or take** hooks may declare `rests` in `events.json`. The seven FM frame-path hooks (LFO depth / frame LFO, release, STOP, retrig, kill, frame source) are marked `rests: true`, so a take-only machine that is installed and unused leaves those rows.

## Unit run

- Machine: MKII OS 1.40C
- Twin: `/Users/iliamurzinov/modwerk-builds/fm-take-rest-midi-20261204` (lean `--dev` USB MIDI + USB Audio MAIN/CUE, module-sets, table-owners), RAM identity `3dfbce8a59b70570…`
- Bank A: A01 medium (trigs 1/5/9/13 on T1,T2,T3,T5,T6,T7; samples on T2 and T5), A02 empty, Part 1 stopped. After twin re-boot, Parts 1–4 track kinds were all STATIC (0), signatures empty.

### CX OSC (curve)

- Package: `0.1.0-experimental` SHA-256 `24712ac8509ece68…`
- Command: `npm run device:price -- --write --curve T1,T3,T6,T7 --pick-pattern 2 --measure-pattern 1 --base 3dfbce8a59b70570 …`

| State | Frame add | Notes |
| --- | --- | --- |
| CX installed, unused (at rest) | **+0** (cpu +0.1) | Was **+20.4** on twin `292a5d1b` without these rests |
| Curve adds (T1, T3, T6) | +20.2, +24.8, +33.8 | first 20.2, each 9; stopped after T6 at 115.1 % (1 skip) |
| First instance on medium | 101.5 % of a frame | Module cost; release gate still fails without a `release-cost` waiver (#2293) |

Trial left `needs-recovery` after the unclean curve stop. Cleared with `machineToStatic` on T1–T8, then `recover`, then a 1 s `set`. Logs: `/tmp/cx-osc-price.log`, `/tmp/cx-osc-price.json`.

### FM Synth (at-rest only)

- Package: subscribe build `01b21edec056979f…` (`synth-take-rest-20261204.mwrm` / `pr2352-synth-subscribe-20261202.mwrm`, byte-identical; 45 hooks, 2 stock-code sites). Catalog `791e26c5…` Detour package refuses install on this tip (`RUNTIME_EVENT`).
- Command: `npm run device:price -- --base 3dfbce8a59b70570 …` (no curve)
- Result: at rest **frame +14.7**, cpu +9 (before frameMax 82.5 → atRest 99.7). Rolled back clean; inventory `[]`.
- Bank A Parts 1–4 had no FM/CX machine on any track when measured. Synth answers `ev_in_use` (`fm_in_use`, sweeps banks/FLEX/GLIDE); take-hook rests only leave it out of those rows when that answers 0. CX has no `ev_in_use` and is base-judged, so the same twin shows take rests work (+0). Synth +14.7 on this card is its in_use path, not a miss of the new take rests.

Logs: `/tmp/synth-at-rest-price.log`, `/tmp/synth-at-rest-price.json`.

## Software checks

- `python3 -B sdk/machines/octatrack/events.py --check`
- `SiteEventTests.test_modules_rest_out_of_the_per_frame_events_only`
17 changes: 9 additions & 8 deletions sdk/machines/octatrack/HOOKS.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ stock runs at once. With no taker stock runs. A **table** has no site: modules c
(order, module id) order. Each take hook and table has a room: the loader refuses a package past it.

A module **rests** until a track uses it: one that subscribes `ev_in_use` and answers 0 is left out of
every hook whose kind says `rests`, so the frame interrupt never enters its code there; its other hooks
every call or take hook whose kind says `rests` (take sites with no remaining taker run stock), so the
frame interrupt never enters its code there; its other hooks
(keys, pages, tables, project files) stay, so its setup still works. The base asks each module on its own
from the UI tick and puts it back, in its (order, module id) place, at the first nonzero answer. A module
that contributes a machine (`ot_machines`) and does not subscribe is answered for by the base: it rests while
Expand Down Expand Up @@ -102,13 +103,13 @@ next base build, which renames them; the base loads them by those paths.
| `ev_hook_reserved_66` | call | none: a module calls the base's `modwerk_raise_ev_hook_reserved_66` through a word the loader fills | Reserved index 66 for CLYPS (#1997). | `void f(void)` | Neutral placeholder: replace when the owning pull request lands on base/octatrack-next. | 10-90 | Reserved hook index; no subscribers on this branch. |
| `ev_hook_reserved_67` | call | none: a module calls the base's `modwerk_raise_ev_hook_reserved_67` through a word the loader fills | Reserved index 67 for CLYPS (#1997). | `void f(void)` | Neutral placeholder: replace when the owning pull request lands on base/octatrack-next. | 10-90 | Reserved hook index; no subscribers on this branch. |
| `ev_hook_reserved_68` | call | none: a module calls the base's `modwerk_raise_ev_hook_reserved_68` through a word the loader fills | Reserved index 68 for CLYPS (#1997). | `void f(void)` | Neutral placeholder: replace when the owning pull request lands on base/octatrack-next. | 10-90 | Reserved hook index; no subscribers on this branch. |
| `ev_fm_lfo_depth` | take | 0x40003ca4 | the LFO routine depth read for FM machines | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_lfo_depth_frame` | take | 0x4000d03e | the frame-builder copy of the LFO depth read | `struct modwerk_take, jsr entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_lfo_depth` | take, rests | 0x40003ca4 | the LFO routine depth read for FM machines | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_lfo_depth_frame` | take, rests | 0x4000d03e | the frame-builder copy of the LFO depth read | `struct modwerk_take, jsr entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_lfo_page` | take | 0x40031e62 | the LFO page resolver branch for FLEX FM tracks | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_amp_release` | take | 0x4000b51a | AMP envelope release consumer before stock staging | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_transport_stop` | call | 0x4000b2c8 | STOP ends FM machine voices | `void f(void)` | A notification: every subscribed engine handler runs; each clears or gates only its own machine voices. Stock runs after every handler. d2-d7/a2-a6 must be kept, as C keeps them. | lower first, then module id; every handler runs. 10-90. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_sequencer_retrig` | take | 0x4000c634 | sequencer START rewrite for FM machines | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_voice_kill` | take | 0x4000685c | voice kill for FM machines | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_amp_release` | take, rests | 0x4000b51a | AMP envelope release consumer before stock staging | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_transport_stop` | call, rests | 0x4000b2c8 | STOP ends FM machine voices | `void f(void)` | A notification: every subscribed engine handler runs; each clears or gates only its own machine voices. Stock runs after every handler. d2-d7/a2-a6 must be kept, as C keeps them. | lower first, then module id; every handler runs. 10-90. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_sequencer_retrig` | take, rests | 0x4000c634 | sequencer START rewrite for FM machines | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_voice_kill` | take, rests | 0x4000685c | voice kill for FM machines | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_midi_chromatic_on_gate` | call | 0x4000e452 | MIDI chromatic note-on octave gate | `void f(uint32_t *wide_mask)` | Every handler ORs its own tracks into wide_mask for notes outside 72..96, then returns. The base runs every handler. If the union is nonzero, it enters stock's wide chromatic block with d3 set to that mask; otherwise it runs the stock octave test. d2-d7/a2-a6 must be kept, as C keeps them. | lower first, then module id; every handler runs. 10-90. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_midi_chromatic_off_gate` | call | 0x4000de10 | MIDI chromatic note-off octave gate | `void f(uint32_t *wide_mask)` | Every handler ORs its own tracks into wide_mask for notes outside 72..96, then returns. The base runs every handler. If the union is nonzero, it enters stock's wide chromatic release block with d4 set to that mask; otherwise it runs the stock octave test. d2-d7/a2-a6 must be kept, as C keeps them. | lower first, then module id; every handler runs. 10-90. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_midi_live_record_event` | take | 0x400625e0 | MIDI live recorder on MIDI event 0x41 | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
Expand All @@ -122,7 +123,7 @@ next base build, which renames them; the base loads them by those paths.
| `ev_fm_octave_func` | take | 0x40051fce | FUNC+UP/DOWN octave on FM tracks | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_slot_assign` | take | 0x400795ba | machine slot assign became-FM predicate | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_load_selector` | take | 0x40022686 | file browser load-selector hook | `struct modwerk_take, jsr entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_frame_source` | take | 0x4000d514 | frame-builder renderer slot copy for FM machines | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_fm_frame_source` | take, rests | 0x4000d514 | frame-builder renderer slot copy for FM machines | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |
| `ev_playback_page_resolve` | take | 0x40031ece | PLAYBACK page resolver FLEX seam | `struct modwerk_take, jmp entry, claims(nothing)` | The taker's entry gets every register and the stack as at the site and replays what the site held (the stock tail below) before it returns to stock; it must not jump into the site's bytes. | 10-29: a machine claiming its own tracks (claims set); 30-49: a machine's bundled feature; 50-69: a standalone feature module. The first record that claims the call takes it. | a task (UI, MIDI, sequencer or project file): short, no firmware call that can block |

## Reviewed subscribers
Expand Down
4 changes: 2 additions & 2 deletions sdk/machines/octatrack/base-binding.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"schema": 1,
"identity": "3ad89c171b83c31cd8212618f2c3a43428a4529d42847297bba22eb28667b1d2",
"identity": "23b620d59b5e156653501a4f943cc98a53213b570f035924ddb0bbecfbf6dbbf",
"arena": 1092470240,
"pool": 1087955104,
"symbols": {
Expand All @@ -15,6 +15,6 @@
"analog-bassdrum": "08055477d673f6f37ce4310fdbd3d2cf89d6588ed66e08ffd6c02ab35fe380b0"
},
"variants": {
"off": "3ad89c171b83c31cd8212618f2c3a43428a4529d42847297bba22eb28667b1d2"
"off": "23b620d59b5e156653501a4f943cc98a53213b570f035924ddb0bbecfbf6dbbf"
}
}
6 changes: 3 additions & 3 deletions sdk/machines/octatrack/base-sizes.json
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,11 @@
},
{
"base": "0.8.7",
"identity": "3ad89c171b83c31cd8212618f2c3a43428a4529d42847297bba22eb28667b1d2",
"identity": "23b620d59b5e156653501a4f943cc98a53213b570f035924ddb0bbecfbf6dbbf",
"layouts": {
"off": {
"main": 1365375,
"container": 850956
"main": 1365379,
"container": 850944
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/machines/octatrack/base-versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
{
"version": "0.8.7",
"identities": [
"3ad89c171b83c31cd8212618f2c3a43428a4529d42847297bba22eb28667b1d2"
"23b620d59b5e156653501a4f943cc98a53213b570f035924ddb0bbecfbf6dbbf"
]
}
]
Expand Down
Loading