Skip to content

Fix: Digitakt II linked voices: VOICES row label and icon, voices keep the lead's sound and machine - #2204

Open
Claptom-music wants to merge 3 commits into
repeat98:base/digitakt-ii-nextfrom
Claptom-music:base/dt2-voices-fixes
Open

Claptom-music wants to merge 3 commits into
repeat98:base/digitakt-ii-nextfrom
Claptom-music:base/dt2-voices-fixes

Conversation

@Claptom-music

@Claptom-music Claptom-music commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What was wrong or hard

The release checks of base 948be0c4 (image 27dfadf8, in #1999) found two linked-voices bugs and asked for an icon on the VOICES row:

  • SETTINGS > VOICES read T9 VOICES on every track. SETTINGS builds its rows once, so the label kept the track that was on then.
  • Lowering VOICES while playing, the first note after the change sounded wrong (a plain kick on a Morpha lead). Two causes: a former voice's fading note was handed to its own machine's player (SAMPLE played the lead's sample slot), and its note-off, which still names the lead, went to the lead.

A first fix (f702c908, test image e0244b16) cleared each leaving voice's loaded-sound pointer. On the unit that caused a new bug, the synth randomly playing unedited: after VOICES 3, 1, 3 a key note on a voice loaded the voice's own sound with the lead's machine. The emulator reproduced it, and this PR fixes it at the root.

What this changes

sdk/machines/digitakt-ii/elekloader/modwerk/voices.c, voices-entry.s (base only, no module):

  • The VOICES row is core's value row (core_addrow) with its own draw: a 9x9 icon in the stock icons' place, the count right-aligned at x + 19 as before, and a label rewritten each time the menu asks for it (core_voice_row_label, then core's core_value_label).
  • A note-on moved to a voice track that names no sound (keys, MIDI) now names the lead's kit sound (+0x3c), so stock loads the lead's sound there whenever the voice last loaded another, never the voice's own.
  • A track that leaves a group stays its lead's former voice until it plays a note of its own. It keeps the lead's machine (core_voice_lead), takes note-offs naming the lead for a note it still holds, and its own note-on clears its pointer at 0x8000470c, so that note loads its own sound.
  • lead_of starts as none (it read as "track 1's voice" before the first project load).

Base 2ead25d6 (.run 16,732, .bss 12,652, 47 sites). base-binding.json still names 948be0c4: the binding, package and pin are a release step for the owner, as for #2138.

Records: VOICES.md (design, the release checks, both fix rounds), docs/verification/2026-11-24-digitakt-ii-linked-voices-base.md (the release-check table for 948be0c4), changelog/2026-11-25-digitakt-ii-voices-fixes.md.

How I checked it

On a unit: Claptom-music tested image b6ee842b (this base 2ead25d6 + the Morpha package of 27dfadf8) on a Digitakt II, OS 1.17, over USB. Covered: the icon and label on several tracks, the kick when lowering VOICES while playing, edits kept after VOICES 3, 1, 3, a held chord when VOICES drops, and a former voice played on its own. They reported it ready for review, with no case failing. The first round (e0244b16) is recorded in VOICES.md.

Emulator (ColdFire panel probe and coupled ColdFire and sound-chip runs, same Morpha package):

Case Why this change makes it a risk How run Result
Every track at 1 The note entry and frame run for every note Coupled, same script on 27dfadf8 and b6ee842b First note identical sample for sample; the level identical in every 50 ms window. The second key lands a few ms apart, so the mix after it is not compared sample for sample
Label on tracks 1, 5, 16, 5, 1, 9, 6 Label rewritten from the active track Panel probe Follows the track; T5 keeps its count 3
Icon placement Own draw in a stock menu Panel probe, pixels x 42-50, rows 53-61 like the stock icons; the count's digit from x 58
VOICES 3, 1, 3, then a chord Which sound a voice loads Panel probe, targets and 0x8000470c e0244b16: track 2 loaded its own sound. This base: the lead's values and pointer
Chord held while VOICES drops to 1 Note-offs of former voices Panel probe 0x47db4310; coupled with Morpha 27dfadf8: tracks 2 and 3 stay held, the voice stops abruptly. This base: all notes end; both fade with the lead's release
A former voice played on its own Its own sound comes back Panel probe It loads its own sound
Kick pattern while VOICES drops The reported case Unit Reported fixed. Not replayable in the emulator, whose sequencer stops after step 1
Muted lead from the keys, MIDI chords, two machine modules Open from the release checks Not run here Open, as recorded in VOICES.md

sdk/tests/test_machine_base.py passes (25). npm run check -- --base upstream/base/digitakt-ii-next: everything passed here except one test, scripts/module-doctor.test.mjs > "a fresh module:new draft of each kind": on this computer the checkout sits on a Windows drive under WSL, where module-doctor --draft takes 41 s against the test's 30 s limit, so it is cut off with no output. No module is changed here; CI reruns it.

What the guides lacked: the stock "load a sound only when it changed" rule (0x8000470c) and that fw_fillrect counts a menu row's lines upward were undocumented. Both are now in VOICES.md.

The release-check results for #1999's test table are in docs/verification/2026-11-24-digitakt-ii-linked-voices-base.md.

… track that leaves a group

- SETTINGS > VOICES: the label is rewritten each time the menu asks for it (SETTINGS builds its rows once, so it kept
  the track that was on then), and the row draws an icon in the stock icons' place with the count beside it.
- Lowering VOICES while notes ring: a former voice's note-off, which still names the lead, goes to the track that
  holds the note (it ended the lead's note of the same pitch instead, and the voice's note rang on), with the lead's
  machine until the note ends; the track's loaded-sound pointer is cleared so its next note loads its own sound.
- VOICES.md and the 948be0c4 verification record: the release checks on 27dfadf8 and the emulator checks of this base.
…ices keep its machine until their own note; icon eyes
@repeat98

Copy link
Copy Markdown
Owner

Thanks, that's a good root-cause fix. Naming the lead's sound in the note-on (+0x3c) instead of clearing pointers explains the "synth plays unedited" report, and the former-voice routing covers the kick on the first hit. It's on the right branch, and the unit run of b6ee842b covers the cases that were reported.

Before it goes into base/digitakt-ii-next:

  1. Routing while regroup runs. Its comment says nothing is routed while the groups change, but with formers set core_voice_event now carries on while leads is 0 and lead_of is half rebuilt. A lead's note in that window reaches the lead_of[lead] != NONE branch and goes to track 16, so it is dropped. That's a short window, but the sequencer runs during it while someone turns VOICES. Please make core_voice_event return while regroup runs, for example with a flag set at its start and cleared after leads = found.
  2. The full SHA-256 of what was tested. VOICES.md names base 2ead25d6 and image b6ee842b only by their short form. Please give both in full, the way base-binding.json gives 948be0c4's identity.
  3. Unit cases this diff touches that the run didn't cover. The new note-on path is there because stock forgets the loaded sound after a kit change or a sound lock, and it handles MIDI notes too. Please add from your unit, on this image:
    • a kit load (or reload) while linked, then a chord from the keys;
    • a sound lock on a lead's trig, then a chord from the keys;
    • MIDI chords (still open from 27dfadf8; the recording you mentioned would settle it);
    • Load Project into a project with different VOICES settings. regroup takes the former voices from the previous project's groups (was[]), so check that those tracks play their own sound on their first note.
  4. Improvement: Digitakt II base: chords recorded across linked voices #2138. This conflicts with Improvement: Digitakt II base: chords recorded across linked voices #2138 in voices.c and VOICES.md, and the two find the kit's track sounds differently: here [0x80004704] + 0x34, there the fixed KIT_SOUNDS 0x426532ec. Once this one is in, please merge it into Improvement: Digitakt II base: chords recorded across linked voices #2138 (don't rebase) and use one of the two. Since a voice now loads the lead's sound note by note, does Improvement: Digitakt II base: chords recorded across linked voices #2138 still need to overwrite the voice tracks' kit sounds? That was my main question there.

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.

2 participants