Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
13 changes: 13 additions & 0 deletions sdk/drafts/ungemach/CHANGELOG.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[
{
"version": "0.1.0-experimental",
"date": "2026-11-22",
"changes": [
"Adds UNGEMACH, a dissonant, living drone machine for dark techno: sixteen detuned voices, a sub and noise in stereo.",
"DISS widens the chord from unison to a scream while its pitch rises; WAVE has 32 waveforms from dull to shrill.",
"RATE drifts pitch, filter and level freely or pulses in time with the track; PNCH punches on every trig.",
"One UNGEMACH track per Part.",
"Known issue: tested only on the author's MKI; a busy pattern can skip a few of its frames a second."
]
}
]
32 changes: 32 additions & 0 deletions sdk/drafts/ungemach/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
MIT License

Copyright (c) 2026 GnocchiBalboa

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.

---

UNGEMACH's engine, waveforms and tables are original work. It reads the
sequencer's clock, tempo and track speed at the RAM locations Euclid reads
(sdk/octabam/modules/euclid/control.c, MIT, Sam Banks); no code is copied from
it. It contains no Elektron firmware, extracted routines, tables, samples or
graphics: the machine page copies stock's FLEX page record at run time on the
user's own unit and never ships it. Nothing here is endorsed by, supported by
or affiliated with Elektron. Octatrack and Elektron are trademarks of Elektron
Music Machines MAV AB, used only to name the hardware this module runs on.
62 changes: 62 additions & 0 deletions sdk/drafts/ungemach/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Ungemach

Version 0.1.0-experimental · by GnocchiBalboa (@GnocchiBalboa). An experimental draft: the author has played it on an Octatrack MKI over the Modwerk USB base. The [test record](TESTING.md) names the build for each result.

## Overview

UNGEMACH is a track machine for dark techno that makes its own sound on the ColdFire instead of playing a sample: a dissonant drone that never stands still. Sixteen detuned voices in three groups, an octave sub and a dark noise run through a resonant low-pass filter and a soft saturation, in stereo.

PTCH sets the root. DISS moves the second and third voice groups against it, from unison through quarter tones, tritones and ninths to a scream, and the chord's pitch rises with the knob. WAVE crossfades through 32 original waveforms from dull to shrill. TONE opens the filter, and DIRT adds resonance, drive and a phase push between the voices that makes the drone rough. RATE lets pitch, filter and level drift on their own, or pulse in time with the track. On SRC SETUP, SPRD sets the stereo width and PNCH gives every trig a punch.

The track's AMP envelope shapes the drone as it shapes a sample: a trig opens it and HOLD keeps it sounding. LFOs, parameter locks, scenes and the track's effects act on the six SRC knobs as on any machine.

## Controls

SRC (knobs A to F):

| Knob | Range | Default | What it does |
| --- | --- | --- | --- |
| PTCH | 0 to 120 | 24 | The root, in half semitones: 0 is 27.5 Hz, 24 is 55 Hz (A1), 120 is 880 Hz. Locks, LFOs and slides move it smoothly. |
| DISS | 0 to 127 | 40 | The chord: where the second and third voice groups sit against the root. 0 is unison; then quarter tones, semitones, tritones, sevenths and ninths, octave and fifth near 71-76, and the scream from 121. The chord's pitch rises with the knob. A step glides in about 90 ms, so a turn or an LFO is a glissando. |
| TONE | 0 to 127 | 80 | The low-pass filter's cutoff: dark at 0, open at 127. |
| WAVE | 0 to 127 | 24 | The voices' waveform: 32 original waveforms from dull to shrill, crossfaded. A turn glides, half the range in about 0.7 s. |
| RATE | 0 to 63, S16 to S2 | 20 | How the drone moves. 0-63: pitch, filter and level drift on their own, from 0.02 Hz at 0 to 2 Hz at 63; the filter moves by up to a quarter of TONE's travel. Above 63: a pulse in time with the track, one every 16, 8, 6, 4, 3 or 2 steps (S16 to S2), that opens the filter by 25 % of TONE's travel at 64, rising to 35 % from 74. |
| DIRT | 0 to 127 | 12 | Resonance, saturation and a phase push between the voices: clean and round at 0, rough and screaming at 127. |

SRC SETUP (knobs E and F; A to D are empty):

| Knob | Range | Default | What it does |
| --- | --- | --- | --- |
| SPRD | MONO, NARW, WIDE, FULL | WIDE | The stereo width. |
| PNCH | 0 to 127 | 0 | A punch on every trig: it opens the filter, adds dirt and lifts the level, then falls away in 35 ms at low values to 55 ms at 127. 0 is off. |

## Usage

