Skip to content

Improvement: the Rytm base gives send effects the sequencer's time, SRC + YES random, MISSING left with FUNC + A, a 32 KB work area - #1097

Merged
repeat98 merged 13 commits into
repeat98:mainfrom
stigmagit:improvement/rytm-base-fx-clock
Nov 5, 2026
Merged

repeat98 merged 13 commits into
repeat98:mainfrom
stigmagit:improvement/rytm-base-fx-clock

Conversation

@stigmagit

@stigmagit stigmagit commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

The Rytm base change the original send effects need, as agreed on #878: the base PR first, then one PR per effect.

What changes

  • The sequencer's time for send effects (elekloader/base/clock.c, mw_fx_clock() and mw_fx_step() in include/modwerk/fx.h). It is read from the Rytm's own sequencer: its 24 PPQN pulses from PLAY, the playing pattern's speed and its SWING. An effect never keeps a clock of its own (sequencing). The pattern reads and divisions run only for an effect that asked in the block before, so an effect that does not ask costs nothing.
  • SRC + YES on SEND FX sets A-H at random, with a FDBK control kept below its runaway (100 of 127). SRC + NO brings the values back once. This ports Send FX's gesture, on the base's own page.
  • MISSING is left with FUNC + A: turning right picks the first effect, left the last. Before, a kit whose effect was missing kept the chooser stuck.
  • TRK lets go of the page as every other key does. A double press on TRK opens stock's list, which stock draws without asking the page again, so the SEND FX page was drawn over it (seen on the author's unit). It was reproduced in rytm-emu on Send FX, which draws the same way. With the fix, a double press shows the list cleanly and a single press keeps the page; closing the list could not be checked there, because the list ignores keys in rytm-emu, on the stock page too.
  • The work area drops from 64 KB to 32 KB (MW_FX_WORK 16384 → 8192 words). With 64 KB, the 128 KB mods area could not hold the twelve planned effects beside Loop Sync and Retrig Grid: they were 16,784 bytes over. With 32 KB, all fifteen send effects link with 15,884 bytes to spare. CHORUS, FLANGER and PHASER use 4,096 words, so they are unchanged. This is the one ABI change: an effect that asks for more than 8,192 words is refused by the base, as before for more than 16,384. None exists.

After review (1 November)

  • mw_fx_clock is in the core profile's exports (sdk/analog-rytm-mkii/core-profile/interface.json), beside the other mw_fx_ symbols.
  • Swing: the effects' grid swings every second step by the pattern's SWING, as if each odd step had a swing trig; the pattern's own swing trigs are not read. fx.h and the Rytm guide now say so. Following the swing trigs could come later, as its own change.
  • SRC + NO no longer brings another kit's values: load_kit() clears undo_type when the kit it reads differs from the knobs (another kit or effect). It is not cleared on every call, because load_kit() runs every UI tick and that would break the undo itself.
  • The rytm-emu check at another speed and a tempo change found a bug, now fixed. After SPEED went from 1x to 2x while playing, the clock's step fell on the new grid but kept counting pulses from PLAY at the new speed (step 97 at master step 49), so a step pattern would have been offset. The count is now taken again from the master step whenever the pattern is read and its speed changes, or an effect starts asking; a pulse begun at the old speed is capped to the new step's last.
  • Checked in rytm-emu 3c4c42c with a traced build (a trace word written at each new step; the trace is not in this PR). SPEED was changed through the pattern's speed byte and the tempo through stock's tempo word, poked during playback. The clock's step is the master step − 1 at every step:
    • from PLAY at 1x and 127 BPM;
    • after 1x → 2x and 1x → 1/2x;
    • after 127 → 90 BPM.
  • Still to come: the rebuild after Improvement: the site builds Rytm sets on Modwerk's base, send-bus only with a send effect #1085, which will include the TRK fix, this one and the KIT menu fix below. The unit check of closing stock's list after a double TRK press, which you asked for, is done (see Tested).

