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
30 changes: 30 additions & 0 deletions sdk/drafts/master-thru/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
MIT License

Copyright (c) 2026 takuhito-bit

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

---

This licence covers this module's own source code and documentation only. It
does not extend to any Elektron Music Machines firmware, which is not
distributed here and remains the property of its copyright holder. Nothing in
this module is endorsed by, supported by, or affiliated with Elektron.
Octatrack and Elektron are trademarks of Elektron Music Machines MAV AB, used
only to identify the hardware this module targets.
55 changes: 55 additions & 0 deletions sdk/drafts/master-thru/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Master Thru

Version: 0.1.0-experimental · author: @takuhito-bit

## Overview

With MASTER TRACK on, track 8 is the master: it hears tracks 1–7 and the DIR inputs, and stock leaves its PLAYBACK page empty. Master Thru puts THRU's controls there, so the live inputs can join the master's mix at their own level and pan, before T8's AMP, FX1 and FX2, with locks, LFOs and scenes, and without spending a track on a THRU machine. A THRU machine on any other track works as before.

**Prototype status.** The page is built and works on an MKI (TESTING.md). The sound part, a DSP engine on the `dsp_track_source` chain that adds the inputs to the master's mix, needs base support first ([#2602](https://github.com/repeat98/modwerk/issues/2602)). Until then the controls change nothing you hear.

## Controls

T8's PLAYBACK page while T8 is the master. The page is stock's THRU page, so INAB, VOL, INCD and VOL look, read and edit as on a THRU track; PAN fills THRU's two empty slots.

| Knob | Name | Values | What it does |
| --- | --- | --- | --- |
| A | INAB | –, A, B, A+B, A B | Inputs A/B: off, A, B, A+B (their mono sum) or A B (stereo, A left). Starts off. |
| B | VOL | -64..+63 | Their level, as THRU's VOL. |
| C | PAN> | -64..+63 | Where a mono A, B or A+B sits; the balance for the stereo A B. 0 is centre, both sides at unity, as AMP's BAL. |
| D | INCD | –, C, D, C+D, C D | Inputs C/D, as INAB. Starts off. |
| E | VOL | -64..+63 | Their level. |
| F | PAN> | -64..+63 | Their pan or balance. |

PAN's `>` leads on to the AMP page, where ATK starts with one: the top rows of both pages are inputs A/B, the bottom rows C/D. The knobs carry no link marks.

T8's AMP page while T8 is the master: an envelope for each pair of inputs, on the inputs only, never on T1–T7 or DIR.

| Knob | Name | What it does |
| --- | --- | --- |
| A, B, C | >ATK, HOLD, REL | The envelope of inputs A/B, as on AMP. |
| D, E, F | >ATK, HOLD, REL | The envelope of inputs C/D. |

Without trigs on T8 the inputs always pass (HOLD at its maximum holds). A trig on T8 restarts both envelopes; lock their knobs on it like any other. The envelopes need the DSP part too.

## How to reach it

1. PROJECT > CONTROL > AUDIO: turn MASTER TRACK on.
2. Select track 8 and press PLAYBACK (SRC on an MKII).

## Changes to stock flows

- **T8's AMP page with MASTER TRACK on.** Stock shows nothing; with the module installed it shows the envelopes above, stored in T8's AMP slots. Stock's AMP stage leaves the master's sound alone with them set (heard on an MKI, TESTING.md). Only while the module is installed.
- **T8's PLAYBACK page with MASTER TRACK on.** Stock shows nothing; with the module installed it shows the page above. Why: the master has no other page for its source, and a musician looks for THRU's controls there. Only while the module is installed; removing it brings stock's empty page back. Every other track, and T8 with MASTER TRACK off, take stock's path unchanged (the detour replays the stock instruction for them).

