diff --git a/sdk/digitakt-ii/modules/euclidean-scale/README.md b/sdk/digitakt-ii/modules/euclidean-scale/README.md index 876eba52a9..5bd0169004 100644 --- a/sdk/digitakt-ii/modules/euclidean-scale/README.md +++ b/sdk/digitakt-ii/modules/euclidean-scale/README.md @@ -8,7 +8,7 @@ Euclidean Scale adds a second page to the Digitakt II's Euclidean sequencer. It **SCF** is the Scale Follow switch. Turn A clockwise to enable it or counterclockwise to disable it. It defaults to off. It snaps an eligible pitch to the nearest note in the current scale, preferring the lower note on a tie. Turning it off also clears the track's last reroll. -**RNN** enables Scale Follow and picks a repeating melody from the available in-scale notes. Another press changes the pitches where the scale offers a choice. +**RNN** enables Scale Follow and picks a repeating melody from the available in-scale notes. Another press changes the pitches where the scale offers a choice. A copied pattern, or a kit loaded into another slot, plays the same melody as the original until RNN is pressed in the copy. **LO** and **HI** set the lowest and highest pitches RNN may choose. Turn C for LO and D for HI. Zero is the scale root nearest the track's stock note. Each step is an octave. With a reference of C4, `−1` to `+2` allows scale notes from C3 through C6, inclusive. The controls stop at each other. At the ends of the instrument's note range, the bounds stop at the nearest playable occurrence of the root. @@ -31,7 +31,7 @@ Saving a project saves SCF, the last reroll and both octave bounds per pattern a ## Tests and measurements -Claptom-music reported that the O117 octave-range trial passed on their Digitakt II. See [TESTING.md](TESTING.md) for the O117 results and the earlier K117 checks. +Claptom-music reported that the O117 octave-range trial and the ES1 copy-and-paste trial passed on their Digitakt II. See [TESTING.md](TESTING.md) for those results and the earlier K117 checks. ## Authorship and licences diff --git a/sdk/digitakt-ii/modules/euclidean-scale/TESTING.md b/sdk/digitakt-ii/modules/euclidean-scale/TESTING.md index 950c77508e..db3f4c77c0 100644 --- a/sdk/digitakt-ii/modules/euclidean-scale/TESTING.md +++ b/sdk/digitakt-ii/modules/euclidean-scale/TESTING.md @@ -110,3 +110,48 @@ Two isolated GCC 16.2.0 and binutils 2.47 builds reproduced the base SHA-256 `c4 - The module adds 21,400 bytes of linked ColdFire DDR and zero fast SRAM compared with the pinned base alone. O117 passed the content checksum, HMAC, framing and all 17,125 packet checksums. All non-MAIN OS sections matched stock byte for byte. On 2026-11-08, Claptom-music reported that the O117 hardware trial passed on their Digitakt II. The requested trial covered booting O117, checking that LO and HI at zero restricted RNN to the root, then saving and reloading the bounds and melody with LO at `−1` and HI at `+2`. Physical timing and maximum-track load were outside this trial. + +## Pasted patterns keep their melody, 0.2.1-experimental + +A reroll's melody used the pattern slot as part of its seed, so a pasted pattern played a different melody. Each track state now records the pattern that rolled it (bits 13–20, the pattern plus one); the reroll count keeps bits 0–12 and wraps after 8,191 presses. A state saved before 0.2.1 has no origin: loading it records its own pattern, so its melody is unchanged and a later paste keeps it. The EUS2 layout and its size stay the same. + +The ES1 image (SHA-256 `27cbb0e4cb38a924d105a6466f621901f4c88f9843345150d8a2d0d8dc6a7a14`) links the pinned base `d7ec4d3c` with Euclidean Scale (package `6562edd139a22213b134772d4d9b04bd4c26318756a7718e209e7598a004f6dc`), Chord Arp and Track Names on stock OS 1.17, built with GCC 16.2.0 and binutils 2.47. The linker found no overlaps and verified sections 2, 4, 5, 7 and 8 byte for byte. + +- In digikit `d6de4d0`, the stock Euclidean entry and the Scale page with SCF, RNN, LO `−1` and HI `+2` matched the 0.2.0 captures pixel for pixel. Both captures were retaken on ES1. + +On 2026-11-30, Claptom-music reported that the ES1 hardware trial passed on their Digitakt II: a project saved before 0.2.1 kept its melodies; a pasted pattern played the original's melody; RNN in the copy gave the copy a new melody and left the original unchanged; a fresh RNN melody also survived a paste; both kept their melodies through SAVE PROJECT and a power cycle; and Chord Arp still worked beside it. Physical timing and maximum-track load were outside this trial. + +### Test procedure: euclidean-scale 0.2.1-experimental, 2026-11-30 + +Build: revision `098497f43180`, package `kit.syx` SHA-256 `27cbb0e4cb38a924d105a6466f621901f4c88f9843345150d8a2d0d8dc6a7a14` (the ES1 image the unit ran; a rebuild of this revision in the pinned toolchain reproduced it byte for byte). `npm run test:procedure -- digitakt-ii:euclidean-scale --no-unit --no-emulator --package kit.syx`, 8 s. Emulator results are not hardware evidence; only what ran on the unit is. + +| # | Step | Layer | Result | Command | Evidence | +|---|---|---|---|---|---| +| 1 | Software checks | host | passed | `npm run module:doctor -- euclidean-scale` | its log | +| 2 | Beside every other module | contract | not run: modules:compat compares the Octatrack's modules only; the image was linked beside Chord Arp and Track Names instead, with no overlap | | | +| 3 | Name the build | host | passed | | revision and SHA-256 above | +| 4 | DSP cost model | contract | not run: the DSP cycle scan models the Octatrack's DSP only | | | +| 5 | Emulator rehearsal | emulator | not run: Digitakt II has no scripted emulator rehearsal yet | | | +| 6 | Read the unit | unit | not run: Digitakt II has no USB link the procedure drives yet (docs/MACHINE_RECIPE.md#where-each-machine-stands) | | | +| 7 | Scripted unit pass | unit | not run: no USB link yet | | | +| 8 | Soak | unit | not run: no soak for Digitakt II yet | | | +| 9 | Cost on the unit | unit | not run: no price on the unit for Digitakt II yet; the change adds no memory and no work outside a reroll | | | +| 10 | Put back | unit | not run: no USB link yet | | | +| 11 | Agent by hand | emulator | the agent has no link to the unit; in digikit `d6de4d0` both screens were reached by the README's steps and captured on this image (emulator, not hardware evidence) | | `media/capture.json` | +| 12 | Submitter's own stage | unit | passed, as Claptom-music reported (above) | | their words | + +#### Edge cases for this change + +| Case | Why this change makes it a risk | How run | Result | +|---|---|---|---| +| A project saved before 0.2.1 | its states have no origin; their melodies must not move | Claptom-music opened a project rerolled on 0.2.0 | kept its melodies, as reported | +| Pattern copy and paste into an empty slot | the change itself: the copy must play the original's melody | Claptom-music pasted a rerolled pattern | same melody, as reported | +| RNN in the pasted copy | the copy must get its own melody and leave the original alone | Claptom-music pressed B in the copy | new melody in the copy, original unchanged, as reported | +| A melody rolled on 0.2.1, then pasted | the origin recorded at the press must travel with the kit data | Claptom-music | same melody, as reported | +| SAVE PROJECT and a power cycle | the origin is saved in the EUS2 state words | Claptom-music | both melodies came back, as reported | +| Beside Chord Arp and Track Names | kit data and the project archive share a kit record | linked in ES1; Claptom-music used Chord Arp | worked, as reported | +| KIT LOAD from the +Drive into another slot | the origin travels with the kit, so the loaded kit keeps its melody | not run | not tested | +| A reroll count past 8,191 | the count now wraps there; a 0.2.0 state past it would read an origin | not run: 8,192 presses of one track | not tested | + +Not tested on a unit by the agent: Digitakt II has no USB link the procedure drives yet. Claptom-music's ES1 trial is the hardware evidence. +Edge cases: the table above; the +Drive kit load and the reroll wrap were not run. diff --git a/sdk/digitakt-ii/modules/euclidean-scale/media/capture.json b/sdk/digitakt-ii/modules/euclidean-scale/media/capture.json index 0476335ae4..84eb5dceb0 100644 --- a/sdk/digitakt-ii/modules/euclidean-scale/media/capture.json +++ b/sdk/digitakt-ii/modules/euclidean-scale/media/capture.json @@ -2,19 +2,19 @@ "schemaVersion": 1, "machine": "digitakt-ii", "moduleId": "euclidean-scale", - "moduleVersion": "0.2.0-experimental", + "moduleVersion": "0.2.1-experimental", "firmware": "1.17", - "imageSha256": "cd26330c181016d9ef8caf5c3162d457b0c2f974de692aae6109f06bbf3bb7ae", + "imageSha256": "27cbb0e4cb38a924d105a6466f621901f4c88f9843345150d8a2d0d8dc6a7a14", "captures": [ { "path": "media/euclidean-entry.png", "plan": "Boot to the parameter view, dismiss popups, then press FUNC + AMP once to reach stock Euclidean.", - "sha256": "4cbdd6c21e94f38117eb43ec30ce8a5e8cb405927dbdd7696d00528adcccbeb3" + "sha256": "f7417df7133d5e2572f9db476066776209cc58232d804ad5d3ca429f51d7e9f3" }, { "path": "media/scf-rnn.png", - "plan": "Press FUNC + AMP again to open the Scale page. Turn C one detent left and D two detents right, then press B.", - "sha256": "0b3cbcd713865e26a42ab77f5d58922cd9d7ae6f2e8aeb34e6e45417d1651bbc" + "plan": "Press FUNC + AMP again to open the Scale page. Turn C one detent left and D two detents right, then press B. Press NO, press FLTR, then press FUNC + AMP twice to reopen the Scale page.", + "sha256": "3f1a71b319b9bf997daea7ac89d19ecf579f981533b773798b6325cad5e45764" } ] } diff --git a/sdk/digitakt-ii/modules/euclidean-scale/media/euclidean-entry.png b/sdk/digitakt-ii/modules/euclidean-scale/media/euclidean-entry.png index 03734a9b4a..08611ca47f 100644 Binary files a/sdk/digitakt-ii/modules/euclidean-scale/media/euclidean-entry.png and b/sdk/digitakt-ii/modules/euclidean-scale/media/euclidean-entry.png differ diff --git a/sdk/digitakt-ii/modules/euclidean-scale/media/scf-rnn.png b/sdk/digitakt-ii/modules/euclidean-scale/media/scf-rnn.png index a82d66ba81..414ad0e2d3 100644 Binary files a/sdk/digitakt-ii/modules/euclidean-scale/media/scf-rnn.png and b/sdk/digitakt-ii/modules/euclidean-scale/media/scf-rnn.png differ diff --git a/sdk/digitakt-ii/modules/euclidean-scale/modwerk.module.json b/sdk/digitakt-ii/modules/euclidean-scale/modwerk.module.json index 2430ea68bd..877f69293b 100644 --- a/sdk/digitakt-ii/modules/euclidean-scale/modwerk.module.json +++ b/sdk/digitakt-ii/modules/euclidean-scale/modwerk.module.json @@ -2,7 +2,7 @@ "schemaVersion": 3, "id": "euclidean-scale", "name": "Euclidean Scale", - "version": "0.2.0-experimental", + "version": "0.2.1-experimental", "machine": "digitakt-ii", "category": "system", "exclusive": false, @@ -112,25 +112,25 @@ }, "evidence": { "tier": "author-hardware", - "moduleVersion": "0.2.0-experimental", - "sourceSha256": "48245150d089c9f178e34874becb0473e2cd71c9f6359efcefd50d7c6ce6641a", + "moduleVersion": "0.2.1-experimental", + "sourceSha256": "6562edd139a22213b134772d4d9b04bd4c26318756a7718e209e7598a004f6dc", "reports": [ "TESTING.md" ], "hardware": { "model": "Elektron Digitakt II", "release": "1.17", - "testedOn": "2026-11-08", + "testedOn": "2026-11-30", "tester": "Claptom-music", "durationMinutes": null, - "summary": "Author reported the O117 hardware trial passed. The requested trial covered boot, a root-only reroll at LO and HI zero, and save and reload with LO minus one and HI plus two.", + "summary": "Author reported that the ES1 hardware trial passed: a pre-0.2.1 project kept its melodies, a pasted pattern played the original's melody, RNN in the copy gave it its own melody, both survived SAVE PROJECT and a power cycle, and Chord Arp still worked beside it.", "limitations": ["Functional trial. Physical timing and maximum-track load were outside the test."] }, "verifiedBy": null }, "tests": { "report": "TESTING.md", - "summary": "Repeat pinned builds, 44,392 ColdFire pitch checks, Digikit save and reload, and the author's O117 hardware trial.", + "summary": "Repeat pinned builds, 44,392 ColdFire pitch checks, Digikit save and reload, the author's O117 hardware trial and the 0.2.1 ES1 copy-and-paste trial.", "documentation": { "tutorial": { "title": "Usage", @@ -169,12 +169,12 @@ "alt": "Stock Euclidean controls and the first of two page dots", "credit": "Claptom-music", "license": "GPL-3.0-or-later", - "source": "Pinned O117 panel output captured in digikit d6de4d0. Stock UI elements belong to Elektron.", + "source": "Pinned ES1 panel output captured in digikit d6de4d0. Stock UI elements belong to Elektron.", "capture": { "type": "emulator", "release": "1.17", - "moduleVersion": "0.2.0-experimental", - "imageSha256": "cd26330c181016d9ef8caf5c3162d457b0c2f974de692aae6109f06bbf3bb7ae", + "moduleVersion": "0.2.1-experimental", + "imageSha256": "27cbb0e4cb38a924d105a6466f621901f4c88f9843345150d8a2d0d8dc6a7a14", "setup": "Boot to the parameter view, dismiss popups, then press FUNC + AMP once to reach stock Euclidean." } }, @@ -185,13 +185,13 @@ "alt": "Second page with SCF, RNN, LO set to minus one, HI set to plus two, and four disabled slots", "credit": "Claptom-music", "license": "GPL-3.0-or-later", - "source": "Pinned O117 panel output captured in digikit d6de4d0. Stock UI elements belong to Elektron.", + "source": "Pinned ES1 panel output captured in digikit d6de4d0. Stock UI elements belong to Elektron.", "capture": { "type": "emulator", "release": "1.17", - "moduleVersion": "0.2.0-experimental", - "imageSha256": "cd26330c181016d9ef8caf5c3162d457b0c2f974de692aae6109f06bbf3bb7ae", - "setup": "Press FUNC + AMP again to open the Scale page. Turn C one detent left and D two detents right, then press B." + "moduleVersion": "0.2.1-experimental", + "imageSha256": "27cbb0e4cb38a924d105a6466f621901f4c88f9843345150d8a2d0d8dc6a7a14", + "setup": "Press FUNC + AMP again to open the Scale page. Turn C one detent left and D two detents right, then press B. Press NO, press FLTR, then press FUNC + AMP twice to reopen the Scale page." } } ] diff --git a/sdk/digitakt-ii/modules/euclidean-scale/src/main.c b/sdk/digitakt-ii/modules/euclidean-scale/src/main.c index f571c4122b..297ec0f7c0 100644 --- a/sdk/digitakt-ii/modules/euclidean-scale/src/main.c +++ b/sdk/digitakt-ii/modules/euclidean-scale/src/main.c @@ -134,7 +134,9 @@ int euclidean_key(void *brain, const uint32_t *event) } else if (key == KEY_ENCODER_B && press == KEY_PRESS) { const uint32_t state = euclidean_track_state(edited); const uint32_t generation = (state & EUC_GENERATION) + 1u; - euclidean_set_track_state(edited, (state & EUC_RANGE) | EUC_ENABLED + /* The new melody is this pattern's own, even in a pasted copy. */ + const uint32_t origin = (uint32_t)(edited - euclidean_state) / EUC_TRACKS + 1u; + euclidean_set_track_state(edited, (state & EUC_RANGE) | EUC_ENABLED | origin << EUC_ORIGIN_SHIFT | (generation <= EUC_GENERATION ? generation : 1u)); } else if ((key == KEY_ENCODER_C || key == KEY_ENCODER_D) && press == KEY_PRESS) { euclidean_set_track_state(edited, euclidean_track_state(edited) & ~EUC_RANGE); diff --git a/sdk/digitakt-ii/modules/euclidean-scale/src/pitch.c b/sdk/digitakt-ii/modules/euclidean-scale/src/pitch.c index 342959ed92..c9aa9a426b 100644 --- a/sdk/digitakt-ii/modules/euclidean-scale/src/pitch.c +++ b/sdk/digitakt-ii/modules/euclidean-scale/src/pitch.c @@ -34,7 +34,12 @@ static void kit_loaded(int kit, int found) (void)found; const unsigned int first = (unsigned int)kit * EUC_TRACKS; for (unsigned int i = first; i < first + EUC_TRACKS; ++i) { - const uint32_t state = saved_state[i]; + uint32_t state = saved_state[i]; + /* A melody saved before 0.2.1 was rolled here: record that, so a paste keeps it. */ + if ((state & EUC_GENERATION) && !(state & EUC_ORIGIN)) { + state |= (uint32_t)(kit + 1) << EUC_ORIGIN_SHIFT; + saved_state[i] = state; + } const int low = euclidean_octave_bound(state, 0); const int high = euclidean_octave_bound(state, 1); euclidean_state[i] = low < EUC_MIN_OCTAVE || high > EUC_MAX_OCTAVE || low > high @@ -97,13 +102,15 @@ static uint32_t mix(uint32_t value) return value ^ (value >> 16); } -static uint32_t reroll_random(const struct dt2_seq_note_context *note, uint32_t generation) +static uint32_t reroll_random(const struct dt2_seq_note_context *note, uint32_t generation, + uint32_t melody_pattern) { - const uint32_t key = ((uint32_t)note->pattern << 12) | ((uint32_t)note->track << 8) | note->step; + const uint32_t key = ((uint32_t)melody_pattern << 12) | ((uint32_t)note->track << 8) | note->step; return mix(key ^ (generation * UINT32_C(0x9e3779b9))); } -static int32_t rerolled(const struct dt2_seq_note_context *note, unsigned int pitch, uint32_t generation) +static int32_t rerolled(const struct dt2_seq_note_context *note, unsigned int pitch, uint32_t generation, + uint32_t melody_pattern) { const unsigned int low = pitch >= 6 ? pitch - 6 : 0; const unsigned int high = pitch <= 121 ? pitch + 6 : 127; @@ -125,7 +132,7 @@ static int32_t rerolled(const struct dt2_seq_note_context *note, unsigned int pi /* Alternate index parity so successive rerolls differ wherever there is a choice. */ const unsigned int parity = (nearest_index + generation) & 1u; const unsigned int alternatives = (count + 1u - parity) / 2u; - return choices[parity + 2u * (reroll_random(note, generation) % alternatives)]; + return choices[parity + 2u * (reroll_random(note, generation, melody_pattern) % alternatives)]; } static unsigned int root_octave(const struct dt2_seq_note_context *note, unsigned int pitch) @@ -145,7 +152,7 @@ static int bounded_octave(int octave, int last) } static int32_t ranged_reroll(const struct dt2_seq_note_context *note, unsigned int pitch, - uint32_t generation, int low, int high) + uint32_t generation, uint32_t melody_pattern, int low, int high) { const int anchor = (int)root_octave(note, pitch); const int last = (127 - note->root) / 12; @@ -168,7 +175,7 @@ static int32_t ranged_reroll(const struct dt2_seq_note_context *note, unsigned i } const unsigned int parity = count > 1 ? generation & 1u : 0; const unsigned int alternatives = (count + 1u - parity) / 2u; - const unsigned int index = parity + 2u * (reroll_random(note, generation) % alternatives); + const unsigned int index = parity + 2u * (reroll_random(note, generation, melody_pattern) % alternatives); return (int32_t)(first_pitch + 12u * (index / scale_size) + degrees[index % scale_size]); } @@ -184,10 +191,12 @@ int32_t euclidean_pitch(const struct dt2_seq_note_context *note, uint32_t pitch) } const uint32_t generation = state & EUC_GENERATION; + const uint32_t origin = (state & EUC_ORIGIN) >> EUC_ORIGIN_SHIFT; + const uint32_t melody_pattern = origin ? origin - 1u : note->pattern; if (generation && (state & EUC_RANGE)) { - return ranged_reroll(note, pitch, generation, euclidean_octave_bound(state, 0), + return ranged_reroll(note, pitch, generation, melody_pattern, euclidean_octave_bound(state, 0), euclidean_octave_bound(state, 1)); } const unsigned int quantized = nearest(note, pitch); - return generation ? rerolled(note, quantized, generation) : (int32_t)quantized; + return generation ? rerolled(note, quantized, generation, melody_pattern) : (int32_t)quantized; } diff --git a/sdk/digitakt-ii/modules/euclidean-scale/src/pitch.h b/sdk/digitakt-ii/modules/euclidean-scale/src/pitch.h index 97394a03ad..0d3af46d93 100644 --- a/sdk/digitakt-ii/modules/euclidean-scale/src/pitch.h +++ b/sdk/digitakt-ii/modules/euclidean-scale/src/pitch.h @@ -8,7 +8,11 @@ #define EUC_TRACKS 16u #define EUC_TRACK_SLOTS (EUC_PATTERNS * EUC_TRACKS) #define EUC_ENABLED UINT32_C(0x80000000) -#define EUC_GENERATION UINT32_C(0x001fffff) +#define EUC_GENERATION UINT32_C(0x00001fff) +/* The pattern that rolled the melody, plus one. A pasted pattern carries it, so the + * copy plays the same melody. 0 (saves before 0.2.1) means the pattern it sits in. */ +#define EUC_ORIGIN UINT32_C(0x001fe000) +#define EUC_ORIGIN_SHIFT 13 #define EUC_RANGE UINT32_C(0x7fe00000) #define EUC_MIN_OCTAVE (-10) #define EUC_MAX_OCTAVE 10 diff --git a/src/community/module-changelogs/digitakt-ii-euclidean-scale.json b/src/community/module-changelogs/digitakt-ii-euclidean-scale.json index 06aab2a98b..d60015113b 100644 --- a/src/community/module-changelogs/digitakt-ii-euclidean-scale.json +++ b/src/community/module-changelogs/digitakt-ii-euclidean-scale.json @@ -1,4 +1,12 @@ [ + { + "version": "0.2.1-experimental", + "date": "2026-11-29", + "changes": [ + "A pasted pattern now plays the same rerolled melody as the one it was copied from.", + "Melodies in projects you already saved stay as they were." + ] + }, { "version": "0.2.0-experimental", "date": "2026-11-17",