The KIT menu (5 November)

  • The KIT menu over the SEND and SEND FX pages. While a full-screen menu is up (the KIT menu, FUNC + PLAY MODE), stock marks every window under it covered (byte +23) and drawAll skips them. The base drew its page anyway, so the menu showed mixed with the page (seen on the author's unit). The page is now not drawn while its view is covered, and comes back when the menu closes (mw_send_draw in elekloader/base/sendbus.c).
  • Checked in rytm-emu 3c4c42c with this branch's base (built with machine-base.py --out, before and after) and CHORUS 0.1: before, the menu showed mixed with the SEND FX page and with the SEND page; after, it shows on its own from both, NO brings the page back, KIT 1 SAVED! still shows over the page, and the page itself is pixel-identical to before.
  • The same change on the author's own OS line (MD22): his OS UPGRADE screen no longer mixes with the page either (his report; rytm-emu cannot show that screen).

Tested

  • On the unit, 5 November (Steve's Analog Rytm MKII; each result is what he reported): test build TEST-1097-TRK-base-Modwerk.syx (sha256 56af70a9f33aa14938318096cbd8225df4e135a28cd5b2d0498428c05a1cbf05): this branch's base at 598cd345 (0cdf0343, built with machine-base.py --out, not the published package) with CHORUS, FLANGER and PHASER 0.1, on a new empty project, nothing saved.
    • A double press on TRK from the SEND FX page shows stock's list cleanly, and closing the list brings the SEND FX page back cleanly.
    • The same from the SEND page of a sound track.
    • The KIT menu (FUNC + PLAY MODE) opened from SEND FX shows cleanly.
  • On the unit (Steve's Analog Rytm MKII, 30 October), test build MB24: this base with a temporary CPU meter on top (not in this PR), Loop Sync 0.3.2, Retrig Grid 0.2.0, CHORUS, FLANGER, PHASER and twelve original effects.
    • It boots and lists all fifteen effects.
    • Projects keep their settings (storage layout 0x3a9157b2 unchanged).
    • The delays follow the tempo, including with FDBK.
    • On his heavy project nothing lags. The effect's block takes 5.0 to 6.9 % and the whole audio interrupt 86 to 90 %; CHORUS is at 5.5 / 87.
    • SRC + YES was tried on MB11 and works.
    • MISSING left with FUNC + A was seen on MB14.
  • rytm-emu 3c4c42c: this exact base, without the meter, linked with the same fifteen effects, boots and ends on the same screen as MB24 over 8G instructions.
  • The clock: checked against a traced build (each step follows the sequencer's master step, at 1x, with the pattern's swing). Asked renders are identical on the host to the earlier eager clock over 26,800 blocks.
  • Checks: npm run pr:ready is Ready (again on 5 November, after merging main). scripts/build-elemod-isolated.sh and verify-elemod-release-exports.mjs reproduce the 28 committed exports (at bdfe2f5; not rerun for the KIT menu commit, which changes no committed package).

What the guides lacked

The machine guide (sdk/machines/analog-rytm-mkii/README.md) did not say how a send effect follows the sequencer. It now points effect authors to mw_fx_clock() / mw_fx_step() and the sequencing rule. It also gives the 32 KB work area, SRC + YES, and the new budget. It did not say that a full-screen menu marks the windows under it: it now does, and that a page a module draws in ev_draw must not draw while its view is covered.

Changelog: changelog/2026-10-30-rytm-base-fx-clock.md.

🤖 Generated with Claude Code

…RC + YES random, MISSING left with FUNC + A, and a 32 KB work area

- clock.c: mw_fx_clock() and mw_fx_step() read the Rytm's own sequencer (24 PPQN pulses from PLAY, the pattern's
  speed and SWING), worked out only for an effect that asked the block before.
- SEND FX: SRC held + YES sets A-H at random (a FDBK control kept below its runaway), SRC + NO undoes it once.
- A kit whose effect is missing leaves MISSING with FUNC + A (right: the first effect, left: the last).
- MW_FX_WORK 16384 -> 8192 words (32 KB), so fifteen send effects fit beside Loop Sync and Retrig Grid in the
  128 KB mods area; CHORUS, FLANGER and PHASER use 4096 words.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Oct 30, 2026

Copy link
Copy Markdown
Owner

Thanks, this is a clear base change, and I'm fine with the four parts going in together: each one changes the base's identity, so one rebuild beats four.

#1085 goes in first, and this one follows it. Before I merge it:

  1. Once Improvement: the site builds Rytm sets on Modwerk's base, send-bus only with a send effect #1085 is on main, merge main here and rebuild with npm run machine:base -- analog-rytm-mkii --stock … --write: send-bus gets this PR's identity and plain stays e558ad22. Publish the new send-bus package the way Improvement: the site builds Rytm sets on Modwerk's base, send-bus only with a send effect #1085 does (sdk/imports/packages/modwerk-base-analog-rytm-mkii/, vendor/elekloader/catalog/, a dated record in sdk/imports/), replacing 0c92aa45, and update the send-bus budget in machine.json and the send-bus line in elekloader/README.md. The two PRs merge without a textual conflict, but base-binding.json would pair the new identity with the old send-bus variant, and rytm-base.test.ts and test_machine_base.py would fail on main.
  2. Add mw_fx_clock to the exports in sdk/analog-rytm-mkii/core-profile/interface.json, next to the other mw_fx_ ones.
  3. Swing. clock.c swings every odd step, but the Rytm sets swing per step with swing trigs, which Retrig Grid already reads. Either follow the swing trigs or say in fx.h and the Rytm guide that the effects' grid swings every second step. The clock was checked at 1x; please also check another speed and a tempo change while playing in rytm-emu, as docs/module-guides/sequencing.md asks.
  4. SRC + NO after changing to another kit with the same effect puts the first kit's old values into the new one, because undo_type survives a kit change; clearing it in load_kit() fixes that.

I'll check the new identity against my own OS file before merging, as on #1085.


Generated by Claude Code

stigmagit and others added 2 commits October 31, 2026 10:29
…ble press on TRK) is not drawn over

Seen on the author's unit (the SEND FX page drawn over stock's list) and reproduced in rytm-emu on Send FX, which
draws the same way; with TRK no longer kept, a double press shows the list cleanly and a single press keeps the page.

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