- **T8's own machine after the master.** The pages' values are T8's own PLAYBACK and AMP slots, saved with the project. Turn MASTER TRACK off, remove the module, or load the project on a unit without it, and T8's machine takes them as its own values (seen on an MKI with STATIC: AMP's values all the way left, so T8 is silent until its VOL is raised; TESTING.md). Set T8's pages again after turning the master off.

## How it works

Two detours in stock's page selector (0x40031e08), at 0x40031e6a (PLAYBACK) and 0x40031e7e (AMP): for the master each returns this module's page, built once from the unit's own THRU or AMP page (unit.s). Nothing runs per frame. The page's values reach the DSP as every track's PLAYBACK values do. The master keeps stock's name, MASTER.

**Beside the base's sites.** The base patches the same selector: its page resolver for contributed machines, `mw_resolve_pb`, takes the 10 bytes at 0x40031e74..0x40031e7d (sdk/machines/octatrack/HOOKS.md). The PLAYBACK detour (0x40031e6a, 6 bytes) ends 4 bytes before it, and the AMP detour (0x40031e7e, 6 bytes) starts on the byte after it; no bytes overlap. For every track that is not the master, the PLAYBACK detour replays the displaced `move.l` and rejoins stock at 0x40031e70, which runs on into 0x40031e74, so a contributed machine's page still goes through the base's resolver; the AMP detour rejoins at 0x40031e84. For the master both leave through stock's exit at 0x40031ed6, as stock's own master branch does. The module touches none of the base's name lookups (`mw_name_a` 0x4003d718, `mw_name_b` 0x4004c36a).

## Compatibility

Declares `screen:MASTER PLAYBACK` and `screen:MASTER AMP`. The base's `mw_resolve_pb` sits in the same selector, between the two detours (see above); no module in the library patches 0x40031e6a or 0x40031e7e.
65 changes: 65 additions & 0 deletions sdk/drafts/master-thru/TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Master Thru testing

Record what you ran, on which build and which unit, and what you saw. "Not tested" is a valid answer; never write a result you did not observe, and keep emulator runs apart from hardware ones.

## On the unit

Version 0.1.0-experimental, a draft: every trial below ran a prototype build of it (the pages only, no DSP part), not a package.

**4 December 2026, MKI, OS 1.40C, base `ddb56b72`, prototype trial `a48f2bce` (the page only), RAM trial over USB, rolled back.** Reported by the developer (@takuhito-bit) from the unit's screen:

- With MASTER TRACK on, T8 → PLAYBACK opens the page (stock shows nothing there).
- INAB and INCD read as on a THRU track; the controls are named INAB, VOL, PAN, INCD, VOL, PAN, inside their frames.
- INAB > VOL > PAN and INCD > VOL > PAN were linked by stock's arrows in this build (a later one drops the link marks).
- VOL and PAN show -64..+63 with 0 at the centre, as AMP's BAL.
- The knobs change their values, and a trig held while turning one takes a lock.

The trial's log: no crash, stall, freeze or skipped track (`device.mjs try` verdict).

**4 December 2026, MKI, OS 1.40C, base `ddb56b72`, prototype trial `f99c4cb4` (the current pages), RAM trial over USB, rolled back.** Reported by the developer from the unit: PLAYBACK reads INAB VOL PAN> over INCD VOL PAN>, AMP reads >ATK HOLD REL on both rows, no link marks; the master is named MASTER+THRU, nothing cut off or overlapping; nothing else on other tracks or screens changed. Which screens showed the name was not recorded. Trial log: no crash, stall, freeze or skipped track. On 5 December the developer dropped the name: the master is MASTER again, as stock. The build without it has not been tried on a unit yet.

Between that build and the ones below, trials `12824cd8`, `f1d4baa5`, `39903350`, `b543346f` and `39ac8669` tried the look of these marks (stock's link arrow drawn after PAN, the font's arrow, a triangle glyph added to the label font): each displayed, each rolled back with nothing logged, and the developer chose the plain `>`.

**4 December 2026, MKI, OS 1.40C, base `ddb56b72`, prototype trial `07c177fc` (both pages, still no DSP part), RAM trial over USB, rolled back.** Reported by the developer from the unit:

- With MASTER TRACK on, T8 → AMP opens the page (stock shows nothing there), and its knobs turn.
- Moving the envelope knobs, and locking them on T8's trigs, changed nothing heard in the master's mix. So stock's AMP stage leaves the master alone with these slots set (they are stock's ATK, HOLD, REL, VOL, BAL and XVOL slots of T8), as Master Thru's design needs.

The trial's log: no crash, stall, freeze or skipped track.

**4 December 2026, MKI, same build (`07c177fc`), a second RAM trial, rolled back.** Reported by the developer: with MASTER TRACK on, T1–T7's PLAYBACK and AMP pages were stock's for their machines; with MASTER TRACK off, T8's PLAYBACK and AMP pages were stock's for its machine; turned back on, T8 showed this module's two pages again. The machines on each track were not recorded.