UNGEMACH is reached through the track's machine list. It needs no sample. A good start for a dark drone under a kick: PTCH 24 (A1), DISS 40, TONE 70, WAVE 24, RATE 20, DIRT 12, the AMP envelope's HOLD high, and a trig on step 1. Turn DISS above 100 for a screaming, rising chord, and set RATE above 63 for a pulse with the pattern. For hits, set PNCH and add trigs, or put an LFO on DIRT in a trig mode.

## Quick tutorial

1. Double-tap a track key, move to UNGEMACH in the machine list and press YES.
2. Put a trig on the track, set the AMP envelope's HOLD high and press PLAY: the drone sounds. On the SRC page, turn DISS slowly from 0 up: the chord widens and rises. Turn WAVE for the colour and TONE and DIRT for brightness and grit.
3. Press SRC again for SRC SETUP and turn PNCH up: each trig now punches. Set RATE above 63 for a pulse in time with the track. Press STOP to stop, or double-tap the track key and choose FLEX to leave the machine.

## Compatibility and limitations

- Experimental draft. The author tested it on an Octatrack MKI with OS 1.40C and the Modwerk USB base 0.7.10. It has not been tested on an MKII.
- One UNGEMACH track per Part: the base refuses it for a second track, and that track stays what it was.
- It renders on the ColdFire, in the frame interrupt: about 37-60 microseconds of the 363-microsecond frame in the author's busy live set. With a full pattern the base's frame guard skipped some of its frames: none in most seconds, up to a few dozen a second at busy moments (under 2 % of frames). The author heard no dropouts. Several UNGEMACH-like machines at once would not fit.
- SPRD and PNCH sit on SRC SETUP, which locks, LFOs and scenes do not reach.
- Every byte UNGEMACH keeps in the Part is a valid FLEX value. What a project opened without the module plays has not been tested.
- Not yet tested: Part and bank changes with UNGEMACH tracks, a power cycle after a Keep, the module's own CPU price, and `device:qualify`.

## Tests and measurements

See [TESTING.md](TESTING.md): host tests under UBSan and ASan, and the measurements on the author's MKI.

## Authorship and licences

Original work by GnocchiBalboa under the MIT licence ([LICENSE](LICENSE)). The engine, the waveforms and every table are original and generated by `gen_tables.py`. The machine reads the sequencer's clock, tempo and track speed at the RAM locations Euclid (Sam Banks, MIT) reads; no code is copied from it. No Elektron firmware, extracted routines, tables, samples or graphics are included: the machine page copies stock's FLEX page record at run time on the user's own unit.

## Screens and audio

No screenshots yet: they will be captured in the headless emulator before the module is listed. No audio preview.
106 changes: 106 additions & 0 deletions sdk/drafts/ungemach/TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# UNGEMACH testing

Everything here was observed by the author (GnocchiBalboa) and the coding agent working with them. A result names its build; "not tested" means not run.

## 0.1.0-experimental, 22 November 2026

This version's source (commit 8a5d506a, `module/ungemach`) is the engine of the diagnostic build v68d with the measurement code compiled out; its output renders identically to v68 (see Host tests). On the author's live-set MKI, v68d was kept, played and measured (Performance below), and its sound accepted.

On 24 November 2026 the release package of this source, `a8bcdca3`, was priced and qualified on the same MKI (CPU price and Qualification below). The package now carries that price in its descriptor (`reserved[0]` = 15), which is the only byte that differs: `37d7a278`. That package went through the persistence checks the same day (Persistence below).

## Persistence

Package `37d7a278`, the author's MKI, OS 1.40C, flashed base 0.7.10 (`6070a4e4`), 24 November 2026, observed by the author; the inventory was read over USB.

- **Keep and power cycle:** kept with `device -- try --accept`. In a scratch project T1 was set to UNGEMACH, a pattern with trigs on T1 played and the drone sounded; Part and project were saved. After a power cycle the inventory still listed UNGEMACH (`ee55bea9`), the project loaded with T1 on UNGEMACH, and it played as before.
- **The project without the module:** another project loaded, UNGEMACH removed with `device -- remove --accept` (inventory empty), then the scratch project loaded again without saving. The unit showed a message that UNGEMACH is missing, T1 read FLEX, the sequencer ran normally and T1 stayed silent (no sample on it).

## Units and base

- **Live-set unit:** Octatrack MKI, OS 1.40C, Modwerk USB base 0.7.10 (`6070a4e4`), the author's own live set: seven Flex tracks with many trigs, LFOs and scenes, plus E-Verb, LOFI2, Analog BD, Mute Modes, Amiga and Mini Verb installed.
- **Test unit:** a second Octatrack MKI ("Probe-Octa"), OS 1.40C, an older USB base (`9680e9ac`), used for the early builds.
- Builds were loaded over USB with `npm run device -- try <package> --accept` (a Keep), run through the USB bridge (`scripts/octatrack-usb-bridge.py`).