repeat98 commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Thanks for the TRK fix. It changes the base's identity like the other four parts, so it's fine here and goes into the same rebuild.

  1. Points 2–4 of my last comment don't depend on Improvement: the site builds Rytm sets on Modwerk's base, send-bus only with a send effect #1085, so they can go in now; only the rebuild in point 1 waits for it. That rebuild also has to take in the TRK fix, which came after the identity now in base-binding.json.
  2. On your unit, please check that closing stock's list after a double press on TRK brings the SEND FX page back cleanly (rytm-emu can't show that), and add the result to the description.

#1085 now waits only on my identity check.


Generated by Claude Code

stigmagit and others added 3 commits November 1, 2026 11:37
…s its undo on a kit change, the effects' swing grid said

- core-profile/interface.json exports mw_fx_clock beside the other mw_fx_ symbols.
- load_kit clears undo_type when the kit it reads differs from the knobs (another kit or effect), so SRC + NO no
  longer puts the first kit's values into the second.
- fx.h and the Rytm guide say that the effects' grid swings every second step by the pattern's SWING, as if each odd
  step had a swing trig; the pattern's own swing trigs are not read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the pattern's speed changes while playing

Found by the rytm-emu check the review asked for: after SPEED went from 1x to 2x while playing, the clock's step
fell on the new grid but kept counting pulses from PLAY at the new speed (step 97 at master step 49). The count is
now taken again from the master step whenever the pattern is read and its speed changes, or an effect starts
asking; a pulse begun at the old speed is capped to the new step's last. Checked in rytm-emu with a traced build
(the trace not committed): from PLAY, then at 2x, 1/2x and after 127 -> 90 BPM, the clock's step is the master
step - 1 at every step.

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

