Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/2026-11-24-digitakt-ii-chord-recording.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Digitakt II base: chords recorded across linked voices. Live recording on a lead track (SETTINGS > VOICES above 1) now records each note of a chord as a step on the track that plays it, so a recorded chord plays back as a chord and each note can be edited like any step. A note the instrument starts playing a moment before the recording sees it is recorded on the track playing it, not skipped. While linked, the voice tracks take a copy of the lead's sound and of its track's TRIG page defaults, length, swing and speed, kept up to date a part at a time and saved with the project, so their own steps sound exactly like the lead; they keep that sound when the setting returns to 1. Notes from the keys and MIDI fill the group from the lead up whatever the pattern plays there, and the pattern's notes of the lead never land on a voice track with steps of its own. Checked in the emulator and, as reported by the author, on a unit (OS 1.17, Morpha on the lead): chords recorded with the pattern running land on every linked track, sound like the lead and edit like any step.
8 changes: 8 additions & 0 deletions sdk/machines/digitakt-ii/elekloader/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"../modwerk/machines-entry.s",
"../modwerk/voices.c",
"../modwerk/voices-entry.s",
"../modwerk/voices-record-entry.s",
"../modwerk/fw-bindings.s"
],
"subscribe": [
Expand Down Expand Up @@ -114,6 +115,13 @@
"op": "jsr",
"target": "core_voice_event_entry"
},
{
"addr": "0x40048fb2",
"len": 6,
"stockSha256": "ed5086557423e0a010a460981e782edce14c7e9c57265e741ebacc985a1d8aa3",
"op": "jsr",
"target": "core_voice_record_entry"
},
{
"addr": "0x40066df2",
"len": 6,
Expand Down
20 changes: 16 additions & 4 deletions sdk/machines/digitakt-ii/elekloader/modwerk/VOICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ A lead track plays its notes on the tracks after it, so notes overlap instead of

## What the musician does

SETTINGS shows a row named after the track you are on, `T1 VOICES` to `T16 VOICES`, from 1 (stock) to 8. LEFT and RIGHT change it. With 3 on track 1, tracks 1, 2 and 3 form a group: each new note track 1 plays goes to the first of them, from the lead on, that holds no note, so the lead takes a chord's first note (the trig keys send a chord from the lowest note up); with all three busy, to the next one in turn.
SETTINGS shows a row named after the track you are on, `T1 VOICES` to `T16 VOICES`, from 1 (stock) to 8. LEFT and RIGHT change it. With 3 on track 1, tracks 1, 2 and 3 form a group: each new note track 1 plays from the keys or MIDI goes to the first of them, from the lead on, that holds no note from the keys or MIDI, so the lead takes a chord's first note (the trig keys send a chord from the lowest note up) whatever the pattern plays there; with all three busy, to the next one in turn. The pattern's notes of the lead play on the lead, or, while it holds a note, on a voice track with no steps of its own.

- The voice tracks belong to the lead while linked: they play the lead's sound with its machine, with each trig's own locks, and follow knob turns made on the lead. Their own trigs are silent while linked (the base sends their notes to no track), so their own machine never sounds between or after the lead's notes. Their own sounds, trigs and pages are not changed: back at 1 they play as before.
- The voice tracks belong to the lead while linked: their sound in the kit becomes a copy of the lead's (machine, filter, amp, effects, everything) and their track's TRIG page defaults, length, swing and speed the lead's, kept up to date and saved with the project; they follow knob turns made on the lead. Their own steps play and their own key presses are silent. Back at 1 they keep the copied sound.
- Live recording on the lead puts each note on the track that plays it: a chord records as one step on each of its tracks.
- A muted lead plays nothing. A muted voice track is skipped.
- A track that is already a voice of an earlier lead leads nothing, and a group ends at track 16.
- The setting is the project's: saved with it (project archive tag `VOC1`), reset to 1 everywhere by a project saved without it.
Expand All @@ -33,7 +34,17 @@ Because the record names its sound, a note moved to another track plays the lead

**Knobs.** The per-track parameter targets are 71 int16 a track from `0x80003362` (142 bytes a track; the smoother at `0x400d9406` follows them each frame from `0x80003340`). A note-on loads the note's sound and locks into its track's targets. Once a frame, before the transfer, `core_voice_frame` compares the lead's targets with the last frame's and copies the values that changed to its voice tracks. In a frame where a sequencer note stayed on the lead, it only takes the lead's new values, so a trig lock on the lead does not spread to the voices; notes from the keys or MIDI carry no locks and never hold a turn back. As a safety net, each frame one voice track of the group that holds no note is copied from the lead in full, so the next note there starts from the lead's settings. Found on a unit (Morpha, build `e6ffc45b`): while chords were played and knobs turned, later chord notes no longer sounded like the lead; the frames skipped for every lead note had swallowed turns.

**Sound chip.** The machine wire's per-track types (`machine-frame.c`) give a voice track its lead's type for as long as it is linked, so an added machine's player plays every note its lead sends there, and the track's own machine never takes over its voices mid-note. A voice track's own note records go to track 16 (none) at the same entry.
**Live recording.** The sequencer records a live note with `0x40048fb2` (arguments on the stack: sequencer, track, note, velocity, a flag, step, …; it looks up the track's object with `0x4003f304` and writes the step through `0x40059988` and `0x400597c8`). Found with a write watch on pattern 0 while a tap was recorded: the step word at `pattern + 0x6a5 * track + 2 * step` (here `0x11`, then `0x391`), then the step's bytes 0x100, 0x180, … 0x400 further; the frame chain from `0x400597c8` led back through `0x400599ba` and `0x40048fb2` to the event handler at `0x40031a60`. The routine runs about 40,000 instructions before the frame plays the note (the held-note tables were written after the step). The base's jsr replaces its first 6 bytes (`linkw %fp,#-68; moveq #15,%d0`, SHA-256 `ed508655…`); `core_voice_record` changes the track argument of a lead's note to the group track it will play on (as `pick` chooses, skipping tracks other recorded notes have taken) and leaves a pending entry that `core_voice_event` uses to send the note there. When the frame plays a note from the keys or MIDI before the routine has seen it (no pending entry), it marks the track it chose as holding a fresh note of that pitch, and the routine records the note there. Any other note the group already holds (the keys sending a held note again) is not recorded (track 16: the routine returns at once). Each chord note therefore lands as an ordinary step on its own track, editable like any step.

A linked voice track's own steps play while it is linked: a sequencer note-on on a voice track keeps its track. To make them sound like the lead, the base copies the lead's sound in the kit (`0x426532ec + 0x450 * track`, 0x450 bytes) and its pattern track's settings (`+0x480` to `+0x48f`: the TRIG page defaults the note record's constructor at `0x400d6d24` falls back on when a step sets none, then length, swing and speed) to each voice track, in full when linking, then one voice a frame and a sixth of the sound at a time (only the words that differ are written), so the frame interrupt stays short. Pointing the step's note record at the lead's sound (`+0x3c`) was tried first and is not enough: on a unit the recorded chord notes played louder, unfiltered and without envelope; in the emulator a voice track's own note played 9 dB over the lead's and held flat, still 9 dB over with the sound copied but not the track's settings, and at the lead's level with its decay with both (rms 0.045 against 0.043). Its own key presses still go to no track.

On the unit (`11fa7318`, the record hook with the pointed sound, the pattern running): of four linked tracks only tracks 1 and 3 recorded, and the sound went wrong while recording. In the emulator the sequencer plays only its first step, so neither could be reproduced; the fill order above (live notes ignore what the pattern plays on a track) and the pattern notes' rule (never on a voice track with steps of its own) answer the likely cause, pattern notes taking track 2.

On the unit (`f83435c3`, those two rules and the copied sound and settings, the pattern running, reported by the author): recorded notes sounded like the lead, but some of the linked tracks again recorded nothing, and changing pages on a linked track lagged (up to about a second) while the pattern ran, not on the lead. The likely cause of the missing notes: the recording routine skipped a note the frame had already played, taking it for the keys sending a held note again; the fresh marks above record it instead. The lag's cause is not confirmed: the idle copy now compares a sixth of a sound a frame instead of all of it, and writes a track's targets only where they differ. Neither could be reproduced in the emulator, whose sequencer stops after its first step, but one emulator run recorded a chord's second note after the frame had played it (held-note tables written before the step), on the track playing it. With both changes (`800a4a6f`, table below) the author reported every linked track recording its note and no lag.

Emulator (track 1 leading 3, rotating test build): REC + PLAY, three taps of trig key 1: the first recorded on track 1 and played there, the second on track 2, the third on track 3 (step words `0x391`, held-note source 2 on the same track). Playback of recorded steps could not be checked: after STOP and PLAY the emulator's sequencer played only its first step. Every track at 1: the project's pattern and the default note as before.

**Sound chip.** The machine wire's per-track types (`machine-frame.c`) give a voice track its lead's type for as long as it is linked, so an added machine's player plays every note its lead sends there, and the track's own machine never takes over its voices mid-note. A voice track's own key presses go to track 16 (none) at the same entry; its own steps keep their track.

## Checked

Expand All @@ -56,8 +67,9 @@ On a unit (reported by the author, 23 November 2026), Digitakt II OS 1.17 with t
| `063eea9a` (voices rotating, a voice track's own machine between borrowed notes) | Chords from the keys: each note and each key release moved to another track, each sounding a different wave; letting go of the second key of a two-key chord left a note sounding that jumped to the first key's pitch. Save, load another project and come back: the track kept its settings. |
| `e6ffc45b` (voice tracks reserved for the lead, filled from the lead, copied at linking; held pitch from the keys dropped) | Chords play; after a while of playing and turning knobs, later chord notes no longer had the lead's settings. |
| `27dfadf8` (turns copied with key and MIDI notes, idle voices copied in full) | Chords with VOICES 3-4 and knobs turned while playing: every chord note keeps the lead's settings. |
| `800a4a6f` (chord recording: voice tracks copy the lead's sound and settings a part at a time, fresh marks) | Chords from the keys recorded with the pattern running and VOICES 3-4: every linked track got its note, and the recorded notes sound like the lead. Page changes on a linked track while the pattern runs: no lag. A recorded note on a voice track edits like any step. Recorded timing fine with quantize on. Live chords, knobs and Morpha's FOLD as before. |

Not checked yet: sequencer trigs on a linked lead on a unit, MIDI chords, muted voices, a stock machine (SAMPLE) as the lead on a unit.
Not checked yet: MIDI chords, muted voices, a stock machine (SAMPLE) as the lead on a unit.

## Open

Expand Down
24 changes: 24 additions & 0 deletions sdk/machines/digitakt-ii/elekloader/modwerk/voices-record-entry.s
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
/* Linked voices, live recording (OS 1.17): the sequencer's live-record routine at 0x40048fb2 takes (sequencer, track,
* note, velocity, flag, step, ...) on the stack and records the note on that track's step. Its first 6 bytes
* (linkw %fp,#-68; moveq #15,%d0) become the base's jsr: voices.c may change the track argument to the voice track the
* note will play on, then this replays the two instructions on the caller's stack, as stock ran them, and resumes at
* 0x40048fb8. Scratch registers d0, d1, a0 and a1 carry nothing into the routine (its arguments are on the stack). */
.text
.even
.globl core_voice_record_entry

core_voice_record_entry:
lea -16(%sp),%sp
movem.l %d0-%d1/%a0-%a1,(%sp)
pea 24(%sp) /* the arguments: our return address and the caller's lie in between */
jsr core_voice_record
addq.l #4,%sp
movem.l (%sp),%d0-%d1/%a0-%a1
lea 16(%sp),%sp
movea.l (%sp)+,%a0 /* back to 0x40048fb8, with the stack as the caller left it */
link.w %fp,#-68
moveq #15,%d0
jmp (%a0)

.section .note.GNU-stack,"",@progbits
Loading