Skip to content
Draft
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
338 changes: 338 additions & 0 deletions sdk/digitone-ii/modules/usb-multi/LICENSE

Large diffs are not rendered by default.

55 changes: 55 additions & 0 deletions sdk/digitone-ii/modules/usb-multi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# USB Multi

A fourth USB CONFIG choice for the Digitone II, **USB MULTI/MIDI**. With it the Digitone shows up as a
class-compliant USB Audio 2.0 device with 42 inputs at 48 kHz and 24 bits, no driver needed.

| USB inputs | what |
| --- | --- |
| 1-32 | the 16 tracks as stereo pairs: track 1 on 1-2, track 2 on 3-4, and so on to track 16 on 31-32 |
| 33-34 | the main mix |
| 35-36 | the delay's return |
| 37-38 | the reverb's return |
| 39-40 | the chorus's return |
| 41-42 | the audio inputs |

USB AUDIO/MIDI stays the stock stereo mode. USB MIDI, OVERBRIDGE and audio from the computer are unchanged.

## Quick tutorial

1. Open SETTINGS (FUNC + PROJECT), then SYSTEM > USB CONFIG.
2. Choose USB MULTI/MIDI, the fourth item, and press YES. The Digitone leaves the computer and comes back with 42
inputs.
3. In your audio app, pick the Digitone as the input device and arm the pairs you want.
4. Before an OS update, or before going back to the stock OS, pick one of Elektron's three choices again.

## How it works