## Host tests

`python3 -B verify.py` (or `test_ungemach.py`) compiles `engine.c` with `test_engine.c` under UBSan and ASan and runs it: levels, DC and clipping at every corner of the controls and at every DISS value, DISS's glide (34 to 35: 3 % of the way after one block, all of it after 0.5 s), a split frame sounding as one, three minutes of drone, PNCH standing out and ending (PNCH 127: the first 10 ms 13.1 dB over no trig, back to the drone within 0.3 s, peak -6.0 dBFS), and a synced RATE that pulses. Result on the source of this draft, 22 November 2026: all passed, with and without the sanitizers.

The cleanup for this draft (removed measurement and PC-only code, unused tables, LCUT) was checked by rendering 30,000 frames with moving controls and PNCH from the old and the new engine: the output is identical.

`gen_tables.py` writes `tables.h` and reproduces it; `calib_waves.c` measures each waveform's level for `WAVE_TRIM_DB`.

## Hardware: what was played

- **One track a Part** (package v32 `d3b5f1e4`, Probe-Octa, 19 November 2026): a second track shows UNGEMACH in the machine list but cannot pick it. After T1 went back to FLEX, T2 could pick it.
- **Controls** (live-set unit, builds v60 to v68, 21-22 November 2026): every SRC knob and SPRD and PNCH were turned while the pattern played; parameter locks on PTCH ran on every trig; an LFO on DIRT moved it (the diagnostic log showed DIRT's range moving with it); a crossfader scene changing UNGEMACH parameters was moved and held. The author judged PNCH, WAVE, DIRT, RATE and DISS by ear and accepted v68's sound.
- **Keeps:** each build was kept with `device -- try --accept` and played; the author replugged USB or power-cycled between builds when the bridge needed it.
- **Not tested:** MIDI floods and any MKII. Part and bank changes ran in `device:qualify`; the power cycle and a project without the module under Persistence (below).

## Performance on the live-set unit

The diagnostic builds (`UG_DIAG` in `machine.c`, never released) time the whole render callback with the 132 MHz DTCN3 timer, as the base's frame guard does, on the first UNGEMACH track, and report each second the mean a frame and the frames not rendered (the guard's skips) through `npm run device -- status` (DIAG value). The frame is 362.8 microseconds; the base gives all renders together about 290 of them.

| Build, date | What | Mean a frame | Skipped frames |
| --- | --- | --- | --- |
| v66d, 22 Nov, 12:49-12:56 | free play, every control turned | 39-58 µs | 0 to 52 a second, 76 of 191 s with any |
| v66d, 22 Nov, 13:04-13:09 | one control at a time (PNCH 127, WAVE, PTCH, DISS, RATE free and synced, TONE) | 38-42 µs playing, 37 stopped | 0-41 a second while playing, in every step; none stopped |
| v66d, 22 Nov, 13:11-13:14 | crossfader scene: off, moving, middle, on | 38-39 µs | 0-8 a second |
| v66e, 22 Nov, 13:27-13:33 | free play | 38-59 µs | none in the 53-59 µs stretches, up to 15+ in others |
| v67d (no LCUT), 22 Nov, 21:01 | pattern playing, about 1 minute | 36-37 µs | 0-9 a second |
| v68d (DISS order), 22 Nov, 21:29-21:39 | free play, about 10 minutes | 37-43 µs and 49-60 µs | 0 in 63 % of playing seconds; never with the high means |

The cost does not follow UNGEMACH's settings: with the same settings the mean moved from 58 to 43 µs within a minute, and the stretches with the highest means had no skipped frames. Each sequencer stop showed one second at 44-53 µs. That looks like the base's or stock's own state; it is reported on issue #1790.

**Comparisons on the live-set unit, the same evening, switched in one build** (22 November 2026, each twice):

| Variant | Mean a frame |
| --- | --- |
| as released, with LCUT (three one-poles a side) | 39-41 µs |
| the render loop compiled for speed (`-O2`, helpers inlined) | 51-52 µs |
| without LCUT | 39 µs (LCUT cost about 2 µs) |
| the sixteen voices as six loops / two loops instead of unrolled | 42 / 45 µs |

LCUT was removed for this reason; the code size of the render loop matters more than its instruction count.

**Earlier history** (summarised; the full log is in the pull request): the first full build cost about 76 µs a frame with 55 % of frames skipped in the live set (base `dbdf7e5d`, 19 November). The hits were removed, the slow figures moved to every eighth frame, the voices read at the nearest sample, the filter became a trapezoidal state-variable filter once a step, per-call state moved from BSS to initialised data (BSS is reached slowly), and RATE's timing is read only when needed. A busy-wait test machine (`UG_NULL`, issue #1790) showed that a machine in this set crackles from about 40-45 µs a frame on base 0.7.10.

## CPU price

Measured 24 November 2026 on the author's MKI, OS 1.40C, RAM-booted with a development twin of the beta base (`4c7eb79b`, built with `--dev` from `d0dc7166`), release package `a8bcdca3`, as a trial that was rolled back. A scratch project, bank A: A01 a medium pattern (T1-T7 with trigs on steps 1, 5, 9 and 13, samples on T2 and T3), A02 empty, A03 only T1 with a trig on every step and no sample. UNGEMACH at its Part defaults.

| Reading (`PLAY w2500 guard w6000 guard STOP`, the second line, twice each) | In the frame interrupt | Skipped |
| --- | --- | --- |
| T1 UNGEMACH, A03 | 43.9 %, 43.9 % | 0 |
| T1 UNGEMACH, A02 (no trigs) | 43.6 %, 43.5 % | 0 |
| T1 FLEX, A03 | 29.8 %, 29.8 % | 0 |

**Price: 14.1 points, so 15 %** (`resources.cpuPrice`, `reserved[0]`). UNGEMACH renders while the sequencer runs whether or not its track trigs, so the price is the machine against the same track on FLEX.

**Instance curve** (`device:price --curve T1`, `evidence/frame-cost.json`): installed on no track it added nothing (rest 0). On A03 the first instance raised the longest frame from 63.1 to 77.7 % (first 14.6). On the medium pattern A01 it read 78.7 to 102.2 % (+23.5): past 100 % that is the overload, not the module's cost, so the curve is A03's. Admission: picked on A02 and played there, admitted, longest frame 70.8 %, 0 dropped renders, 0 stalls; played on A01, admitted, longest frame 97.6 %, 0 dropped, 0 stalls. The `cpu` line after the pick showed the base booking the default 12 % (this package named no price yet).

The price tool's trial did not roll back by itself in any of its three runs (it printed "THE TRIAL DID NOT ROLL BACK"); each time `recover` rolled it back and the inventory read empty.

## Qualification

`device:qualify --keeps-ok --seconds 30` on the same twin and scratch project, release package `a8bcdca3`, 24 November 2026 (on Windows through a small wrapper that maps the script's Unix socket to the session's TCP port; the script itself unchanged). **Result: passed, no failures.**

- UNGEMACH alone, playing: on T1 its longest render 39.2 % of a frame, T1-4 core peak 394 per mille, CPU 602 per mille; on T5 its longest render 65.3 %, T5-8 core peak 419, CPU 612. Mean frame interrupt quiet against triggered: T1 42.7 / 43.2 %, T5 45.0 / 45.4 %.
- On T1-T8 at once: T1 ran UNGEMACH, T2-T8 were refused (one track a Part, as intended). CPU 608, core peaks 395 and 483 per mille.
- The six SRC knobs swept while playing; Part switches 12 of 12 ran their own effects within 3 s; a queued pattern change into another bank and back.
- Afterwards the Part reloaded from its saved copy byte for byte, the module was removed and the inventory was empty. No crash or stall recorded.
- Not covered: listening, a power cycle and what survives it, MIDI, scenes and recording, UNGEMACH beside other installed modules.

## Stock flows

Not compared systematically with and without the module. Seen in play with it installed: the machine list shows UNGEMACH as a row beside the stock machines, the other Flex tracks, their locks, LFOs and scenes, PLAY and STOP behaved as usual in the author's live set. Not tested: saving and loading projects and Parts, copying Parts, recording, MIDI, USB audio.

UNGEMACH changes no stock flow. Its SRC SETUP A to D are empty and stay 0, so a track switched back to FLEX finds stock's defaults there.

## OT UI captures

Hardware captures, 24 November 2026: the author's MKI, OS 1.40C, the development twin `4c7eb79b` RAM-booted over USB, package `37d7a278` in a trial, the scratch project with T1 on UNGEMACH at its Part defaults, transport stopped. The LCD was read over USB (`png:`) and scaled 3x without changing pixels.

- `media/ot-machine-list.png`: FUNC + SRC on T1, PLAYBACK SETUP with UNGEMACH selected in the machine list and its SPRD and PNCH knobs.
- `media/ot-src.png`: SRC, the main page with PTCH, DISS, TONE, WAVE, RATE and DIRT.

While the trial ran, the base's `cpu` line booked 15 % for the track, the package's price. When the trial ended with T1 set back to FLEX, the base refused the rollback with "needs-recovery"; a power cycle returns the unit to its flashed base, and nothing was kept.
Loading
Loading