An earlier trial the same day (`9f8e33d6`, built on FLEX's page) opened the page with numbers for INAB and names that crowded their frames; that is why the page is now THRU's.

**5 December 2026, MKI, OS 1.40C, base `ddb56b72`, prototype trial `b026a357` (the master keeps stock's MASTER), RAM trial over USB, rolled back.** Reported by the developer from the unit:

- With MASTER TRACK on, the master is named MASTER; T8's PLAYBACK and AMP open this module's pages.
- INAB and INCD offer –, A B, A, B, A+B (C/D likewise); VOL and PAN run -64..+63; ATK 0..127, HOLD from 0.007 up to INF, REL 0 to INF, on both rows.
- With the values moved and MASTER TRACK then turned off, T8's own machine (STATIC, with a sample) took them: on its AMP page VOL and BAL, among others, sat all the way left. T8 sounded once its VOL was raised. So the master's PLAYBACK and AMP values are T8's own slots, and its machine reads them when the master goes away.

The trial's log: no crash, stall, freeze or skipped track.

Stock's master pages, without the module (5 December 2026, MKI, OS 1.40C, captured over USB): `media/stock-master-playback-mki.png` (PLAYBACK: no controls, MASTER in the bottom bar) and `media/stock-master-amp-mki.png` (AMP: no controls). No MKII captures.

**5 December 2026, MKI, same build (`b026a357`), a second RAM trial, then removed.** Reported by the developer from the unit: with MASTER TRACK on, the pages' knobs behaved as in the trial above; the values were moved and the project saved. USB was then unplugged (the base rolled the module back) and the unit restarted: the module's pages were gone and the master was stock's. With the saved project loaded on that unit, without the module, and MASTER TRACK turned off, T8's STATIC machine loaded with the saved values in its own slots: on AMP, its values all the way left; on PLAYBACK, PTCH and RATE all the way left, STRT all the way right, LEN, RTRG and RTIM at the centre. What T8 sounded like after the reload was not recorded. This trial's log did not report a verdict (USB was unplugged during it).

So the values set on the master's pages stay in T8's PLAYBACK and AMP slots, are saved with the project, and become T8's own machine's values whenever the master goes away, with the module or without it.

**5 December 2026, MKI, OS 1.40C, base `ddb56b72`, same build (`b026a357`), a third RAM trial over USB (30 minutes), rolled back.** Reported by the developer from the unit, with MASTER TRACK on:

- LFOs: T8's LFO DEST offers these slots by stock's AMP names, so the module's PAN is listed as BAL. With an LFO on them and the pattern playing, nothing froze, nothing on screen broke and no other track misbehaved. As on stock, the pages' knobs keep showing the set value while an LFO moves it; with no DSP part yet, nothing is heard.
- Scenes: on both pages, holding a scene key and turning a knob assigns the slot as stock does, with the trig keys showing the assignments as on any other page.

The trial's log: no crash, stall, freeze or skipped track.

Not tested: the sound (no DSP part yet).

Known: LFO DEST names the module's PAN as stock's BAL. Whether to rename it there is left open until the slot question on the PR is settled.

## Stock flows

Not tested beyond the above.

## Performance

Not measured. The page is built once, on the first PLAYBACK press on the master; nothing runs per frame.
36 changes: 36 additions & 0 deletions sdk/drafts/master-thru/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
"""MASTER THRU -- THRU's controls and an input envelope on the master's pages.

Prototype, part 1 of 2: the pages only. With MASTER TRACK on, stock's page
selector (0x40031e08) gives track 8 empty PLAYBACK and AMP pages. Two
detours (0x40031e6a, 0x40031e7e) return this module's pages instead, built
at run time from the unit's own THRU and AMP pages (unit.s): INAB VOL PAN>
and INCD VOL PAN> on PLAYBACK, >ATK HOLD REL for A/B and C/D on AMP. The
master keeps stock's name, MASTER. No other track changes. Seen on an MKI
(TESTING.md).

Part 2, the DSP engine that adds the inputs to the master's mix at the
dsp_track_source chain (site 5) and runs their envelopes, waits on base
support (issue #2602).
"""

from remix.schema import Category, Proof, Detour, Gate, Kind, Linked, Module
from remix.stock_guard import stock_guard

MODULE = Module(
name="master-thru",
key="MASTER THRU",
kind=Kind.CF_PATCH,
doc="T8 as the master: THRU's INAB/VOL/PAN and INCD/VOL/PAN on its PLAYBACK page.",
category=Category.MACHINES, author="takuhito-bit", author_url="https://github.com/takuhito-bit",
proof=Proof.UNTESTED, proof_note="Prototype: the pages only; both pages tried on an MKI (TESTING.md).",
linked=(
Linked("unit", "modules/master-thru/unit.s", dram=True),
),
detours=(
Detour(0x40031E6A, stock_guard(0x40031e6a, 6, "64885133d7843d50aa58773c2314b3cd8eeacb58d768fe12f3d57c0b0c9af831"),
"unit", "mt_pb", "the master's PLAYBACK page: this module's instead of stock's empty one", kind="jmp"),
Detour(0x40031E7E, stock_guard(0x40031e7e, 6, "64885133d7843d50aa58773c2314b3cd8eeacb58d768fe12f3d57c0b0c9af831"),
"unit", "mt_amp", "the master's AMP page: the inputs' two envelopes instead of stock's empty page", kind="jmp"),
),
gates=(Gate("modules/master-thru/verify.py", remix_arg=False),),
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
133 changes: 133 additions & 0 deletions sdk/drafts/master-thru/octamod.module.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"schemaVersion": 2,
"id": "master-thru",
"key": "MASTER THRU",
"name": "Master Thru",
"version": "0.1.0-experimental",
"category": "machines",
"author": {
"github": "takuhito-bit",
"credits": [
"takuhito-bit"
]
},
"nativeManifest": "manifest.py",
"presentation": {
"label": "INPUT",
"family": "Input",
"summary": "With MASTER TRACK on, T8's empty PLAYBACK page gets THRU's controls, so the live inputs join the master without spending a track on THRU.",
"overview": "The master (T8) hears T1-T7 and DIR. Master Thru adds inputs A/B and C/D at their own level and pan before T8's AMP, FX1 and FX2, with locks, LFOs and scenes like any PLAYBACK control. Prototype: the page only; the sound part waits on base support (issue #2602).",
"highlights": [
"THRU's own INAB, VOL, INCD and VOL on the master's PLAYBACK page, plus a PAN for each pair",
"An envelope (ATK, HOLD, REL) for each pair of inputs on the master's AMP page: A/B on the top rows, C/D on the bottom",
"INAB and INCD start off: installing it changes nothing until you pick an input"
],
"usage": [
"Turn MASTER TRACK on (PROJECT > CONTROL > AUDIO), select T8 and press PLAYBACK."
]
},
"controls": [
{
"name": "INAB",
"default": 0,
"count": 5,
"doc": "Inputs A/B, as THRU shows them: off, A, B, A+B (mono sum) or A B (stereo, A left).",
"labels": null
},
{
"name": "VOL AB",
"default": 64,
"count": 128,
"doc": "Level of inputs A/B in the master, -64..+63 as THRU's VOL; 0 is unity. Shown as VOL.",
"labels": null
},
{
"name": "PAN AB",
"default": 64,
"count": 128,
"doc": "Where a mono A, B or A+B sits; the balance for the stereo A B. -64..+63 as AMP's BAL; 0 is centre, unity on both sides. Shown as PAN>.",
"labels": null
},
{
"name": "INCD",
"default": 0,
"count": 5,
"doc": "Inputs C/D, as THRU shows them: off, C, D, C+D (mono sum) or C D (stereo, C left).",
"labels": null
},
{
"name": "VOL CD",
"default": 64,
"count": 128,
"doc": "Level of inputs C/D in the master, as VOL AB. Shown as VOL.",
"labels": null
},
{
"name": "PAN CD",
"default": 64,
"count": 128,
"doc": "Where a mono C, D or C+D sits; the balance for the stereo C D. Shown as PAN>.",
"labels": null
}
],
"compatibility": {
"firmware": "1.40C",
"effectId": null,
"location": "Track machine",
"conflicts": [],
"uiClaims": [
"screen:MASTER PLAYBACK",
"screen:MASTER AMP"
],
"limitations": [
"Prototype: the page only. The inputs are not added to the sound until the DSP part lands with base support (issue #2602).",
"Tried on an MKI only, in RAM trials of the pages (TESTING.md); not on an MKII."
]
},
"resources": {
"recorded": "Not measured",
"storage": {
"label": "Storage",
"display": "Not measured",
"value": null,
"unit": "unknown",
"method": "unmeasured",
"conditions": "No measurements exist yet. Add exact conditions and source evidence when available.",
"source": "TESTING.md"
},
"processing": {
"label": "CPU / DSP load",
"display": "Not measured",
"value": null,
"unit": "unknown",
"method": "unmeasured",
"conditions": "No measurements exist yet. Add exact conditions and source evidence when available.",
"source": "TESTING.md"
}
},
"tests": {
"report": "TESTING.md",
"summary": "No tests have been run. Add tests.qualification with worst-case cycles, exact memory and attributed owner-reviewed hardware evidence before submitting. This scaffold cannot pass publication checks.",
"hardwareStatus": "untested",
"evidenceRevision": "b8deefc88b2c3e5f3c6158e364eb741df1924e1d",
"gates": [
"Worst-case cycles under parameter modulation and maximum load",
"Exact memory region and maximum-instance totals",
"Owner-reviewed real-hardware evidence with actual coverage and limitations"
]
},
"license": {
"spdx": "MIT",
"file": "LICENSE",
"declaration": "Replace with accurate authorship, attribution and original/licensed source and media rights. Never include Elektron firmware, extracted routines or tables."
},
"media": [],
"access": {
"location": "T8's PLAYBACK page while T8 is the master.",
"steps": [
"PROJECT > CONTROL > AUDIO: turn MASTER TRACK on.",
"Select track 8 and press PLAYBACK (SRC on an MKII)."
],
"screenshots": []
}
}
Loading