The DSP already produces these 42 channels every 32-sample block: 14 arrive in the SSI0 words, 28 in the DSP's SPI
reply. Stock USB AUDIO/MIDI sends two of them (USB OUT's choice). With USB MULTI/MIDI chosen, the mod packs all 42
into a larger packet ring (15 packets of 882 bytes, 3-byte subslots) and gives the stream and the mode-5 descriptors
42 channels. The stock sender's rate estimate and restart flags are kept and used as the stock uses them; every packet
stays inside its slot whatever the rate estimate says (0.4).

The choice is stored as USB CONFIG 3. Every stock reader of USB CONFIG turns a 3 into 2, so the stock code runs USB
AUDIO/MIDI's mode as it always does; only this mod tells the two apart. Switching between USB AUDIO/MIDI and USB
MULTI/MIDI restarts USB with the stock's own stop and start, so the computer sees the device leave and come back.

The mod uses no core event. It patches nine sites of its own (`build.json`), none of them a base site.

## Changes to stock flows

- **SETTINGS > SYSTEM > USB CONFIG** gets a fourth item. The three stock items are unchanged; USB AUDIO/MIDI's
check box is not ticked while USB MULTI/MIDI is chosen. The item exists only while the module is in the build.
- **Going back to the stock OS:** the stock OS reads a saved USB MULTI/MIDI as USB MIDI at power-on. Choosing USB
CONFIG again there sets it right.

## Limitations

- 48 kHz and 24 bits only. All 42 inputs are always sent, whatever USB OUT is set to.
- Sending audio from the computer to the Digitone works as in USB AUDIO/MIDI (stereo).
- Not yet run on Modwerk's Digitone II base; see [TESTING.md](TESTING.md).

## Credits and licence

By naturarum, from a study of OS 1.12. First released in Digiwerk (github.com/naturarum/dn2-cfw), built there with
an elekloader fork; this folder is now its source. GPL-2.0-or-later ([LICENSE](LICENSE)).
48 changes: 48 additions & 0 deletions sdk/digitone-ii/modules/usb-multi/TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# USB Multi: testing

## This version on Modwerk's base

Built with Modwerk's pinned toolchain (the isolated Docker build): `usb-multi-0.4.1-experimental-os1.12.elemod`,
SHA-256 `af6d8fbc94f15171c9efd8ed4f33a2c382aee1a38554b9248a10a3fcc40dcebf`. Linked with Modwerk's Digitone II base
(`base/digitone-ii-next` at `c69793f8e`) and stock OS 1.12, alone, into the test image MW41, SHA-256
`af0671ed337595ca8b4900e0c3ff83c7aa10c3e62d6f18e1c3263b0891bd52f5`.

| date | build | tester | as reported |
| --- | --- | --- | --- |
| 30 November 2026 | MW41 on a Digitone II, OS 1.12 | naturarum (the author) | "ok mw41 flashed and working". No per-test results were reported. |

Not reported yet, on that build:

- USB MULTI/MIDI chosen: the 42 inputs on a Mac and on an iPhone or iPad; a recording of busy patterns for at least
an hour, checked for dropouts;
- switching between all four USB CONFIG choices, with the computer connected;
- USB AUDIO/MIDI, USB MIDI and OVERBRIDGE with the module present and not chosen: unchanged;
- a project save and reload, and a power cycle with USB MULTI/MIDI chosen;
- an OS transfer with Elektron Transfer after a long quiet spell (the case that crashed 0.3);
- the base's own events (draw, keys, encoders, settings) still working beside it;
- screenshots of SETTINGS > SYSTEM > USB CONFIG with the fourth item.

## Earlier runs, in Digiwerk builds (not this base)

0.3 and 0.4 ran on a Digitone II, OS 1.12, in Digiwerk builds (github.com/naturarum/dn2-cfw), linked with
Digiwerk's own elekloader core and its other mods. Tester: naturarum (the author).

0.4.1-experimental, the version here, is 0.4 with the fourth USB CONFIG item's callbacks rewritten for Modwerk: in
0.4 they were assembly modelled instruction for instruction on USB AUDIO/MIDI's own callbacks. YES, the turn and the
check box are now C in `um.c`, and the name is eight instructions of our own in `um_stubs.s`. Apart from that and
the comments, the code is 0.4's. The rewrite ran on a unit on 30 November 2026, on Modwerk's base (above).

| version | date | what was seen |
| --- | --- | --- |
| 0.3 | 1 and 3 November 2026 | 42 inputs on a Mac; with AUM on an iPhone, the phone picked up the new channel layout quickly. Three crashes in all: one when starting an OS transfer after the USB tests, one after a while of not playing, one not described. |
| 0.4 | 4 November 2026 | 42 inputs, recordings clean; about an hour of playing with USB MULTI/MIDI on, no lock. Seven other builds carrying it ran about a minute each. |

What 0.4 changed: 0.3's sender could write past its packet ring, after the stock rate estimate went wrong across a
pause longer than about one second with no other USB traffic (found by reading the code and by a host test under
AddressSanitizer). 0.4 keeps every packet inside its slot whatever the estimate says. Not shown to be the cause of
the 0.3 crashes, though it fits them; no crash has been seen with 0.4 so far.

## Host and emulator checks

In Digiwerk: a host test of the packing code under AddressSanitizer, and emulator boots of the builds. These are
for iteration only and qualify nothing.
94 changes: 94 additions & 0 deletions sdk/digitone-ii/modules/usb-multi/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"schemaVersion": 1,
"sources": [
"src/um.c",
"src/um_stubs.s"
],
"defsym": {},
"cflags": [],
"weak": [],
"subscribe": [],
"contribute": [],
"collections": {},
"copied": [],
"regions": [],
"claims": [
"settings:SYSTEM > USB CONFIG",
"usb:USB AUDIO/MIDI stream and descriptors",
"memory:SRAM 0x80009700-0x8000cb36 (Overbridge's packet ring)"
],
"requires": [],
"derive": null,
"releases": {
"1.12": {
"defsym": {},
"cflags": [],
"sites": [
{
"addr": "0x400040e6",
"len": 6,
"stockSha256": "4ccb73ab1a83a4b42f5e2f068f076ebc531a5e7abfefff1b8d279e2dcbacdcbd",
"op": "jsr",
"target": "um_dqh"
},
{
"addr": "0x40027772",
"len": 6,
"stockSha256": "d9b6012720be6c5051f159adc950143d0dd1960589fb6e62764c25111903ccc9",
"op": "jsr",
"target": "um_send"
},
{
"addr": "0x400279d4",
"len": 6,
"stockSha256": "d9b6012720be6c5051f159adc950143d0dd1960589fb6e62764c25111903ccc9",
"op": "jsr",
"target": "um_mute"
},
{
"addr": "0x4000655e",
"len": 6,
"stockSha256": "4202be4af42748c3dfbcf9742e626d26394a3504d2de6eb8e45ea02723c3a6a5",
"op": "jsr",
"target": "um_start"
},
{
"addr": "0x40006880",
"len": 8,
"stockSha256": "3d1009518b8a72f12cc47e46e8da2980056530779dbf3a2db241eeb940de9418",
"op": "jmp",
"target": "um_desc"
},
{
"addr": "0x400cf22c",
"len": 2,
"stockSha256": "b3529f78982d3e1f0e3966ca195e56a9a3825209fc606fb231c0855a98fa25a8",
"op": "bytes",
"new": "6e06",
"kind": "code"
},
{
"addr": "0x40105220",
"len": 6,
"stockSha256": "f9e4e460a94d586bd50a8538ac6ecd2a217e485ea070088393ded7cc52205994",
"op": "jsr",
"target": "um_menu_hook"
},
{
"addr": "0x40104d54",
"len": 6,
"stockSha256": "01c6e7c73a918fc96c0ce8f7325505133f27f53201e2dfa0db12bee6e58f1304",
"op": "jsr",
"target": "um_cfg_get"
},
{
"addr": "0x40104e02",
"len": 6,
"stockSha256": "80985e81a9746e733cfd2a4490954040cea5b1b66bb002b0eac12321b9591c8b",
"op": "jmp",
"target": "um_mode_set"
}
]
}
}
}
1 change: 1 addition & 0 deletions sdk/digitone-ii/modules/usb-multi/media/thumbnail.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 107 additions & 0 deletions sdk/digitone-ii/modules/usb-multi/modwerk.module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"schemaVersion": 3,
"id": "usb-multi",
"name": "USB Multi",
"version": "0.4.1-experimental",
"machine": "digitone-ii",
"category": "midi-usb",
"exclusive": false,
"author": {
"github": "naturarum",
"credits": [
"naturarum"
]
},
"maintainers": [
"naturarum"
],
"presentation": {
"label": "USB MULTI",
"family": "USB audio",
"summary": "A fourth USB CONFIG choice that sends all 42 channels to the computer: the 16 tracks as stereo pairs, the main mix, the FX returns and the inputs.",
"overview": "USB MULTI/MIDI makes the Digitone II a class-compliant USB Audio 2.0 device with 42 inputs at 48 kHz and 24 bits, no driver needed. The DSP already produces these channels every block; the mod sends them all instead of the two USB AUDIO/MIDI sends. USB AUDIO/MIDI stays the stock stereo mode, and USB MIDI, OVERBRIDGE and audio from the computer are unchanged.",
"highlights": [
"42 inputs, class compliant, 48 kHz, 24 bits",
"Track 1 on inputs 1-2, track 16 on 31-32",
"Main mix, delay, reverb and chorus returns, and the audio inputs too",
"The stock USB AUDIO/MIDI, USB MIDI and OVERBRIDGE choices unchanged"
],
"usage": [
"Record every track to its own pair in a DAW in one pass.",
"Use it with an iPhone or iPad app that takes class-compliant multichannel audio."
]
},
"access": {
"location": "SETTINGS > SYSTEM > USB CONFIG, the fourth choice: USB MULTI/MIDI.",
"steps": [
"Open SETTINGS (FUNC + PROJECT), then SYSTEM > USB CONFIG.",
"Choose USB MULTI/MIDI, the fourth item, and press YES. The Digitone leaves the computer and comes back with 42 inputs.",
"In your audio app, pick the Digitone as the input device: 1-32 are the 16 tracks as stereo pairs (track n on 2n-1 and 2n), 33-34 the main mix, 35-40 the delay, reverb and chorus returns, 41-42 the audio inputs.",
"Before an OS update or before going back to the stock OS, pick one of Elektron's three choices again."
],
"screenshots": []
},
"controls": [],
"compatibility": {
"releases": [
"1.12"
],
"requires": [],
"conflicts": [],
"limitations": [
"48 kHz and 24 bits only; all 42 inputs are always sent, whatever USB OUT is set to.",
"Saved as USB CONFIG 3, which the stock OS reads as USB MIDI at power-on: pick one of the stock choices again after going back to stock.",
"Not yet run on Modwerk's Digitone II base: the hardware runs so far were on Digiwerk builds (TESTING.md)."
]
},
"platform": {
"kind": "elemod",
"core": "1.1",
"build": "build.json",
"events": [],
"claims": [
"settings:SYSTEM > USB CONFIG",
"usb:USB AUDIO/MIDI stream and descriptors",
"memory:SRAM 0x80009700-0x8000cb36 (Overbridge's packet ring)"
]
},
"resources": {
"memoryBytes": 2772,
"fastBytes": 0,
"load": {
"display": "Not measured on a unit",
"method": "unmeasured",
"conditions": "Runs in the stock audio block handler, once per 32-sample block, only while USB MULTI/MIDI streams: it packs 42 channels into its packet ring in place of the stock stereo pack. Memory measured from the linked image: the base alone leaves 255,328 bytes of its RAM free, with this module 252,556."
}
},
"evidence": {
"tier": "none",
"moduleVersion": "0.4.1-experimental",
"sourceSha256": null,
"reports": [
"TESTING.md"
],
"hardware": null,
"verifiedBy": null
},
"tests": {
"report": "TESTING.md",
"summary": "0.3 and 0.4 ran on a Digitone II in Digiwerk builds (OS 1.12, Digiwerk's own core), with a Mac and an iPhone. 0.4.1-experimental (0.4 with the USB CONFIG item's callbacks rewritten) has not run on a unit or on Modwerk's Digitone II base yet."
},
"license": {
"spdx": "GPL-2.0-or-later",
"file": "LICENSE",
"declaration": "Original work by naturarum, from a study of OS 1.12. First released in Digiwerk (github.com/naturarum/dn2-cfw)."
},
"media": [
{
"path": "media/thumbnail.svg",
"kind": "thumbnail",
"caption": "USB Multi",
"alt": "Forty-two thin bars in pairs, standing for the USB inputs.",
"credit": "naturarum",
"license": "GPL-2.0-or-later",
"source": "Original vector illustration; not a device screenshot."
}
]
}
Loading