Skip to content

Analog Rytm MKII: Improved Envelopes 0.1.0-experimental - #1291

Draft
npp1993 wants to merge 14 commits into
repeat98:mainfrom
npp1993:claude/rytm-improved-envelopes
Draft

npp1993 wants to merge 14 commits into
repeat98:mainfrom
npp1993:claude/rytm-improved-envelopes

Conversation

@npp1993

@npp1993 npp1993 commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Update (7 Nov), after review: ENV RESET AMP and its pre-fade have left this module. Env Reset Amp is in the library on its own (#1297), and the two install side by side. Draft until the package has had a short run on the author's unit.

What it does

Analog Rytm MKII, OS 1.74. Improved Envelopes 0.1.0-experimental (new module, id envelopes, category machines):

  • AMP HLD runs from no hold (0) to AUTO (127). The decay never starts before the attack peaks. FUNC + turn on HLD steps 0, 124.7 ms and AUTO.
  • Fine short times. ATK, AMP DEC and FILTER DEC/REL step 0.2 ms up to 5 ms, then 0.5 ms to 15 ms and coarser up to 300 ms, then about 14 % a step. AMP HLD steps 0.67 ms, one block, the OS's smallest hold step.
  • Every envelope knob shows its time: an attack's full ramp, a hold's length, or a decay's or release's time to -60 dB.
  • Saved projects: stored HLD, ATK, DEC and REL bytes play on the new curves. Nothing is written or migrated, so removing the module plays them as before. The README lists this under "Changes to stock flows".

It patches the amp record write (0x40109c24) and the AMP page's envelope picture call, and points stock's envelope table reads at its own tables (ptr sites). It subscribes to ev_tick, claims its UI and audio sites, and declares no conflicts. It costs 5,228 bytes of the shared mod area (plain base ba530f45: ramSpare 119,004 alone, 113,776 with this module).

Review points

  1. ENV RESET out: the two byte sites (0x400bcf8a, 0x400ef8d6), pre-fade.c, the ENV RESET claim, and its lines in the README, manifest, TESTING.md and release notes are gone. The amp writer keeps only its idle skip.
    • HOLD beside Env Reset Amp: no shared bytes. With AMP in a track's ENV RESET, Env Reset Amp (0x40109b70) replaces the trig's attack record with a drop to silence, so Envelopes doesn't see that record. Stock then picks the state (0x40109b5a: HLD byte 0 gives the gate, any other value timed) with the hold counter cleared. From the next block Envelopes applies its HOLD rule and ATK curve on the continued attack. Its level follower takes the drop as an instant fall to -128. So the hold counts from the trig and the decay never starts before the top. This was read in OS 1.74's code (upstream/README.md), so no conflicts entry. EN03 (base + both modules) links; the unit run will check it.
    • The pre-fade needs the amp record write that Envelopes takes. If it goes into Env Reset Amp 1.1, a core hook at 0x40109c24 comes first, in its own PR.
  2. Saved projects: no per-sound switch. The reasons are in a separate comment.
  3. upstream/README.md (origin, sites, the Env Reset Amp interaction) and media/thumbnail.svg are Envelopes' own now. TESTING.md says "the author" and drops the empty EV04 heading. resources.memoryBytes: 5,228 (the module is smaller without the pre-fade).
  4. The package is rebuilt and re-pinned at 2c53a220. The short unit run is pending.

Evidence

  • On the author's MKII over USB (combined sets of up to 16 modules, builds EV04 to ED02, TESTING.md):
    • AMP DEC is within 0.7 % of its text from 5 ms.
    • AMP HLD is within 0.1 ms, 0.67 ms to 15.5 s.
    • FILTER ATK is within 0.3 %.
    • FILTER DEC and REL read 1.5 % slow, which is the method's bias.
    • The text "1972ms" fits the screen.
  • Package: source-only envelopes-0.1.0-experimental-os1.74.elemod (3c5016ae…), built from ed0cac20 in the pinned toolchain (build-elemod-isolated.sh). --check reproduces it, and verify-elemod-release-exports.mjs reproduces all 49 current exports. Pinned in sdk/imports/elekloader-envelopes-2026-11-07.json (commit 2c53a220) and vendored; record in docs/verification/2026-11-07-rytm-improved-envelopes.md.
  • Screens: rytm-emu captures of EN02 (base + this package alone), pixel-identical to the earlier EN01, recorded in media/capture.json.
  • Not run yet: this package on a unit (EN02 alone, EN03 beside Env Reset Amp); saving and reloading; FILTER DEC/REL under 15 ms.
  • Review: independent code reviews of the table change, the text change and the ENV RESET removal found no bugs.

Checklist

  • This is my own module. Env Reset Amp, which it started from, stays Iced-Cream's and is untouched.
  • I read the guide for its category, and TESTING.md lists what I did not test.
  • Source and media are mine or properly licensed, with authors and full licence texts kept. Nothing comes from Elektron firmware.
  • Screenshots are real captures of the current module UI. Hardware results are what a named person saw on a named build; emulator results are labelled as such.

What the guides lacked or got wrong:

  • build-elemod-isolated.sh fails when its output folder is under /private/tmp (Docker Desktop cannot mount it), and a local sdk:check needs dsp_asm on PATH. The tools now say so (Fix: local build tools explain a missing dsp_asm and a /private/tmp output #1292, merged).
  • package-elemod-recipe.mjs won't overwrite an existing package (EEXIST). To rebuild an unreleased version, delete the file first.
  • elekloader:update --overlay can answer 404 for a few minutes after a push, even with the PR open, while GitHub's raw CDN catches up. Retry.

Validation: npm run pr:ready: Ready (with dsp_asm on PATH).

🤖 Generated with Claude Code

npp1993 and others added 6 commits November 6, 2026 23:04
The AMP envelope reworked, with times on every envelope knob: AMP HLD from
no hold to AUTO without cutting the attack, fine ATK, DEC, REL and HLD steps
at short times (0.2 ms to 5 ms), FUNC jumps on HLD, and ENV RESET AMP
(Iced-Cream's Env Reset Amp, from MrScruff's rytm-mods) with a pre-fade.
Unit-tested on an MKII over USB (TESTING.md).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Compiled from a0aaa13 in the pinned toolchain (build-elemod-isolated,
image 39efd52a), exported with package-elemod-recipe.mjs; --check
reproduces it.

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

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

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

Copy link
Copy Markdown
Contributor

It's not really my work so it doesn't feel fair to object. That said, I did already submit ENV RESET AMP two weeks ago as a modwerk module in PR #934.

@repeat98

repeat98 commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Thanks @npp1993, this is careful work, and the measurements in TESTING.md are great to have.

@Iced-Cream, thank you for such a fair answer. #934 went into _submissions/ to wait until the browser could build for the Rytm, and nobody moved it into the library after that. That's on us, not on you. I'd like Env Reset Amp to enter the library as its own module, under your name. All it needs is a move into modules/env-reset-amp/ with its source-only package and release notes, because the captures and tutorial are already there. You can do the move yourself, or say yes and one of us will do it for you.

@npp1993, could you change these in one go:

  1. Take ENV RESET out of Envelopes: the two byte sites at 0x400bcf8a and 0x400ef8d6, the pre-fade, the ENV RESET claim, and its lines in the docs and release notes. Then the two modules install side by side and each one does one job. Please also check that Envelopes keeps its HOLD rule when Env Reset Amp changes the trig's attack record, since envelopes.c keys on 0x4000007f (line 276). If it can't, name env-reset-amp in compatibility.conflicts once that module is in the library. The pre-fade is a real improvement. If Iced-Cream wants it in Env Reset Amp 1.1, it needs the amp record write that Envelopes takes, so a core hook at 0x40109c24 has to come first, in its own pull request.
  2. Saved projects: with Envelopes installed, every saved HLD, ATK, DEC and REL byte plays on the new curves. A stock DEC 23 (300 ms) becomes about 4.6 ms, and HLD 0 goes from AUTO to no hold. The only way back is to remove the module. A change that alters saved work with no way to opt out needs more than a README entry. Could the new curves be a per-sound setting, saved with the sound and off by default, so existing projects play as they did? If that can't work, tell me why and we'll decide together.
  3. Small things: upstream/README.md and media/thumbnail.svg are Env Reset Amp's files unchanged, so please give Envelopes its own. In TESTING.md, write "the author" where it says "Flashed by the owner", because here that reads as me, and drop the empty ## Unit, EV04 heading. resources.memoryBytes can say 5,900.
  4. Then rebuild and re-pin the package, and do one short run of that package on your unit.

Please keep it a draft until then. When it's ready I'll merge with a merge commit, because the import record pins a commit on this branch.


Generated by Claude Code

…mproved-envelopes

# Conflicts:
#	sdk/analog-rytm-mkii/modules/README.md
#	src/devices/library-parity.test.ts
@Iced-Cream

Copy link
Copy Markdown
Contributor

@repeat98 Happy for you to do the move. I think some other modules I submitted may have been left there in the same way

@repeat98

repeat98 commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Thank you, @Iced-Cream! I'll move Env Reset Amp into the library under your name, in its own pull request, and link it here.

You're right about the others. Ctrl All, Main RMS and Slice Loop are waiting in _submissions/ the same way, and they already have their captures and tutorials, so I'll move each of them too, one pull request per module. Euclid Accents and Velocity Humanise open pages of their own, and the Rytm core has refused those since 0.4. They need their 0.4-style versions, which add entries to the core's pages instead, before they can go in. If you'd like to bring those over, a pull request with them in modules/<id>/ is welcome. Otherwise they stay where they are for now.


Generated by Claude Code

@repeat98

repeat98 commented Nov 7, 2026

Copy link
Copy Markdown
Owner

Env Reset Amp is in the library now (#1297): https://modwerk.app/analog-rytm-mkii/module/env-reset-amp/

@npp1993, that means env-reset-amp can be named in compatibility.conflicts now, if Envelopes can't keep its HOLD rule beside it (point 1 above).


Generated by Claude Code

@repeat98

repeat98 commented Nov 7, 2026

Copy link
Copy Markdown
Owner

@Iced-Cream, Ctrl All (#1298), Main RMS (#1299) and Slice Loop (#1300) are in the library now too, under your name:

Thanks for your patience with them. Each one's TESTING.md says these exact packages haven't run on a unit with the current core yet, so if you try one on your Rytm, a line about how it went is very welcome.


Generated by Claude Code

npp1993 and others added 7 commits November 7, 2026 09:45
…ote and thumbnail

ENV RESET AMP and its pre-fade go back to Env Reset Amp, now in the
library on its own: the two byte sites at 0x400bcf8a and 0x400ef8d6,
pre-fade.c, the ENV RESET claim and its docs and release-note lines.
The writer keeps only the idle skip (envelopes_gate moves to
envelopes.c, still-mask at [0]). Beside Env Reset Amp the HOLD rule
holds from the next block's attack record (stock's state 0 at
0x40109b5a, read in OS 1.74; upstream/README.md), so no conflict.
upstream/README.md and media/thumbnail.svg are Envelopes' own; TESTING
says the author where it said the owner, and drops the empty EV04 head.

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

# Conflicts:
#	sdk/analog-rytm-mkii/modules/README.md
#	src/devices/library-parity.test.ts
Built by build-elemod-isolated.sh in modwerk-source-tools (39efd52a)
from ed0cac2; package-elemod-recipe.mjs --check reproduces it and
verify-elemod-release-exports.mjs reproduces all 49 exports. Linked on
the plain base ba530f45: ramSpare 113,776 alone (EN02) and beside
Env Reset Amp 1.0.0 (EN03).

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

The rytm-emu captures retaken on EN02 (plain base + this package) are
pixel-identical to EN01's. Verification record updated.

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

# Conflicts:
#	sdk/analog-rytm-mkii/modules/README.md
#	src/devices/library-parity.test.ts
…mproved-envelopes

# Conflicts:
#	sdk/analog-rytm-mkii/modules/README.md
#	src/devices/library-parity.test.ts
…mproved-envelopes

# Conflicts:
#	src/devices/library-parity.test.ts

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.

3 participants