repeat98 commented Nov 2, 2026

Copy link
Copy Markdown
Owner

The red Documents check doesn't come from your branch: docs/DEVELOPER_WORKFLOW.md went over 32 KB on main when two docs changes of mine landed together. Your next merge of main, the one for the rebuild after #1085, clears it, so there's nothing to cut here. Everything else stands as in my last comment.


Generated by Claude Code

stigmagit and others added 2 commits November 5, 2026 11:20
… under a full-screen menu

While a full-screen menu is up (the KIT menu, FUNC + PLAY MODE), stock sets byte +23 of every window under it
and drawAll skips them. mw_send_draw ignored it and drew its page over the whole screen, then the menu's window
again on top (draw_popups), so the menu showed mixed with the page (seen on the author's unit, reproduced in
rytm-emu with this base and CHORUS). The page is now not drawn while its view's byte is set; it comes back when
the menu closes. Notices (KIT 1 SAVED!) set nothing and are still drawn over the page. The Rytm guide says so.

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

Copy link
Copy Markdown
Contributor Author

Two things since your last comment, both in the description:

  1. The unit check you asked for is done (5 November, on a build of this branch's base with CHORUS, FLANGER and PHASER): after a double press on TRK, closing stock's list brings the SEND FX page back cleanly, and the SEND page too.
  2. One more base fix, the KIT menu: while a full-screen menu is up, stock marks the windows under it covered and drawAll skips them; the base drew its page anyway, so the KIT menu (FUNC + PLAY MODE) showed mixed with the page. The page now stays out while its view is covered. Checked in rytm-emu and on the unit. It changes the base's identity like the other parts, so it goes into the same rebuild after Improvement: the site builds Rytm sets on Modwerk's base, send-bus only with a send effect #1085. main is merged and the checks are green.

Generated by Claude Code

repeat98 and others added 5 commits November 5, 2026 13:55
…ts, rebuilt on main after repeat98#1085

npm run machine:base -- analog-rytm-mkii --stock <OS 1.74> --write: plain stays e558ad22 byte for byte; send-bus gets this PR's identity (clock, TRK and KIT menu fixes, 32 KB work area) and replaces 0c92aa45 in sdk/imports/packages and vendor/elekloader/catalog. machine.json and the elekloader README carry the new send-bus budget.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sdk/imports/elekloader-modwerk-base-analog-rytm-mkii-2026-11-05.json replaces the 30 October record: plain e558ad22 stays pinned at 42df786, send-bus 0cdf0343 at this branch's c29f883, so the branch merges with a merge commit.

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

repeat98 commented Nov 5, 2026

Copy link
Copy Markdown
Owner

#1085 is in and live, so I did the rebuild from point 1 here myself, to get this out today:

  • Merged main (with Improvement: the site builds Rytm sets on Modwerk's base, send-bus only with a send effect #1085) and rebuilt from my OS 1.74 file with machine:base --write. Send-bus is now 0cdf0343…, the base your 5 November unit check ran on. Plain stays e558ad22…, byte for byte.
  • The 0cdf0343 package replaces 0c92aa45 in sdk/imports/packages/modwerk-base-analog-rytm-mkii/ and vendor/elekloader/catalog/. Its record is sdk/imports/elekloader-modwerk-base-analog-rytm-mkii-2026-11-05.json, pinned at this branch's c29f8832. The send-bus budget in machine.json and the elekloader README are updated too.

Thanks for the TRK and KIT menu checks on the unit, and for points 2 to 4. I'll merge this with a merge commit once the checks are green.


Generated by Claude Code

@repeat98
repeat98 merged commit d555a22 into repeat98:main Nov 5, 2026
8 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