Repository navigation
Model:Cycles base: P1-P4, voice hooks and a sound word, and added machines read as CHORD on the stock OS - #2497
Conversation
The base owns mw_machines (events.json index 6): eight machine slots, 6 to 13, after the six stock machines. A machine module contributes one struct mw_machine (include/mc/machine.h) from its runtime package and claims its slot as machine:<slot>. A slot whose module is gone reads "----" and stays silent, and plays again once the module is back; without a machine module every stock flow is as it was. mw_machine_switches (index 7) lets a machine take PUNCH and GATE as switches: MACHINES held + PUNCH or GATE on a track that plays it flips the switch instead of the stock parameter, the LEDs show the switches while MACHINES is held, and the list opens on the release if no switch was flipped. The switches live in k 32 and are saved with the sound. The record reserves four params for a machine's own parameters (k 23-26 in a later base), so there is one record format; the base does not read them yet. include/mc/sound.h names the words the base adds to a sound and k 32's fields, kept apart by _Static_assert; 0 is "as stock" everywhere. Release base 23a7a53a (94 .boot, 46512 .run, 125060 .bss, 126 sites), flashed on a unit: SINE on trial plays, its switch, saved and loaded, removal and return as recorded in docs/verification. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…achine-table-core
…ase/model-cycles-machine-table-core
With main and base/model-cycles-next merged (a runtime module never patches over the base's own sites), the release base is 7b0c96d9: 94 .boot, 47540 .run, 125060 .bss, 126 sites. Flashed on a unit: set CRC 0xad8b9c8d, SINE kept and played with its switch from a saved project. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…achine-table-core
repeat98#2394) into base/model-cycles-machine-table-core The Model:Cycles sources are unchanged by the merge: the base still builds as 7b0c96d9 (94 bytes .boot, 47,540 .run, 125,060 .bss, 126 sites), matching base-binding.json. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The four params the machine record reserved become real parameters of the OS on k 23-26 (params.c, params.s): MACHINES held + COLOR, SHAPE, SWEEP or CONTOUR turns P1-P4 (descriptors 10-13), with FUNC, Control All, p-locks (rows 24-27) and the LFO; MIDI CC 20-23 set them through the machine CC rows (places 4-7). The popup shows the name, label and range of the selected track's machine; a param without a name shows "---" as on a stock machine, MW_PARAM_HIDDEN keeps a word for the machine's own use. The sound record saves P1-P4 unchanged in slots 24-27 (no XOR: on a load the module may not be there yet to know its defaults); a change to an added machine sets its params to their defaults instead. An LFO's or velocity's destination on a param goes to the low byte of slot 4, where OS 1.13 writes 0 and reads nothing. examples/sine.c takes Tune, Fold and Sub. Release base af9b5c71 (PP02, 51008 .run) on a unit: knobs, p-locks, LFO, save and load, CC 20-23, CC 120/121/123, copy and paste, kit reload, presets, a project through Transfer and back, machine change. Incoming NRPN does nothing on stock 1.13 (0x4000ecb6 is empty), so P1-P4 have none. The held sites follow with the binding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A project with one track on an added machine (6-13) froze stock 1.13 when MACHINES opened: the list's snapshot of all six tracks (0x400a2404 -> 0x400148dc -> 0x4004df5c) takes the record of a machine above 6 from before the record table. The knob lookup (0x4001e814) reads 104(a2)[machine] with no bound, from the sound or, with a trig held, from the step's lock of k 9. As the Octatrack's base keeps a module machine's track FLEX and marks it apart, fallback.c saves an added machine as CHORD where stock reads it and keeps the real number where stock does not: - a sound record: slot 9 CHORD, slot 0 (k 0, read by nothing) holds 0x4d00 | machine; a load puts the machine back where both match. - a pattern's p-locks (after 0x4005b95c, 0x4005ba90; 0x4005b766 on a load): the row of k 9 holds CHORD on each step locked to 6-13, a row of index 33, which stock's load drops, the real values. Stock plays CHORD and a stock save keeps CHORD for good. The stock OS also writes its working state back without a save, so a project used on stock comes back as CHORD. Release base 841c3411 (PP03, 52076 .run) on a unit: a track on SINE and a p-lock to SINE saved, then on stock 1.13 MACHINES, a held trig and a knob freeze nothing and both play CHORD; on PP03 both survive saving and loading. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The release base is 841c3411: 94 .boot, 52076 .run, 125172 .bss, 136 sites. Flashed on a unit as PP03 (set CRC 0x9982f855): a track on SINE and a p-lock to SINE survive saving and loading; on stock 1.13 the same project freezes nothing and plays CHORD. The params before it, af9b5c71, through the owner's list of checks (docs/verification). Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
A base site holds at least 6 bytes (test_machine_base.py), and the knob lookup's vtable entry (0x401005a8) has 4. ParameterPageView's knob lookup (0x4001e814), which only that vtable reaches, now starts with a jmp to mw_param_knob; mw_param_knob_stock runs the two replaced instructions (lea -52(sp),sp ; moveq repeat98#13,d0) and goes on into stock's body. The release base is 12c3fee4: 94 .boot, 52088 .run, 125172 .bss, 136 sites. Flashed on a unit as PP04: P1-P4 on the knobs with their names, "---" on CONTOUR, a p-lock of Fold, KICK's COLOR as stock. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Thanks, this is a very complete write-up, and the stock freeze you found and fixed is exactly the kind of thing the base has to catch. P1 to P4 behind MACHINES, with p-locks, LFO and CC, fits the stack well. The unit record covers each build (PP01 to PP04) and the owner's list of checks.
One thing to settle before this leaves draft:
- A full p-lock file can still hand stock an added machine. In
mw_fallback_locks_saved, when all 80 lock records are in use, row 33 finds no room and the row of k 9 keeps the real values 6 to 13.test_fallback.cpins this as intended. That project then opens on stock 1.13 with an added machine in a k 9 lock, which is the unbounded read at the knob lookup you describe (a held trig reads the step's lock of k 9). Please make stock never see 6 to 13. For example, write CHORD into the row of k 9 even when row 33 doesn't fit, accepting that the lock comes back as CHORD on the base too, or find another way to keep it. Then update the test to match. A unit run of that case is worth adding to the edge-case table if you can fill the file.
For the merge order: this branch carries #2479's commits, and you say #2479 must not go out without the fallback commit. So the owner will likely take both together through this pull request. No action needed from you there.
Everything else (MIDI IN recovery not run, the stock-written CHORD round trip) is recorded honestly, and the owner already accepted the MIDI IN gap on 30 November.
Two tables of the registry, so that a module can change how every track plays, whatever its machine, and nothing changes without one: - mw_voice_hooks (index 8, room 8, 12-byte records): every block, for each track, `before` ahead of the machine's update and `updated` after it, with the voice and the smoothed parameters (p-locks, LFO, velocity in them). No new stock site: mw_update, which the base owns, switches to mw_voice_update while a record is in the row and back without one. - mw_sound_word (index 9, room 1): one module owns k 31 of every sound and names it. While it does, MACHINES held + DECAY turns the word (FUNC, Control All, p-locks, LFO) and CC 73 sets it; without it MACHINES + DECAY turns DECAY and CC 73 writes nothing (descriptor 4's range is 0 .. 0). The base keeps the word in record slot 31 either way, its LFO and velocity destinations as 5 in slot 4's low byte. The Track FX keep k 28 .. 30 (slots 28 .. 30): k 31 is the word's. Release base 49e751ef (AT02, 53701 .run) on a unit with an Attack module built against it: without the module MACHINES + DECAY and CC 73 as stock; with it the word on MACHINES + DECAY, p-locks, the LFO, saving and loading, CC 73. Known: the LFO's destination list shows "----" for descriptor 4 (and for P1 .. P4, since the params) on a machine that has none; to be filtered. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…owner Descriptor 4 (k 31) and 10 .. 13 (P1 .. P4) were LFO and velocity destinations of every machine, so the DEST list showed "----" for each on a machine without them, without any module too. The OS builds that list when the page opens, from the descriptors' flags, so the base now sets the flags (+0x24, 0x600) only where there is an owner: P_i where the selected track's machine has it, k 31 while a module owns the word. On a unit as AT03: without a module the DEST list on TONE has no "----" and no ATK; with the Attack module ATK is in it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Model:Cycles guide and the machines guide name mw_voice_hooks and mw_sound_word (k 31 on MACHINES + DECAY and CC 73) and the new split of k 27-31; the LFO destinations follow their owners. Changelog, the base build 6723c268 and the unit record of checks 30-36. Co-Authored-By: Claude Opus 5.5 <[email protected]>
There was a problem hiding this comment.
Thanks for the voice hooks and the sound word. I read them through: the updates switch over cleanly, and the slots' entries are the base's own, set once at boot, so turning the hooks off never leaves a pointer to a removed module. Keeping MACHINES + DECAY and CC 73 as stock until a module owns k 31, and hiding the empty LFO destinations, is good care for people with no module installed.
New since my last review:
- Claim the new table indices.
mw_voice_hooks(8) andmw_sound_word(9) aren't on the agent board yet. Only tables 0-1 are claimed, by #2479. Please claim them (npm run pr:readydoes it), since released packages will carry these numbers. - The k 28-31 split moves away from what was agreed on 30 November. I've asked the owner to confirm it separately, so nothing for you to do there.
My point from this morning about a full p-lock file still stands: mw_fallback_locks_saved and test_fallback.c still leave the real machine in the row of k 9 when row 33 finds no room.
A machine's own parameters P1-P4 for the Model:Cycles base, as agreed with the owner on 30 November 2026, and a fix for a freeze of the stock OS that the machine table (#2479) brings in. On top of #2479, against
base/model-cycles-next: its eight commits show here until it is merged; this change starts atf333b1ab0.paramsthe machine record reserved become real parameters of the OS on k 23 to 26 (params.c,params.s; the knob lookup through a jmp at its start, 0x4001e814, since a base site holds at least 6 bytes and its vtable entry has 4). On a track that plays the machine, MACHINES held + COLOR, SHAPE, SWEEP or CONTOUR turns P1 to P4 (descriptors 10 to 13), also with FUNC, TRACK (Control All), a held trig (p-lock rows 24 to 27) and as the LFO's destination. MIDI CC 20 to 23 set them through the machine CC rows (places 4 to 7;0x4005a8cereads CC 16 to 23 from those rows only). The popup shows the name, label and range of the selected track's machine; a param without a name reads "---" as on a stock machine;MW_PARAM_HIDDENkeeps a word for the machine's own use. The record saves P1 to P4 unchanged in slots 24 to 27, and an LFO's or velocity's destination on one of them in the low byte of slot 4, where OS 1.13 writes 0 and reads nothing (as agreed). One change to the plan: no XOR in the record. On a load the module is often not there yet (after a power cycle it comes back on trial), so the base cannot know its defaults; instead, a change to an added machine sets its params to their defaults.examples/sine.ctakes Tune (bipolar), Fold and Sub (a switch).0x400a2404→0x400148dc→0x4004df5c), and for a machine above 6 that reads a record from before the record table; the knob lookup (0x4001e814) reads104(a2)[machine]with no bound as well. As the Octatrack's base keeps a module machine's track FLEX and marks it apart,fallback.csaves an added machine as CHORD where stock reads it and keeps the real number where it does not: in the sound record slot 9 CHORD and slot 0 (k 0, read by nothing)0x4d00 | machine; in a pattern's p-locks the row of k 9 CHORD and the real values in a row of index 33, which stock's load drops. A load on the base puts both back. Model:Cycles base 7b0c96d9: the machine table and machine switches #2479 should not go out without this commit; both go out together throughbase/model-cycles-next.mw_voice_hooks(index 8, 12-byte records): every block, for each track,beforeahead of the machine's update andupdatedafter it, with the smoothed parameters; no stock site, the update table the base owns points at the base's dispatcher only while a record is in the row.mw_sound_word(index 9, room 1): one module owns k 31 of every sound; while it does, MACHINES held + DECAY turns it (FUNC, Control All, p-locks, LFO, velocity) and CC 73 sets it (free on 1.13: in no stock descriptor, not caught by the receiver0x400829c6; "Attack Time" by MIDI convention); without it MACHINES + DECAY turns DECAY and CC 73 writes nothing. The base keeps k 31 in slot 31 either way, its destinations as 5 in slot 4's low byte. This changes the agreed split: the Track FX get k 28-30 (three values), k 31 is the word. The first user is an Attack module (own pull request): a rise up to 3 s on every machine, and a trig on a sounding track held back 2 ms while the old note fades, so a slow attack does not click.c3e2c657(PP01),af9b5c71(PP02, the CC rows fixed),841c3411(PP03, with the stock fix) and12c3fee4(PP04, the knob lookup through a jmp at its start), and stock 1.13 in between. The list below. Recovery over MIDI IN is not tested (no MIDI interface, owner, 30 November 2026).Tested on a unit: release base 6723c268 (AT03): the DEST list without a module shows no "----", with the Attack module ATK. Release base 49e751ef (AT02) with the Attack module: MACHINES + DECAY, a held-back trig without a click, p-lock, LFO, save and load, CC 73; after a power cycle CC 73 and MACHINES + DECAY as stock. Release base 12c3fee4, image 977fb45c flashed with Transfer, SINE kept: P1 to P4 on the knobs with their names, CONTOUR "---", a p-lock of Fold, KICK's COLOR as stock. Release base 841c3411, image 6a793c2b, ident set CRC 0x9982f855, 52148 bytes; SINE (1264 bytes) kept when stopped. A track on SINE and a p-lock to SINE saved, another project loaded and this one again: both play SINE. The same kind of project on stock 1.13: MACHINES, a held trig and a knob freeze nothing, both play CHORD. Release base af9b5c71 (image fe08d43c): P1 to P4 on the knobs, "---" on CONTOUR, p-locks, LFO, save and load, CC 20 to 23, CC 120/121/123, copy and paste, kit reload, presets, a project out through Transfer and back, machine change; on stock 1.13 a project with one SINE track froze at MACHINES, which led to the fix.
Edge cases
0x4000ecb6is empty)before.syxover MIDI INGuides: the Model:Cycles README, the machines guide and
include/mc/machine.hsaid the params were reserved; they now say how a machine names them and reads them (mw_machine_param), and what the stock OS does with an added machine. Changelog and the record indocs/verificationfollow the unit runs. Locallypr:ready -- --base-branch base/model-cycles-nextpassed everything butoctatrack-base.test.ts(the path with a space, as in #2479) andzoom-link.test.ts(passes alone); neither is touched here.🤖 Generated with Claude Code