Skip to content

Model:Cycles base: P1-P4, voice hooks and a sound word, and added machines read as CHORD on the stock OS - #2497

Draft
durchgemacht wants to merge 19 commits into
repeat98:base/model-cycles-nextfrom
durchgemacht:base/model-cycles-machine-params
Draft

durchgemacht wants to merge 19 commits into
repeat98:base/model-cycles-nextfrom
durchgemacht:base/model-cycles-machine-params

Conversation

@durchgemacht

@durchgemacht durchgemacht commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

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 at f333b1ab0.

  • What works: the four params the 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; 0x4005a8ce reads 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_HIDDEN keeps 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.c takes Tune (bipolar), Fold and Sub (a switch).
  • The stock fix (own commit): with Model:Cycles base 7b0c96d9: the machine table and machine switches #2479 alone, a project with one track on an added machine freezes stock 1.13 as soon as MACHINES opens (shown on a unit with one SINE track and nothing else). The list builds a snapshot of all six tracks (0x400a2404 → 0x400148dc → 0x4004df5c), and for a machine above 6 that reads a record from before the record table; the knob lookup (0x4001e814) reads 104(a2)[machine] with no bound as well. 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 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 through base/model-cycles-next.
  • Voice hooks and the sound word (later commits): two more tables so that a module can change how every track plays, whatever its machine, and nothing changes without one. mw_voice_hooks (index 8, 12-byte records): every block, for each track, before ahead of the machine's update and updated after 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 receiver 0x400829c6; "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.
  • LFO destinations: P1-P4 and k 31 showed "----" in the DEST list on every machine without them, with no module too. The OS builds that list from the descriptors' flags when the page opens, so the base sets the flags only where there is an owner.
  • What is broken: a project used on stock comes back as CHORD. Stock writes its working state back without a save (the sound came back as CHORD, without the mark and with P1 to P4 at 0). A lock to an added machine came back as CHORD too, although the pattern's file still held the row of index 33; not followed further. On the base alone everything survives saving and loading. MIDI CC 20 to 23 also reach a hidden param (none exists yet).
  • What it means musically: with a machine module, four more knobs of its own behind MACHINES, with p-locks, LFO and MIDI. A project with such a machine still opens on stock 1.13 and plays CHORD there instead of freezing the unit.
  • Ran on a unit: yes, my own Model:Cycles, four release builds flashed with Transfer: c3e2c657 (PP01), af9b5c71 (PP02, the CC rows fixed), 841c3411 (PP03, with the stock fix) and 12c3fee4 (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).
  • Who must act: the owner reviews.
  • Next: the Attack module, then the Track FX on k 28 to 30, then a kept module restored after a power cycle.

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

Case Why this change makes it a risk How run Result
P1 to P4 on the knobs MACHINES held takes the four knobs PP01 and PP04, MACHINES held + COLOR, SHAPE, SWEEP, CONTOUR on SINE pass: Tune, Fold, Sub heard and named; CONTOUR "---"; no list on the release
A stock machine only a machine with params may change MACHINES on KICK pass: the list on the press, "---", no P in the LFO's destinations
p-lock and LFO, saved rows 24 to 27, slots 24 to 27 and slot 4's low byte a lock of Fold on step 1, an LFO on Tune, saved and loaded pass: lock on step 1 only, all kept
MIDI CC 20 to 23 the machine CC rows carry them CC 20 to 23 into the track's channel PP01 fail (no CC arrived), PP02 pass: 20 Tune, 21 Fold, 22 Sub, 23 nothing
CC 120, 121, 123 and NRPN the CC table was touched (owner's list) a hanging chord, then 123, 120; 121; NRPN 1:30 pass: 123 and 120 end it, 121 nothing; NRPN does nothing on stock 1.13 (0x4000ecb6 is empty)
Copy, kit reload, presets, Transfer P1 to P4 and slot 4 travel with the sound (owner's list) copy and paste, kit reload, a preset, the project out through Transfer and back pass: kept; in the dump slots 24 to 27 and slot 4's low byte, the high byte 0
Machine change defaults instead of XOR SINE → KICK with the LFO on Fold → SINE pass: KICK normal; SINE takes its defaults, the destination stays
An added machine on stock stock reads machines 0 to 5 only PP02: one track on SINE, saved, stock 1.13, MACHINES fail before the fix: the unit froze
The same with the fix the fix must keep stock safe PP03: a track on SINE, a lock to SINE, saved; stock 1.13: MACHINES, a held trig and a knob, PLAY pass: nothing freezes, both play CHORD
Back from stock the base must find the mark again that project on PP03 again fail: both CHORD, stock wrote its working state back (see above)
Save and load on the base the mark and row 33 must come back PP03: a new project, a track on SINE, a lock to SINE, saved, another project, this one again pass: both SINE
No sound-word module MACHINES + DECAY, CC 73 and the DEST list must stay stock's AT01/AT03 without a module: MACHINES + DECAY, CC 73 after a power cycle, the DEST list on TONE pass: DECAY as stock, CC 73 nothing, no "----" (AT01 showed five, fixed in AT03)
A sound-word module descriptor 4, CC 73, slot 31 and the hooks must reach it AT02 with an Attack module: MACHINES + DECAY, p-lock, LFO, save and load, CC 73 pass
A trig held back by before the hook may hide +0x34 Attack 0.55, trigs faster than the sound pass: a soft restart, no click
Recovery with the stock .syx over MIDI IN a base must never block the way back not run not run: no MIDI interface here
A power cycle with a kept module, Control All, a hidden param modules live in RAM; no hidden param exists yet not run not run: restoring after a power cycle is a later step, Control All needs a second track with params, no machine has a hidden param yet

Guides: the Model:Cycles README, the machines guide and include/mc/machine.h said 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 in docs/verification follow the unit runs. Locally pr:ready -- --base-branch base/model-cycles-next passed everything but octatrack-base.test.ts (the path with a space, as in #2479) and zoom-link.test.ts (passes alone); neither is touched here.

🤖 Generated with Claude Code

durchgemacht and others added 14 commits November 30, 2026 14:25
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]>
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]>
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]>
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]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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.c pins 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.

durchgemacht and others added 5 commits December 1, 2026 15:23
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]>
…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]>
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]>
@durchgemacht durchgemacht changed the title Model:Cycles base: a machine's own parameters P1-P4, and added machines read as CHORD on the stock OS Model:Cycles base: P1-P4, voice hooks and a sound word, and added machines read as CHORD on the stock OS Dec 1, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) and mw_sound_word (9) aren't on the agent board yet. Only tables 0-1 are claimed, by #2479. Please claim them (npm run pr:ready does 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.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant