From 739f08ec5307f6ad535645c810ad1cf60d5a7380 Mon Sep 17 00:00:00 2001 From: repeat98 Date: Sun, 22 Nov 2026 09:09:25 +0100 Subject: [PATCH 1/4] SYNTIZ 0.1.1-experimental: cheaper on the ColdFire while it plays The same samples as 0.1.0, bit for bit, with less work a frame: what depends only on the controls and the pitch is worked out when a track's bytes change, each oscillator runs its own short loop into the packer's longs, then one loop for the output stage. Co-Authored-By: Claude Opus 5.5 --- ...erimental.mwrm => 0.1.1-experimental.mwrm} | Bin 54416 -> 46944 bytes sdk/catalog.json | 2 +- sdk/octatrack/modules/syntiz/README.md | 12 +- sdk/octatrack/modules/syntiz/TESTING.md | 82 ++++ sdk/octatrack/modules/syntiz/engine.c | 394 ++++++++++-------- sdk/octatrack/modules/syntiz/engine.h | 19 +- sdk/octatrack/modules/syntiz/machine.c | 29 +- .../modules/syntiz/octamod.module.json | 133 +----- .../modules/syntiz/tools/cf_probe.cpp | 72 ++++ .../modules/syntiz/tools/cf_probe.py | 194 +++++++++ .../modules/syntiz/tools/render_matrix.c | 53 +++ src/catalog/module-documents.json | 133 +----- src/community/module-changelogs/syntiz.json | 8 + .../assets/octatrack-module-packages.json | 8 +- 14 files changed, 709 insertions(+), 430 deletions(-) rename public/octatrack-modules/syntiz/{0.1.0-experimental.mwrm => 0.1.1-experimental.mwrm} (64%) create mode 100644 sdk/octatrack/modules/syntiz/tools/cf_probe.cpp create mode 100644 sdk/octatrack/modules/syntiz/tools/cf_probe.py create mode 100644 sdk/octatrack/modules/syntiz/tools/render_matrix.c diff --git a/public/octatrack-modules/syntiz/0.1.0-experimental.mwrm b/public/octatrack-modules/syntiz/0.1.1-experimental.mwrm similarity index 64% rename from public/octatrack-modules/syntiz/0.1.0-experimental.mwrm rename to public/octatrack-modules/syntiz/0.1.1-experimental.mwrm index bc4c49f6d9170ac638222e2a3a5e61e5fd050995..bbdf2052e17fdfc165d03b9b7d9f82dea9b0ca95 100644 GIT binary patch delta 10477 zcmbVy4OCNSy6(G^5J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/catalog.json @@ -184,7 +184,7 @@ }, { "id": "syntiz", - "version": "0.1.0-experimental", + "version": "0.1.1-experimental", "addedAt": "2026-10-29T21:00:00Z" }, { diff --git a/sdk/octatrack/modules/syntiz/README.md b/sdk/octatrack/modules/syntiz/README.md index 3d29b6868a..21368eb0db 100644 --- a/sdk/octatrack/modules/syntiz/README.md +++ b/sdk/octatrack/modules/syntiz/README.md @@ -1,6 +1,6 @@ # SYNTIZ -Version: `0.1.0-experimental` · author: @stigmagit · beta, over USB only: it is a track machine of the Modwerk base's +Version: `0.1.1-experimental` · author: @stigmagit · beta, over USB only: it is a track machine of the Modwerk base's machine chooser (`ot_machines`, [HOOKS.md](../../../machines/octatrack/HOOKS.md)). ## Overview @@ -106,13 +106,17 @@ you from the machine list to a first note; the models follow it. - **Host**: 5,376 extreme renders of the six models under UBSan/ASan with no report; levels, DC and aliasing; the pitch within 1.5 cents of stock's curve; every knob byte reaching its control; MORPH at MIX 0 and 127 equal to TABLE, sample for sample. `verify.py` runs them and rebuilds the package byte for byte. -- **ColdFire, under qemu**: instruction counts for a 16-sample frame, defaults / heavy, from 1,931 / 4,044 (SAW) to - 3,274 / 6,372 (ENS). Counts, not time on the unit. +- **0.1.1 against 0.1.0**: the same samples, bit for bit, on the host (5.8 million samples under the sanitizers) and + through the machine glue on an emulated ColdFire (300 random two-track scenarios). There a playing track at C3 takes + 1,773 instructions a frame instead of 2,436 at the defaults (SAW), and 205 memory operands instead of 492; the + dearest, a heavy ENS, 5,943 instead of 6,854. Counts, not time on the unit: 0.1.1 has not run on a unit yet. +- **ColdFire, under qemu** (0.1.0): instruction counts for a 16-sample frame, defaults / heavy, from 1,931 / 4,044 + (SAW) to 3,274 / 6,372 (ENS). - **Emulator**: the chooser, the six pages, the model list, LEFT and RIGHT, sequenced notes for every model, and SYNTIZ installed beside POLY8, Analog BD, VECTOR and FM Synth on the last chooser row. - **The author's MKIIs**, 28 October to 7 November 2026, on private bases that know SYNTIZ: the six models over USB, reported as working well by the author and a friend who played it; projects saved with SYNTIZ tracks came back - whole after power cycles. This package (`f501a6a4`) has been on his MKII since 31 October: a fourth SYNTIZ track + whole after power cycles. The 0.1.0 package (`f501a6a4`) has been on his MKII since 31 October: a fourth SYNTIZ track is refused, and on 7 November the base's frame guard measured his live set (two SYNTIZ tracks with filter and chorus, a THRU, three samples, a NEIGHBOR with flanger, a master compressor) at 74 % of each frame against 36 % without SYNTIZ, about two renders a second dropped and nothing heard; with two samples, 69 % and none dropped. diff --git a/sdk/octatrack/modules/syntiz/TESTING.md b/sdk/octatrack/modules/syntiz/TESTING.md index dc947c3d66..33cdbbb346 100644 --- a/sdk/octatrack/modules/syntiz/TESTING.md +++ b/sdk/octatrack/modules/syntiz/TESTING.md @@ -277,6 +277,84 @@ Package `f501a6a4`, by the release session for the owner, on his MKII with 19 ot Undo of 9 November above. - Not heard: the twin's `off` layout has no USB audio. Not tested: the MKI, a MIDI flood, an LFO on a SYNTIZ control. +## 0.1.1: the same samples for less work a frame (22 November 2026) + +Why: on the owner's MKII (OS 1.40C, a development twin of base 0.7.14, `b36f9c53e`, project Dev17 pattern C01 at +126 BPM, trigs on steps 1, 5, 9 and 13 of T1-T8, a big set installed), the frame interrupt took 50.7 % of each frame with +every track STATIC and 65.2 % with T2 a SYNTIZ 0.1.0 track: +14.5 points, the CPU meter +11, 24 renders dropped in 8 s. +That is the owner's session's measurement, not repeated here. The 0.1.0 record above already found about 2.5 cycles an +instruction warm and up to 8.8 cold, so the memory operands and the code a frame fetches weigh as much as the instruction +count. + +What changed, with no change to the samples: + +- What depends only on the controls and the pitch (increments, detunes, chord ratios, gains, crushes, the subs' fade-in, + MORPH's crossfade step, and the divides among them) is worked out when one of the track's bytes changes (`wave_prepare`), + not every frame. `machine.c` keys it on the model, PTCH, SRC B-F and SETUP A-F; a lock, an LFO or a scene that moves + a byte works it out again for that frame. The controls struct is no longer rebuilt every frame either. +- A block runs one short loop per oscillator (the saw, each detuned pair, each chord note, the subs) summing into the + packer's L longs, then one loop for the output stage, so each loop's state stays in registers. 0.1.0 ran every + oscillator and the output stage in one loop, which spilled to the stack every sample. +- The output stage writes the packer's L and R longs itself (the glue's copy loop is gone), silent subs only move their + phases on, and the saw's test for its fall is one compare instead of two (`p + inc < 2 inc`, exact for the audible + increments that reach it). +- `engine.h`: `wave_prepare` and `wave_play` beside `wave_render`, which the host tests still call. A block is at most + 16 samples, a frame: the header said 64, and nothing calls it with more. + +The same samples, checked three ways: + +- **Host**, `python3 -B tools/cf_probe.py host origin/main`: `tools/render_matrix.c` (every model with every control at + 0, 1, 63, 64, 65, 126 and 127 over every third note in blocks of 1 to 16, then 3,000 random walks of 200 blocks that + move controls, models and the pitch, with trigs) renders 5,845,711 samples, identical to 0.1.0's engine. Both builds ran + under UBSan and ASan with no report. +- **ColdFire**, `python3 -B tools/cf_probe.py compare origin/main`: both versions' three objects, compiled and linked + as `build.py` does, run on upstream ot_emu's V4e core through `wave_render_track`, against a synthetic stock + environment (Part signature, parameter record, live lane, event bytes, a 2^(x/12) curve built as `test_machine_map.c` + builds it, no stock byte). 300 random scenarios of 600 frames each, two tracks, with model changes, moving knobs and + PTCH, SETUP bytes out of range, trigs with RTRG on and off, and frames split at every offset: 2,880,000 samples, + identical, the callee-saved registers and the cursor as before. +- `verify.py`: the host checks pass, and the package rebuilds byte for byte. + +Not covered: the emulator times nothing and models no cache, DMA or bus, so the counts below are not the unit's time. +The synthetic curve is not stock's (both versions read the same one; the pitch against stock's curve is +`test_machine_map.c`'s). Not run: the MKI, a mute module. + +Counts, `python3 -B tools/cf_probe.py count` for this tree and `count origin/main` for 0.1.0: one track at C3 (PTCH 64), +the mean of 63 frames after the first, each frame a `[0,0)` and a `[0,16)` call as a frame without a trig is. Code bytes +are the 16-byte lines executed in a frame. The allowance weighs each executed instruction with Grain's zero-wait +allowances (`grain/evidence/timing/bound.py`: 4 a register instruction, 12 with a memory operand, 16 a multiply, 48 a +divide): a yardstick, not cycles. Heavy settings are `bench_cf.c`'s. + +| Model | Settings | Instructions | Memory operands | Code bytes | Allowance | +| --- | --- | --- | --- | --- | --- | +| SAW | defaults | 2,436 → 1,773 | 492 → 205 | 2,208 → 1,312 | 18,431 → 12,400 | +| SAW | heavy | 4,717 → 3,779 | 1,100 → 428 | 3,504 → 2,544 | 34,690 → 25,039 | +| PULSE | defaults | 3,125 → 2,268 | 671 → 219 | 2,624 → 1,696 | 22,750 → 14,612 | +| PULSE | heavy | 4,966 → 3,952 | 1,149 → 505 | 3,744 → 3,024 | 35,966 → 25,732 | +| ENS | defaults | 3,659 → 2,995 | 964 → 462 | 2,768 → 1,952 | 28,835 → 20,960 | +| ENS | heavy | 6,854 → 5,943 | 1,456 → 710 | 3,632 → 2,832 | 49,947 → 39,077 | +| TABLE | defaults | 2,629 → 1,967 | 647 → 268 | 2,160 → 1,376 | 20,514 → 13,983 | +| TABLE | heavy | 3,816 → 3,193 | 755 → 384 | 2,784 → 2,112 | 27,667 → 21,554 | +| MORPH | defaults | 2,659 → 2,106 | 563 → 350 | 2,064 → 1,456 | 19,987 → 15,064 | +| MORPH | heavy | 3,685 → 3,509 | 831 → 711 | 2,528 → 2,848 | 27,800 → 26,289 | +| CHOIR | defaults | 3,761 → 2,872 | 1,042 → 462 | 2,800 → 1,904 | 29,630 → 20,333 | +| CHOIR | heavy | 5,550 → 4,610 | 1,454 → 707 | 3,456 → 2,560 | 42,528 → 32,066 | + +MORPH heavy changes WAV1 every frame, so it works the controls out every frame, and runs more code than 0.1.0. A lock +or an LFO on a SYNTIZ knob does the same, once a frame while it moves. What is left is mostly the output stage (the +emphasis, the curve's antiderivative, a divide a sample from about C3 up, the DC blocker): 1,305 of SAW's 1,773, about +82 instructions a sample. A hand count of the same steps in ColdFire assembly came to about as many, so assembly would +not shorten it, and the divide is what keeps the samples bit-exact. + +The package `c3a97ecc` (`public/octatrack-modules/syntiz/0.1.1-experimental.mwrm`, 46,944 bytes) holds 46,008 bytes +of code and data and 20,644 of bss, against 0.1.0's 53,500 and 19,804: the engine's code fell from about 16 KB to +8,360 bytes, and each track now keeps its controls and what was worked out from them. + +**Not tested on a unit.** To compare it with the 0.1.0 measurement above: the same twin, set and pattern, T2 SYNTIZ at +its defaults (SAW, PTCH 64), the frame interrupt's share and the guard's skips over 8 s against 65.2 % and 24; then +T2 with a heavy SAW (DET 40, UNI 127, WIDE 90, SUB and SUB2 90) and a heavy ENS (three chord notes, SHAP 32, CHOR 100, +both subs 90). A null test against 0.1.0 by ear or recording needs both to start their oscillators at the same frame. + ## Qualification record `evidence/performance.json` carries the 7 November figures as the audit asks (`npm run perf:audit -- check`): the @@ -289,3 +367,7 @@ pull request is in order. The waiver covers rows with no numbers, so the load an measurements stay in their `method` text and here. The manifest's `tests.qualification` records one render as the event (at most three a frame; their worst sum exceeds the frame and is left to the base's guard), the exact package memory, and the functional hardware report. + +0.1.1 has no `tests.qualification` and no approval yet: 0.1.0's covered package `f501a6a4` only, so the manifest drops +it, marks the hardware untested and names the new package's static memory. `evidence/performance.json` still holds +0.1.0's run until `c3a97ecc` is measured on a unit. diff --git a/sdk/octatrack/modules/syntiz/engine.c b/sdk/octatrack/modules/syntiz/engine.c index 22986c168f..c2c2818ca2 100644 --- a/sdk/octatrack/modules/syntiz/engine.c +++ b/sdk/octatrack/modules/syntiz/engine.c @@ -1,8 +1,9 @@ /* SPDX-License-Identifier: MIT * SYNTIZ's oscillators (engine.h). Band-limited saws by polyBLEP; a pulse is the difference of two * saws a width apart, a square sub the same at half width; the sines are a corrected parabola, so - * no table is needed. Controls become increments and gains once per block; the per-sample loop - * only adds, shifts and multiplies values below 2^16. */ + * no table is needed. Controls become increments and gains when they change (wave_prepare); a block runs one + * short loop per oscillator, then one for the output stage, so each keeps its state in registers. The per-sample + * loops only add, shift and multiply values below 2^16. */ #include "engine.h" #include "tables.h" @@ -50,19 +51,22 @@ void wave_note(Wave *w, const WaveControls *c) } /* One saw sample at phase p, rising from -32768 to 32767 and falling at the wrap, with the polyBLEP - * residual over the sample on each side of the fall. inc >> 15 is at least 1 (wave_render). The + * residual over the sample on each side of the fall. inc >> 15 is at least 1 and inc below 2^31 (only an + * audible increment reaches it), so p + inc < 2 inc says in one compare that p < inc or p > ~inc. The * divide runs on two samples a period only. */ static inline int32_t saw(uint32_t p, uint32_t inc) { int32_t s = (int32_t)(p ^ 0x80000000u) >> 16; - if (p < inc) { - uint32_t u = p / (inc >> 15); - int32_t t = u > 32767u ? 32767 : (int32_t)u; /* inc >> 15 rounds down: very low notes overshoot */ - s -= 2 * t - ((t * t) >> 15) - 32768; - } else if (p > ~inc) { - uint32_t u = ~p / (inc >> 15); - int32_t t = u > 32767u ? 32767 : (int32_t)u; - s -= ((t * t) >> 15) - 2 * t + 32768; + if (p + inc < 2u * inc) { + if (p < inc) { + uint32_t u = p / (inc >> 15); + int32_t t = u > 32767u ? 32767 : (int32_t)u; /* inc >> 15 rounds down: very low notes overshoot */ + s -= 2 * t - ((t * t) >> 15) - 32768; + } else { + uint32_t u = ~p / (inc >> 15); + int32_t t = u > 32767u ? 32767 : (int32_t)u; + s -= ((t * t) >> 15) - 2 * t + 32768; + } } return s; } @@ -110,42 +114,33 @@ static inline int32_t antiderivative(int32_t x) int32_t x2 = (ax * ax) >> 13; return ((ax * ax) >> 3) - (int32_t)((((uint32_t)(x2 * x2) >> 10) * 9709u) >> 10); /* x^4 / 108 in Q26 */ } -/* The output stage's state, copied in for a block so it can live in registers. */ -typedef struct { int32_t sx, sf, dcx, dcy, ex; } Out; -static inline Out out_load(const Wave *w) { Out o = { w->sx, w->sf, w->dcx, w->dcy, w->ex }; return o; } -static inline void out_store(Wave *w, const Out *o) -{ - w->sx = o->sx, w->sf = o->sf, w->dcx = o->dcx, w->dcy = o->dcy, w->ex = o->ex; -} -/* The mean over a sample is a gentle low-pass (-2.4 dB at 10 kHz, -5.8 dB at 15 kHz on a clean signal). - * A first-order emphasis before the curve, x + 0.3 (x - x[-1]), gives that treble back (within 0.2 dB - * to 10 kHz) and the curve still bounds the peaks (the author's choice B2, 27 Oct 2026). */ -static inline int32_t shape(Out *o, int32_t x) +/* The output stage over a block, in place: lr[2 k] holds the sum, then lr[2 k] and lr[2 k + 1] the sample. The mean + * over a sample is a gentle low-pass (-2.4 dB at 10 kHz, -5.8 dB at 15 kHz on a clean signal). A first-order emphasis + * before the curve, x + 0.3 (x - x[-1]), gives that treble back (within 0.2 dB to 10 kHz) and the curve still bounds + * the peaks (the author's choice B2, 27 Oct 2026). */ +static __attribute__((noinline)) void finish(Wave *w, uint32_t *lr, unsigned n) { - if (x > 131071) x = 131071; else if (x < -131071) x = -131071; - int32_t x13 = x >> 2; - int32_t e = x13 + (((x13 - o->ex) * 9830) >> 15); - o->ex = x13, x13 = e > 40000 ? 40000 : e < -40000 ? -40000 : e; - int32_t f = antiderivative(x13), d = x13 - o->sx, y; - if (d > 16 || d < -16) y = ((f - o->sf) * 8 / d) * 2; /* Q27 / Q13 = Q14 */ - else y = cubic(((x13 + o->sx) / 2) * 4); /* too close to divide: the curve at the midpoint */ - o->sx = x13, o->sf = f; - return y; -} - -static inline int16_t finish(Out *o, int32_t acc, int32_t g) -{ - int32_t x = shape(o, ((acc >> 2) * (g >> 4)) >> 9); - o->dcy += (x - o->dcx) * 256 - (o->dcy >> 10), o->dcx = x; - x = o->dcy >> 8; - return (int16_t)(x > 32767 ? 32767 : x < -32768 ? -32768 : x); + int32_t g4 = w->g4, sx = w->sx, sf = w->sf, ex = w->ex, dcx = w->dcx, dcy = w->dcy; + for (unsigned k = 0; k < n; ++k) { + int32_t x = (((int32_t)lr[2 * k] >> 2) * g4) >> 9; + if (x > 131071) x = 131071; else if (x < -131071) x = -131071; + int32_t x13 = x >> 2; + int32_t e = x13 + (((x13 - ex) * 9830) >> 15); + ex = x13, x13 = e > 40000 ? 40000 : e < -40000 ? -40000 : e; + int32_t f = antiderivative(x13), d = x13 - sx, y; + if (d > 16 || d < -16) y = ((f - sf) * 8 / d) * 2; /* Q27 / Q13 = Q14 */ + else y = cubic(((x13 + sx) / 2) * 4); /* too close to divide: the curve at the midpoint */ + sx = x13, sf = f; + dcy += (y - dcx) * 256 - (dcy >> 10), dcx = y; + y = dcy >> 8; + lr[2 * k] = lr[2 * k + 1] = (uint32_t)(uint16_t)(y > 32767 ? 32767 : y < -32768 ? -32768 : y) << 16; + } + w->sx = sx, w->sf = sf, w->ex = ex, w->dcx = dcx, w->dcy = dcy; } -/* The subs, shared by every model: a square an octave down (two saws half a turn apart) and a sine - * two octaves down. */ -typedef struct { uint32_t i1, i2; int32_t g1, g2; } Subs; -/* A sub below 25 Hz is not heard and only spends headroom (the author, 27 Oct 2026): silent there, fading in - * up to 30 Hz so a glide or an LFO crossing it does not click. */ +/* The subs, shared by every model but MORPH: a square an octave down (two saws half a turn apart) and a sine + * two octaves down. A sub below 25 Hz is not heard and only spends headroom (the author, 27 Oct 2026): silent + * there, fading in up to 30 Hz so a glide or an LFO crossing it does not click. */ #define SUB_LO 2434789u /* 25 Hz */ #define SUB_HI 2921746u /* 30 Hz */ static int32_t heard(int32_t g, uint32_t i) @@ -154,45 +149,62 @@ static int32_t heard(int32_t g, uint32_t i) if (i <= SUB_LO) return 0; return (int32_t)((uint32_t)g * ((i - SUB_LO) >> 5) / ((SUB_HI - SUB_LO) >> 5)); } -static Subs subs_of(const WaveControls *c, uint32_t inc) +static void subs_of(Wave *w, const WaveControls *c, uint32_t inc) { - Subs s = { inc >> 1, inc >> 2, 0, 0 }; - s.g1 = heard(c->sub * 258, s.i1), s.g2 = heard(c->sub2 * 258, s.i2); - return s; + w->si1 = inc >> 1, w->si2 = inc >> 2; + w->sg1 = heard(c->sub * 258, w->si1), w->sg2 = heard(c->sub2 * 258, w->si2); } -static inline int32_t subs_tick(uint32_t q[2], const Subs *s) /* q: the block's copies of sub, sub2 */ +/* The oscillators' passes sum into acc[2 k], the L long of each sample (wave_play). The subs add theirs; a silent + * one only moves its phase on. */ +static __attribute__((noinline)) void subs_add(Wave *w, int32_t *acc, unsigned n) { - int32_t a = 0; - if (s->g1) a += (s->g1 * ((saw(q[0], s->i1) - saw(q[0] + 0x80000000u, s->i1)) >> 1)) >> 15; - if (s->g2) a += (s->g2 * sine(q[1])) >> 15; - q[0] += s->i1, q[1] += s->i2; - return a; + uint32_t q = w->sub, i = w->si1; + int32_t g = w->sg1; + if (g) for (unsigned k = 0; k < n; ++k, q += i) acc[2 * k] += (g * ((saw(q, i) - saw(q + 0x80000000u, i)) >> 1)) >> 15; + else q += i * n; + w->sub = q; + q = w->sub2, i = w->si2, g = w->sg2; + if (g) for (unsigned k = 0; k < n; ++k, q += i) acc[2 * k] += (g * sine(q)) >> 15; + else q += i * n; + w->sub2 = q; +} +static inline void subs(Wave *w, int32_t *acc, unsigned n) +{ + if (w->sg1 | w->sg2) subs_add(w, acc, n); + else w->sub += w->si1 * n, w->sub2 += w->si2 * n; } /* The unison pairs' detune: a frequency ratio 1 +/- d, d = 0.0595 (a semitone) at 127, quadratic. */ static inline uint32_t detune_q16(unsigned det) { return (det * det * 3962u) >> 14; } -static void render_saw(Wave *w, const WaveControls *c, uint32_t inc, int16_t *out, unsigned n) +static void prepare_saw(Wave *w, const WaveControls *c, uint32_t inc) { uint32_t d = detune_q16(c->det), di = scale(inc, d), dw = scale(inc, 2u * d); - uint32_t i1 = inc + di, i2 = inc - di, i3 = inc + dw, i4 = inc - dw; - int32_t gu = c->uni * 181, gw = c->wide * 181; /* 0.7 each at 127 */ - if (!audible(i1) || !audible(i2)) gu = 0; - if (!audible(i3) || !audible(i4)) gw = 0; - Subs s = subs_of(c, inc); - int32_t g = gain_of(c->drive); - uint32_t p0 = w->ph[0], p1 = w->ph[1], p2 = w->ph[2], p3 = w->ph[3], p4 = w->ph[4], q[2] = { w->sub, w->sub2 }; - Out o = out_load(w); - for (unsigned k = 0; k < n; ++k) { - int32_t acc = saw(p0, inc); - p0 += inc; - if (gu) acc += (gu * ((saw(p1, i1) + saw(p2, i2)) >> 1)) >> 14, p1 += i1, p2 += i2; - if (gw) acc += (gw * ((saw(p3, i3) + saw(p4, i4)) >> 1)) >> 14, p3 += i3, p4 += i4; - acc += subs_tick(q, &s); - out[k] = finish(&o, acc, g); - } - w->ph[0] = p0, w->ph[1] = p1, w->ph[2] = p2, w->ph[3] = p3, w->ph[4] = p4, w->sub = q[0], w->sub2 = q[1]; - out_store(w, &o); + w->i[0] = inc + di, w->i[1] = inc - di, w->i[2] = inc + dw, w->i[3] = inc - dw; + w->ga = c->uni * 181, w->gb = c->wide * 181; /* 0.7 each at 127 */ + if (!audible(w->i[0]) || !audible(w->i[1])) w->ga = 0; + if (!audible(w->i[2]) || !audible(w->i[3])) w->gb = 0; +} +/* A saw a block: acc[2 k] set from phase *ph. */ +static __attribute__((noinline)) void saw_set(int32_t *acc, uint32_t *ph, uint32_t inc, unsigned n) +{ + uint32_t p = *ph; + for (unsigned k = 0; k < n; ++k, p += inc) acc[2 * k] = saw(p, inc); + *ph = p; +} +/* A detuned pair, ph[0] at ia and ph[1] at ib, added at gain g. */ +static __attribute__((noinline)) void saw_pair(int32_t *acc, uint32_t *ph, uint32_t ia, uint32_t ib, int32_t g, unsigned n) +{ + uint32_t pa = ph[0], pb = ph[1]; + for (unsigned k = 0; k < n; ++k, pa += ia, pb += ib) acc[2 * k] += (g * ((saw(pa, ia) + saw(pb, ib)) >> 1)) >> 14; + ph[0] = pa, ph[1] = pb; +} +static void play_saw(Wave *w, int32_t *acc, unsigned n) +{ + saw_set(acc, &w->ph[0], w->inc, n); + if (w->ga) saw_pair(acc, &w->ph[1], w->i[0], w->i[1], w->ga, n); + if (w->gb) saw_pair(acc, &w->ph[3], w->i[2], w->i[3], w->gb, n); + subs(w, acc, n); } /* PULSE's width as a turn: PW 64 is a square, 0 and 127 a 3 % pulse; PWM sweeps a triangle of @@ -206,127 +218,138 @@ static uint32_t width(Wave *w, const WaveControls *c, unsigned n) return (uint32_t)q << 17; } -static void render_pulse(Wave *w, const WaveControls *c, uint32_t inc, int16_t *out, unsigned n) -{ - uint32_t d = detune_q16(c->det) >> 1, di = scale(inc, d), wd = width(w, c, n); - uint32_t i1 = inc + di, i2 = inc - di; - int32_t gu = c->uni * 181; - if (!audible(i1) || !audible(i2)) gu = 0; - Subs s = subs_of(c, inc); - int32_t g = gain_of(c->drive); - uint32_t p0 = w->ph[0], p1 = w->ph[1], p2 = w->ph[2], q[2] = { w->sub, w->sub2 }; - Out o = out_load(w); - for (unsigned k = 0; k < n; ++k) { - int32_t acc = (saw(p0, inc) - saw(p0 + wd, inc)) >> 1; - p0 += inc; - if (gu) acc += (gu * ((saw(p1, i1) - saw(p1 + wd, i1) + saw(p2, i2) - saw(p2 + wd, i2)) >> 2)) >> 14, - p1 += i1, p2 += i2; - acc += subs_tick(q, &s); - out[k] = finish(&o, acc, g); +static void prepare_pulse(Wave *w, const WaveControls *c, uint32_t inc) +{ + uint32_t d = detune_q16(c->det) >> 1, di = scale(inc, d); + w->i[0] = inc + di, w->i[1] = inc - di; + w->ga = c->uni * 181; + if (!audible(w->i[0]) || !audible(w->i[1])) w->ga = 0; +} +static void play_pulse(Wave *w, const WaveControls *c, int32_t *acc, unsigned n) +{ + uint32_t wd = width(w, c, n), inc = w->inc, p = w->ph[0]; + for (unsigned k = 0; k < n; ++k, p += inc) acc[2 * k] = (saw(p, inc) - saw(p + wd, inc)) >> 1; + w->ph[0] = p; + if (w->ga) { + uint32_t pa = w->ph[1], pb = w->ph[2], ia = w->i[0], ib = w->i[1]; + int32_t g = w->ga; + for (unsigned k = 0; k < n; ++k, pa += ia, pb += ib) + acc[2 * k] += (g * ((saw(pa, ia) - saw(pa + wd, ia) + saw(pb, ib) - saw(pb + wd, ib)) >> 2)) >> 14; + w->ph[1] = pa, w->ph[2] = pb; } - w->ph[0] = p0, w->ph[1] = p1, w->ph[2] = p2, w->sub = q[0], w->sub2 = q[1]; - out_store(w, &o); + subs(w, acc, n); } /* ENS: up to four notes of one shape (a saw at 0, a square at 64, a 5 % pulse at 127: the second * saw fades in, then moves), then a dry voice and two taps of a delay swept in quadrature by a * 0.2 Hz sine, 11 ms +/- 7.7 ms (about 17 cents of drift at the sweep's fastest). - * CHOIR: the same with one of TABLE's cycles (tab) for the shape, read as TABLE reads it. */ -static inline __attribute__((always_inline)) void ensemble(Wave *w, const WaveControls *c, uint32_t inc, - int16_t *out, unsigned n, const int16_t *tab) + * CHOIR: the same with one of TABLE's cycles for the shape, read as TABLE reads it. */ +static void prepare_ens(Wave *w, const WaveControls *c, uint32_t inc, unsigned table) { - uint32_t i[4] = { inc }, off; unsigned voices = 1; + unsigned voices = 1; + w->i[0] = inc; for (unsigned k = 0; k < 3u; ++k) { int s = (int)c->note[k] - 64; if (!s) continue; if (s < -24) s = -24; else if (s > 24) s = 24; uint32_t x = scale(inc, wave_ratio[s + 24]); - if (audible(x)) i[voices++] = x; + if (audible(x)) w->i[voices++] = x; } - int32_t kb = tab ? 0 : c->pw < 64u ? c->pw * 512 : 32767; - off = c->pw < 64u ? 0x80000000u : 0x80000000u - (uint32_t)(c->pw - 64u) * 30678337u; + int32_t kb = table ? 0 : c->pw < 64u ? c->pw * 512 : 32767; + w->off = c->pw < 64u ? 0x80000000u : 0x80000000u - (uint32_t)(c->pw - 64u) * 30678337u; int32_t gv = voices > 1u ? 22938 : 32767; /* 0.7 a note in a chord */ - int32_t gn = (int32_t)(((uint32_t)gv << 15) / (32768u + (uint32_t)kb)); /* a note's peak is 1 + kb */ - Subs s = subs_of(c, inc); - int32_t g = gain_of(c->drive); + w->ga = (int32_t)(((uint32_t)gv << 15) / (32768u + (uint32_t)kb)); /* a note's peak is 1 + kb */ + w->gb = kb, w->voices = (uint8_t)voices; + w->gd = 32767 - c->chor * 103, w->gt = c->chor * 90; /* at 127: 0.6 dry, 0.35 a tap */ +} +/* One note of ENS added to acc[2 k]: a saw, less kb of a second one off a turn behind. */ +static __attribute__((noinline)) void ens_note(int32_t *acc, uint32_t *ph, uint32_t i, int32_t gn, int32_t kb, uint32_t off, + unsigned n) +{ + uint32_t p = *ph; + for (unsigned k = 0; k < n; ++k, p += i) { + int32_t a = saw(p, i); + if (kb) a -= (kb * saw(p + off, i)) >> 15; + acc[2 * k] += (gn * (a >> 1)) >> 14; + } + *ph = p; +} +/* One note of CHOIR: its cycle, read as TABLE reads it. */ +static __attribute__((noinline)) void choir_note(int32_t *acc, uint32_t *ph, uint32_t i, int32_t gn, const int16_t *tab, + unsigned n) +{ + uint32_t p = *ph; + for (unsigned k = 0; k < n; ++k, p += i) acc[2 * k] += (gn * ((tab[p >> 23] * 16) >> 1)) >> 14; + *ph = p; +} +static void play_ens(Wave *w, const WaveControls *c, int32_t *acc, unsigned n) +{ + const int16_t *tab = c->model == WAVE_CHOIR ? wave_tables[c->table >> 2] : 0; + for (unsigned k = 0; k < n; ++k) acc[2 * k] = 0; + for (unsigned v = 0; v < w->voices; ++v) + if (tab) choir_note(acc, &w->ph[v], w->i[v], w->ga, tab, n); + else ens_note(acc, &w->ph[v], w->i[v], w->ga, w->gb, w->off, n); + subs(w, acc, n); +} +/* The dry voice lr[0..2n) through the chorus, in place. The taps are at least 145 samples back, so they read no sample + * of this block. */ +static __attribute__((noinline)) void chorus(Wave *w, uint32_t *lr, unsigned n) +{ /* The taps, held for the block: Q8 samples. */ int32_t sa = sine(w->lfo), sb = sine(w->lfo + 0x40000000u); uint32_t t1 = (uint32_t)(485 * 256 + ((340 * 256 / 2) * sa >> 14)); uint32_t t2 = (uint32_t)(485 * 256 + ((340 * 256 / 2) * sb >> 14)); w->lfo += 19478u * n; /* 0.2 Hz */ - int32_t gd = 32767 - c->chor * 103, gt = c->chor * 90; /* at 127: 0.6 dry, 0.35 a tap */ - uint32_t f1 = t1 & 255u, f2 = t2 & 255u, m = WAVE_DELAY - 1u, d1 = t1 >> 8, d2 = t2 >> 8; - uint32_t p[4] = { w->ph[0], w->ph[1], w->ph[2], w->ph[3] }, q[2] = { w->sub, w->sub2 }, at = w->write; + int32_t gd = w->gd, gt = w->gt; + uint32_t f1 = t1 & 255u, f2 = t2 & 255u, m = WAVE_DELAY - 1u, d1 = t1 >> 8, d2 = t2 >> 8, at = w->write; int16_t *line = w->line; - Out o = out_load(w); - for (unsigned k = 0; k < n; ++k) { - int32_t acc = 0; - for (unsigned v = 0; v < voices; ++v) { - int32_t a; - if (tab) a = tab[p[v] >> 23] * 16; - else { - a = saw(p[v], i[v]); - if (kb) a -= (kb * saw(p[v] + off, i[v])) >> 15; - } - acc += (gn * (a >> 1)) >> 14; - p[v] += i[v]; - } - acc += subs_tick(q, &s); - int32_t dry = finish(&o, acc, g); + for (unsigned k = 0; k < n; ++k, ++at) { + int32_t dry = (int32_t)lr[2 * k] >> 16; line[at & m] = (int16_t)dry; uint32_t r1 = at - d1, r2 = at - d2; int32_t a1 = line[r1 & m], b1 = line[(r1 - 1u) & m]; int32_t a2 = line[r2 & m], b2 = line[(r2 - 1u) & m]; int32_t wet = a1 + (((b1 - a1) * (int32_t)f1) >> 8) + a2 + (((b2 - a2) * (int32_t)f2) >> 8); int32_t y = ((gd * dry) >> 15) + ((gt * wet) >> 15); /* each product below 2^31, not their sum */ - out[k] = (int16_t)(y > 32767 ? 32767 : y < -32768 ? -32768 : y); - ++at; + lr[2 * k] = lr[2 * k + 1] = (uint32_t)(uint16_t)(y > 32767 ? 32767 : y < -32768 ? -32768 : y) << 16; } - for (unsigned v = 0; v < 4u; ++v) w->ph[v] = p[v]; - w->sub = q[0], w->sub2 = q[1], w->write = at; - out_store(w, &o); -} -static void render_ens(Wave *w, const WaveControls *c, uint32_t inc, int16_t *out, unsigned n) -{ - ensemble(w, c, inc, out, n, 0); -} -static void render_choir(Wave *w, const WaveControls *c, uint32_t inc, int16_t *out, unsigned n) -{ - ensemble(w, c, inc, out, n, wave_tables[c->table >> 2]); + w->write = at; } /* TABLE: one of 32 single cycles of 512 points and 12 bits (tables.h), read without interpolation or * band-limiting, so that high notes fold back as the original's do: that grain is the model's character. * MORF crossfades toward the next table (MSWP sweeps it with a triangle instead). SYNC replaces the * cycle by one running at 1 to 8 times the note and restarted at each of the note's periods (hard sync). */ -static void render_table(Wave *w, const WaveControls *c, uint32_t inc, int16_t *out, unsigned n) +static void prepare_table(Wave *w, const WaveControls *c, uint32_t inc) +{ + w->ga = c->morph * 258; + uint32_t si = c->sync ? scale(inc, 65536u + (uint32_t)c->sync * c->sync * 28u) : inc; /* 1x to 7.9x */ + w->i[0] = audible(si) ? si : inc; +} +static void play_table(Wave *w, const WaveControls *c, int32_t *acc, unsigned n) { unsigned t = c->table >> 2; const int16_t *ta = wave_tables[t], *tb = wave_tables[(t + 1u) & (WAVE_TABLES - 1u)]; - int32_t m; + int32_t m = w->ga; if (c->msweep) { int32_t x = (int32_t)w->sweep >> 15; m = x < 0 ? -x : x; /* 0..65536: a triangle */ m = m > 32767 ? 32767 : m; w->sweep += c->msweep * 3896u * n; - } else m = c->morph * 258; - uint32_t si = c->sync ? scale(inc, 65536u + (uint32_t)c->sync * c->sync * 28u) : inc; /* 1x to 7.9x */ - if (!audible(si)) si = inc; - Subs s = subs_of(c, inc); - int32_t g = gain_of(c->drive); - uint32_t pm = w->ph[0], ps = w->ph[1], q[2] = { w->sub, w->sub2 }; - Out o = out_load(w); + } + uint32_t pm = w->ph[0], ps = w->ph[1], inc = w->inc, si = w->i[0]; + unsigned sync = c->sync; for (unsigned k = 0; k < n; ++k) { - unsigned i = (c->sync ? ps : pm) >> 23; - int32_t a = ta[i], v = a + (((tb[i] - a) * m) >> 15); /* 12 bits */ - int32_t acc = v * 16 + subs_tick(q, &s); + unsigned i = (sync ? ps : pm) >> 23; + int32_t v = ta[i]; + if (m) v += ((tb[i] - v) * m) >> 15; /* 12 bits */ + acc[2 * k] = v * 16; uint32_t next = pm + inc; - ps = next < pm ? 0u : ps + si; /* the note's period restarts the synced cycle */ + ps = next < pm ? 0u : ps + si; /* the note's period restarts the synced cycle */ pm = next; - out[k] = finish(&o, acc, g); } - w->ph[0] = pm, w->ph[1] = ps, w->sub = q[0], w->sub2 = q[1]; - out_store(w, &o); + w->ph[0] = pm, w->ph[1] = ps; + subs(w, acc, n); } /* MORPH's crossfade step a sample, Q24: 5 ms at 1 to 2 s at 127, exponential (2^(8.64 v / 127), the fraction's @@ -353,16 +376,9 @@ static inline int32_t crush(int32_t s, const Crush *r) /* MORPH: two of TABLE's cycles mixed by MIX, the second WID semitones above the note (in phase with the first * while WID is 0), each at its own resolution. Changing either cycle crossfades from the pair that played over * TIME (a change during a crossfade starts from the pair last chosen). No subs: its two pages are full. */ -static void render_morph(Wave *w, const WaveControls *c, uint32_t inc, int16_t *out, unsigned n) +static void prepare_morph(Wave *w, const WaveControls *c, uint32_t inc) { - unsigned t1 = c->table >> 2, t2 = c->wav2 >> 2; - if (!w->armed) w->ta = (uint8_t)t1, w->tb = (uint8_t)t2, w->armed = 1, w->fade = 0; - if (t1 != w->ta || t2 != w->tb) { - if (c->fade) w->fa = w->ta, w->fb = w->tb, w->fade = 1u << 24; - w->ta = (uint8_t)t1, w->tb = (uint8_t)t2; - } - const int16_t *a = wave_tables[t1], *b = wave_tables[t2], *oa = wave_tables[w->fa], *ob = wave_tables[w->fb]; - uint32_t f = w->fade, step = f ? fade_step(c->fade) : 0, i2 = inc; + uint32_t i2 = inc; int32_t m = c->mix + (c->mix >> 6); /* 0..128 */ if (c->wid) { unsigned s8 = (c->wid * c->wid * 390u) >> 10, s = s8 >> 8; /* 24 (v / 127)^2 semitones, Q8 */ @@ -372,9 +388,22 @@ static void render_morph(Wave *w, const WaveControls *c, uint32_t inc, int16_t * if (!audible(i2)) m = 0; /* the second cycle past Nyquist: the first alone */ } Crush k1 = crush_of(c->bit1), k2 = crush_of(c->bit2); - int32_t g = gain_of(c->drive); + w->i[0] = i2, w->ga = m, w->off = fade_step(c->fade); + w->sh1 = (uint8_t)k1.shift, w->gd = k1.k, w->sh2 = (uint8_t)k2.shift, w->gt = k2.k; +} +static void play_morph(Wave *w, const WaveControls *c, int32_t *acc, unsigned n) +{ + unsigned t1 = c->table >> 2, t2 = c->wav2 >> 2; + if (!w->armed) w->ta = (uint8_t)t1, w->tb = (uint8_t)t2, w->armed = 1, w->fade = 0; + if (t1 != w->ta || t2 != w->tb) { + if (c->fade) w->fa = w->ta, w->fb = w->tb, w->fade = 1u << 24; + w->ta = (uint8_t)t1, w->tb = (uint8_t)t2; + } + const int16_t *a = wave_tables[t1], *b = wave_tables[t2], *oa = wave_tables[w->fa], *ob = wave_tables[w->fb]; + uint32_t f = w->fade, step = f ? w->off : 0, inc = w->inc, i2 = w->i[0]; + int32_t m = w->ga; + Crush k1 = { w->sh1, w->gd }, k2 = { w->sh2, w->gt }; uint32_t p1 = w->ph[0], p2 = c->wid ? w->ph[1] : p1; - Out o = out_load(w); for (unsigned k = 0; k < n; ++k) { unsigned x1 = p1 >> 23, x2 = p2 >> 23; int32_t u = crush(a[x1], &k1), v = crush(b[x2], &k2), y = u + (((v - u) * m) >> 7); @@ -384,23 +413,48 @@ static void render_morph(Wave *w, const WaveControls *c, uint32_t inc, int16_t * f = f > step ? f - step : 0; } p1 += inc, p2 += i2; - out[k] = finish(&o, y * 16, g); + acc[2 * k] = y * 16; } w->ph[0] = p1, w->ph[1] = p2, w->fade = f; - out_store(w, &o); } const char *wave_table_name(unsigned t) { return wave_table_names[t & (WAVE_TABLES - 1u)]; } -void wave_render(Wave *w, const WaveControls *c, uint32_t inc, int16_t *out, unsigned n) +void wave_prepare(Wave *w, const WaveControls *c, uint32_t inc) { - if (!audible(inc)) { for (unsigned k = 0; k < n; ++k) out[k] = 0; return; } + w->inc = inc; + if (!audible(inc)) return; + w->g4 = gain_of(c->drive) >> 4; + subs_of(w, c, inc); switch (c->model) { - case WAVE_PULSE: render_pulse(w, c, inc, out, n); break; - case WAVE_ENS: render_ens(w, c, inc, out, n); break; - case WAVE_TABLE: render_table(w, c, inc, out, n); break; - case WAVE_MORPH: render_morph(w, c, inc, out, n); break; - case WAVE_CHOIR: render_choir(w, c, inc, out, n); break; - default: render_saw(w, c, inc, out, n); break; + case WAVE_PULSE: prepare_pulse(w, c, inc); break; + case WAVE_ENS: prepare_ens(w, c, inc, 0); break; + case WAVE_TABLE: prepare_table(w, c, inc); break; + case WAVE_MORPH: prepare_morph(w, c, inc); break; + case WAVE_CHOIR: prepare_ens(w, c, inc, 1); break; + default: prepare_saw(w, c, inc); break; } } + +void wave_play(Wave *w, const WaveControls *c, uint32_t *lr, unsigned n) +{ + if (!audible(w->inc)) { for (unsigned k = 0; k < 2u * n; ++k) lr[k] = 0; return; } + int32_t *acc = (int32_t *)lr; + switch (c->model) { + case WAVE_PULSE: play_pulse(w, c, acc, n); break; + case WAVE_ENS: case WAVE_CHOIR: play_ens(w, c, acc, n); break; + case WAVE_TABLE: play_table(w, c, acc, n); break; + case WAVE_MORPH: play_morph(w, c, acc, n); break; + default: play_saw(w, acc, n); break; + } + finish(w, lr, n); + if (c->model == WAVE_ENS || c->model == WAVE_CHOIR) chorus(w, lr, n); +} + +void wave_render(Wave *w, const WaveControls *c, uint32_t inc, int16_t *out, unsigned n) +{ + uint32_t lr[32]; + wave_prepare(w, c, inc); + wave_play(w, c, lr, n); + for (unsigned k = 0; k < n; ++k) out[k] = (int16_t)(lr[2 * k] >> 16); +} diff --git a/sdk/octatrack/modules/syntiz/engine.h b/sdk/octatrack/modules/syntiz/engine.h index 1992c7fa96..e0ea90510a 100644 --- a/sdk/octatrack/modules/syntiz/engine.h +++ b/sdk/octatrack/modules/syntiz/engine.h @@ -52,6 +52,18 @@ typedef struct { int32_t ex; /* its treble emphasis's last input (Q13) */ uint32_t fade; /* MORPH: what remains of the crossfade from the old pair, Q24 */ uint8_t ta, tb, fa, fb, armed; /* MORPH: the pair playing, the pair fading out, and whether ta/tb are set */ + /* What wave_prepare worked out from the controls and the increment, for every block until either changes. */ + uint32_t inc; /* the base increment */ + int32_t g4; /* DRIVE's gain >> 4 */ + uint32_t si1, si2; /* the subs' increments */ + int32_t sg1, sg2; /* their gains, 0 when silent */ + uint32_t i[4]; /* SAW: the inner and outer pairs; PULSE: its pair; ENS, CHOIR: a note each; + * TABLE: the synced cycle (i[0]); MORPH: the second cycle (i[0]) */ + int32_t ga, gb; /* SAW: the pairs' gains; PULSE: ga; ENS, CHOIR: a note's gain, the shape's + * second saw; TABLE: the crossfade (MORF); MORPH: the mix */ + int32_t gd, gt; /* ENS, CHOIR: dry and tap gains; MORPH: the crushes' factors */ + uint32_t off; /* ENS: the second saw's offset; MORPH: the crossfade's step */ + uint8_t voices, sh1, sh2; /* ENS, CHOIR: notes sounding; MORPH: the crushes' shifts */ int16_t line[WAVE_DELAY]; } Wave; @@ -61,8 +73,13 @@ void wave_reset(Wave *w); /* A trig or a note: restarts the phases when the controls ask for it. */ void wave_note(Wave *w, const WaveControls *c); /* Fills out[0..n) with the track's source for one block at base increment inc (the played pitch, - * in turns per sample: f / 44100 * 2^32). n up to 64. Controls are read once per block. */ + * in turns per sample: f / 44100 * 2^32). n up to 16. Controls are read once per block. */ void wave_render(Wave *w, const WaveControls *c, uint32_t inc, int16_t *out, unsigned n); +/* wave_render in two steps, for a caller that knows when the controls or inc change: wave_prepare works out what + * depends only on them, wave_play renders a block from that and the same controls, as the packer takes it: two + * longs a sample in lr[0..2n), L then R, the sample in the high half. */ +void wave_prepare(Wave *w, const WaveControls *c, uint32_t inc); +void wave_play(Wave *w, const WaveControls *c, uint32_t *lr, unsigned n); /* TABLE's table names (four letters) by table number 0..31. */ const char *wave_table_name(unsigned t); diff --git a/sdk/octatrack/modules/syntiz/machine.c b/sdk/octatrack/modules/syntiz/machine.c index 94e55b3e6b..7ccabce8c8 100644 --- a/sdk/octatrack/modules/syntiz/machine.c +++ b/sdk/octatrack/modules/syntiz/machine.c @@ -164,6 +164,10 @@ unsigned wave_admit_track(const volatile uint8_t *part, unsigned track) static Wave voices[8]; static uint8_t ready; /* a bit a track: its oscillators were reset */ +/* Each track's controls, and what the engine works out from them, kept while the bytes they come from stand: the + * model, PTCH, SRC B-F and SETUP A-F. A lock, an LFO or a scene that moves a byte makes a new key. */ +static WaveControls held[8]; +static uint32_t held_key[8][4]; /* Called twice a frame for each SYNTIZ track, before and after its event's sample offset (the second call has * end == 16). It writes the header stock's packer expects at the cursor (source count, ring write position, @@ -175,19 +179,28 @@ int wave_render_track(unsigned track, unsigned ping, unsigned start, unsigned en unsigned n = end > start && end <= 16u ? end - start : 0u; h[0] = n, h[1] = start, h[2] = 0x04000000u, h[3] = start << 26; if (n && track < 8u) { - if (!(ready >> track & 1u)) wave_reset(&voices[track]), ready |= (uint8_t)(1u << track); + Wave *w = &voices[track]; const volatile uint16_t *fp = (const volatile uint16_t *)(uintptr_t)U32(FP_PTR); const volatile uint8_t *lane = (const volatile uint8_t *)(uintptr_t)(LANE + 72u * track + 0x20u); uint8_t src[6], setup[6]; for (unsigned k = 0; k < 6u; ++k) src[k] = (uint8_t)(fp[k] >> 8), setup[k] = lane[k]; - WaveControls c; - wave_controls_of(&c, model_of(part_base(), track), src, setup); - Wave *w = &voices[track]; + uint16_t ptch = fp[0]; + unsigned model = model_of(part_base(), track); + uint32_t key[4] = { (uint32_t)ptch << 16 | model << 8 | src[1], + (uint32_t)src[2] << 24 | (uint32_t)src[3] << 16 | (uint32_t)src[4] << 8 | src[5], + (uint32_t)setup[0] << 24 | (uint32_t)setup[1] << 16 | (uint32_t)setup[2] << 8 | setup[3], + (uint32_t)setup[4] << 8 | setup[5] }; + uint32_t *was = held_key[track]; + if (!(ready >> track & 1u)) wave_reset(w), ready |= (uint8_t)(1u << track), was[0] = ~key[0]; + if (was[0] != key[0] || was[1] != key[1] || was[2] != key[2] || was[3] != key[3]) { + was[0] = key[0], was[1] = key[1], was[2] = key[2], was[3] = key[3]; + wave_controls_of(&held[track], model, src, setup); + wave_prepare(w, &held[track], wave_increment(ptch, setup[0], setup[1], (const volatile uint32_t *)(uintptr_t)CURVE)); + } + const WaveControls *c = &held[track]; if (end == 16u && U8(EVENTS + track) & 16u && !(raise_ev_trig_muted && raise_ev_trig_muted() >> track & 1u)) - wave_note(w, &c); /* a trig a mute module drops starts no note */ - int16_t b[16]; - wave_render(w, &c, wave_increment(fp[0], setup[0], setup[1], (const volatile uint32_t *)(uintptr_t)CURVE), b, n); - for (unsigned k = 0; k < n; ++k) h[4 + 2 * k] = h[5 + 2 * k] = (uint32_t)(uint16_t)b[k] << 16; + wave_note(w, c); /* a trig a mute module drops starts no note */ + wave_play(w, c, (uint32_t *)(uintptr_t)(h + 4), n); } U32(CURSOR) = (uint32_t)(uintptr_t)(h + 4 + 2 * n); return 0; diff --git a/sdk/octatrack/modules/syntiz/octamod.module.json b/sdk/octatrack/modules/syntiz/octamod.module.json index de64239265..bc1f7213a6 100644 --- a/sdk/octatrack/modules/syntiz/octamod.module.json +++ b/sdk/octatrack/modules/syntiz/octamod.module.json @@ -3,7 +3,7 @@ "id": "syntiz", "key": "SYNTIZ", "name": "SYNTIZ", - "version": "0.1.0-experimental", + "version": "0.1.1-experimental", "category": "machines", "author": { "github": "stigmagit", @@ -412,15 +412,15 @@ ] }, "resources": { - "recorded": "Package f501a6a4, and the author's MKII, 31 Oct to 7 Nov 2026", + "recorded": "Storage: package c3a97ecc. CPU: 0.1.0 (f501a6a4) on the author's MKII, 31 Oct to 7 Nov 2026", "storage": { "label": "Storage", - "display": "73,304 bytes", - "value": 73304, + "display": "66,652 bytes", + "value": 66652, "unit": "bytes", "method": "static", - "conditions": "From the USB package f501a6a4: 53,500 bytes of ColdFire code and data (engine 49,051 with the 32 tables, knob map 788, machine glue 3,381, 280 of image alignment and hook records) and 19,804 of bss (eight tracks' oscillator state and the three page records). No DSP memory, no heap, no stock code written.", - "source": "evidence/hardware.md" + "conditions": "From the USB package c3a97ecc (0.1.1, build.py): 46,008 bytes of ColdFire code and data and 20,644 of bss (eight tracks' oscillator state, held controls and chorus lines, the three page records). Before the link merges repeated strings, the engine is 41,755 bytes (8,360 of code, the rest the 32 tables), the knob map 788, the machine glue 3,479. No DSP memory, no heap, no stock code written.", + "source": "TESTING.md" }, "processing": { "label": "CPU load", @@ -428,7 +428,7 @@ "value": 134.6, "unit": "us", "method": "hardware", - "conditions": "The author's MKII, 7 Nov 2026, the base's frame guard and per-render timers on a development twin (7bce173d) of his base, package f501a6a4: one track's render takes up to 37.1 % of the 362.8 us frame (134.6 us) when it follows stock's trig work in the same frame, at most 16.2 % (58.8 us) otherwise; three heavy tracks together averaged 48.2 % of each frame (31 Oct, twin 04e94075). His live set with two SYNTIZ tracks: 69 % of each frame in the frame interrupt against 34 % without SYNTIZ, no render dropped.", + "conditions": "Measured on 0.1.0 (package f501a6a4); 0.1.1 is not yet measured on a unit (TESTING.md: the same samples with about a quarter fewer instructions and half the memory operands in the emulator). The author's MKII, 7 Nov 2026, the base's frame guard and per-render timers on a development twin (7bce173d) of his base, package f501a6a4: one track's render takes up to 37.1 % of the 362.8 us frame (134.6 us) when it follows stock's trig work in the same frame, at most 16.2 % (58.8 us) otherwise; three heavy tracks together averaged 48.2 % of each frame (31 Oct, twin 04e94075). His live set with two SYNTIZ tracks: 69 % of each frame in the frame interrupt against 34 % without SYNTIZ, no render dropped.", "source": "evidence/performance.json" }, "impact": { @@ -436,7 +436,7 @@ "cpu": { "level": "high", "basis": "measured-comparison", - "rationale": "Each SYNTIZ track renders on the ColdFire in the frame interrupt. Measured on the author's MKII with the base's frame guard: a render costs about 15 % of a frame, up to 37 % after stock's trig work; two heavy tracks beside a THRU, three samples, a NEIGHBOR and a master compressor take the interrupt to 74 % of each frame (36 % without SYNTIZ) and the guard drops about two renders a second, unheard; three heavy tracks with long notes crackle. The base's guard renders a track's silent source rather than overrun; a Part admits three SYNTIZ tracks at most.", + "rationale": "Measured on 0.1.0; 0.1.1 renders the same samples with less work a frame, not yet measured on a unit. Each SYNTIZ track renders on the ColdFire in the frame interrupt. Measured on the author's MKII with the base's frame guard: a render costs about 15 % of a frame, up to 37 % after stock's trig work; two heavy tracks beside a THRU, three samples, a NEIGHBOR and a master compressor take the interrupt to 74 % of each frame (36 % without SYNTIZ) and the guard drops about two renders a second, unheard; three heavy tracks with long notes crackle. The base's guard renders a track's silent source rather than overrun; a Part admits three SYNTIZ tracks at most.", "source": "evidence/performance.json" }, "dsp": { @@ -448,15 +448,15 @@ "memory": { "level": "low", "basis": "source-estimate", - "rationale": "73,304 bytes of ColdFire code, tables and state in DRAM, from the package; no heap.", - "source": "evidence/hardware.md" + "rationale": "66,652 bytes of ColdFire code, tables and state in DRAM, from the package; no heap.", + "source": "TESTING.md" } } }, "tests": { "report": "TESTING.md", - "summary": "Host: 5,376 extreme renders of the six models under sanitizers, levels, DC, aliasing, pitch within 1.5 cents of stock's curve, every knob byte, package rebuilt byte for byte (verify.py). Emulator: chooser, pages, model list, notes for every model. The author's MKIIs, 28 Oct to 7 Nov 2026, this package since 31 Oct: six models over USB, projects back after power cycles, a fourth track refused, his live set measured with the base's guard (two SYNTIZ tracks beside a THRU, three samples, NEIGHBOR and a compressor: 74 % of a frame, nothing heard). Open: MKI, mute module, MIDI flood.", - "hardwareStatus": "reported", + "summary": "0.1.1: the same samples as 0.1.0 bit for bit (host matrix of 5.8 million samples under sanitizers, 300 random scenarios through the machine glue on an emulated ColdFire), about a quarter fewer instructions and half the memory operands a frame in the emulator; not yet on a unit. 0.1.0 on the author's MKIIs, 28 Oct to 7 Nov 2026: six models over USB, projects back after power cycles, a fourth track refused, his live set at 74 % of a frame with two SYNTIZ tracks, nothing heard. Open: MKI, mute module, MIDI flood.", + "hardwareStatus": "untested", "evidenceRevision": "b36c79977dc4470d497c39f723ba8536fb865efe", "gates": [ "modules/syntiz/verify.py" @@ -478,115 +478,6 @@ "media/ot-table-src.png" ], "screenshotStyle": "black-and-white" - }, - "qualification": { - "moduleVersion": "0.1.0-experimental", - "sourceSha256": "6fb4883386f10e512da989a97b4d748e69d2ade1bffdfd10bcac30ab1b5bc163", - "imageSha256": "f501a6a4ea3c8361427b85302fc77274906b9de2e3dfd6f3c81bc1759767c5e8", - "cycles": [ - { - "processor": "coldfire", - "worstCase": 35536, - "maxConfiguration": 35536, - "maxInstances": 3, - "budget": 95782, - "unit": "cycles/event", - "method": "hardware", - "conditions": { - "parameterExtremes": "The dearest render measured was a SAW with both detuned pairs, both subs and DRIV, filter and chorus on the track, holding a long note: 37.1 % of a frame as the second call of a frame with a trig, 16.2 % at most as a first call (7 Nov 2026). Three tracks at their heaviest (CHOIR and ENS with three chord notes, SAW with both pairs, all with CHOR, SUB, SUB2 and DRIV at maximum) averaged 48.2 % of each frame together (31 Oct). Under qemu the heaviest branch is ENS with a four-note chord and chorus, 6,372 instructions a frame, SAW 4,044 (tools/count_cf.sh); the host matrix renders every model with every control at 0, 1, 63, 64, 65, 126 and 127.", - "parameterModulation": "SRC controls are the track's own: locks, scenes and LFOs on them reach the render through the Part's bytes each frame, as a FLEX track's. The author's live runs turned encoders and switched scenes while playing (7 Nov, measure 3 and 4); the cost per render did not depend on it, and no control-update path exists apart from reading the bytes.", - "modeSwitching": "Model changes rewrite the DSP halfwords as a lock would; STOP/PLAY, pattern and scene changes were part of the live runs (7 Nov); a trig in the frame splits the render in two calls, and the second is the dearest case recorded. Choosing SYNTIZ for a fourth track is refused (31 Oct, on the unit). RTRG restarts the oscillators at each trig with no extra cost measured.", - "maxLoad": "Three SYNTIZ tracks a Part. Three second-call renders in one frame would sum to 106,608 cycles, more than the 95,782-cycle frame: the base's guard then renders a track's silent source for that frame (16 samples) rather than overrun. Measured: three heavy tracks with long notes and four long samples dropped 24 to 75 renders in 120 s, a crackle the author hears (3 Nov); two SYNTIZ tracks beside a THRU, three samples, a NEIGHBOR with flanger and a master compressor, 73.8 % of each frame, 259 dropped in 120 s, unheard (7 Nov); the same with two samples, 69.3 %, none dropped. Budget basis: one frame, 362.8 us, 95,782 cycles at 264 MHz, 80 % of it for the whole frame interrupt (stock about 34-36 % on these sets, 103.7 % in its worst frame).", - "inputConditions": "The render takes no input: it makes its samples from the Part's bytes. Silence costs the same as a note (the oscillators run unless RTRG restarts them); a note above Nyquist is silent; the subs are silent below 25 Hz. The author's MKII, OS 1.40C, package f501a6a4, the base's guard with its 80 % share; one run per case; counts of the 132 MHz timer converted to 264 MHz cycles." - }, - "report": "evidence/performance.json" - } - ], - "memory": { - "regions": [ - { - "name": "ColdFire code and the 32 tables (engine.o, DRAM)", - "space": "sdram", - "words": 49051, - "wordBits": 8, - "bytes": 49051, - "scope": "shared" - }, - { - "name": "Knob map (machine_map.o)", - "space": "sdram", - "words": 788, - "wordBits": 8, - "bytes": 788, - "scope": "shared" - }, - { - "name": "Machine glue, code and data (machine.o)", - "space": "sdram", - "words": 3381, - "wordBits": 8, - "bytes": 3381, - "scope": "shared" - }, - { - "name": "Image alignment and the two hook records", - "space": "sdram", - "words": 280, - "wordBits": 8, - "bytes": 280, - "scope": "shared" - }, - { - "name": "State (bss): eight tracks' oscillators and chorus lines, the three page records", - "space": "sdram", - "words": 19804, - "wordBits": 8, - "bytes": 19804, - "scope": "shared" - } - ], - "perInstanceBytes": 0, - "sharedBytes": 73304, - "maxInstances": 3, - "totalBytes": 73304, - "conditions": "From the USB package f501a6a4 (build.py: 53,500 bytes of code and data, 19,804 of bss, 174 relocations) and m68k-elf-size of the three objects compiled with build.py's flags (engine 49,051 text, machine_map 788, machine 3,377 text and 4 data; the 280 bytes left are the image's alignment and its hook records). State is allocated for all eight tracks whatever the Part holds, so it is shared, not per instance. No DSP memory, no heap, no stock code written (the base owns the chooser and SRC SETUP). The render runs on the base's frame-interrupt stack; its depth was not measured (no canary).", - "report": "evidence/hardware.md" - }, - "hardware": { - "kind": "functional", - "status": "reported", - "model": "MKII", - "testedOn": "2026-11-07", - "tester": "stigmagit (the author, on his own MKII, driven over USB from his Claude Code session)", - "sourceRevision": "b36c79977dc4470d497c39f723ba8536fb865efe", - "imageSha256": "f501a6a4ea3c8361427b85302fc77274906b9de2e3dfd6f3c81bc1759767c5e8", - "summary": "The author's Octatrack MKII, OS 1.40C, flashed with his private base 86388105 (Modwerk's base of 31 October with --raise and a start logo); this package f501a6a4 kept over USB since 31 October 2026, beside FM Synth 0.1.2 until 7 November. 7 November 2026, on a RAM-booted development twin (7bce173d) of that base, the base's frame guard, 120 s a run, the author at the keys: his reference set (THRU, two samples, THRU, SAW heavy with filter and chorus, TABLE with filter and chorus, NEIGHBOR with flanger, master compressor) 60 % of each frame with the pattern alone and 69 % played live, no render dropped, no crackle heard; his complete set (a third sample) 74 %, 259 renders dropped in 120 s, nothing heard. Power-cycled twice back onto the flashed base: do inventory lists syntiz alone, nothing missing, the set plays. Reported by the author since 28 October (earlier packages, two MKIIs): the six models play, projects saved with SYNTIZ tracks come back after a power cycle; since 31 October, this package: a fourth SYNTIZ track is refused, three heavy tracks with long notes crackle. With FM Synth installed but never played the SYNTIZ tracks crackled lightly; removing it cured it (one A/B, 7 November).", - "limitations": [ - "One MKII with this package (a second MKII ran an earlier package on 29 October); no MKI.", - "The measurements come from the author's own development twins of his base, not Modwerk's beta base, and from his own sets, one run each; on 3 November the same run repeated gave 24 to 75 dropped renders.", - "Not run: a mute module's muted trigs, the level against a FLEX sample measured, a MIDI flood, a stress project with eight tracks and three LFOs a track.", - "Three heavy SYNTIZ tracks holding long notes still crackle at moments: the three-track limit bounds the load, it does not make the worst frame fit." - ], - "report": "evidence/hardware.md" - }, - "documentation": { - "tutorial": { - "title": "Quick tutorial: play a SYNTIZ track", - "steps": [ - "Select an audio track, hold FUNC and press SRC: SRC SETUP's machine list opens. Go DOWN to SYNTIZ and press YES.", - "Tap the track key twice quickly: the model list opens, 001 SAW to 006 CHOIR. Pick one with the arrows and YES; LEFT goes back to the machine list.", - "Press SRC for the model's page and turn the encoders; FUNC + SRC again shows SETUP, where OCT moves the register and DRIV adds drive.", - "Place trigs or play the trig keys in chromatic mode: the track's filter, AMP envelope, LFOs and effects shape the sound as they would a sample's." - ] - }, - "screenshots": [ - "media/ot-chooser.png", - "media/ot-model-list.png", - "media/ot-saw-src.png", - "media/ot-table-src.png" - ], - "screenshotStyle": "black-and-white" - } } }, "license": { diff --git a/sdk/octatrack/modules/syntiz/tools/cf_probe.cpp b/sdk/octatrack/modules/syntiz/tools/cf_probe.cpp new file mode 100644 index 0000000000..5e245cc868 --- /dev/null +++ b/sdk/octatrack/modules/syntiz/tools/cf_probe.cpp @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: MIT +// SYNTIZ's render on an emulated ColdFire (upstream ot_emu's V4e core): runs a linked image's +// wave_render_track against a synthetic stock environment, read from stdin as commands, and prints what it +// wrote at the packer's cursor and how many instructions each call took. Counts, not cycles. +// cf_probe IMAGE ORIGIN RENDER PROFILE_OUT < script +// script: "w8|w16|w32 ADDR VALUE" pokes; "call TRACK PING START END" renders and prints +// "out N COUNT s0 s1 ...": COUNT instructions, the samples (high halves of the L longs). +#include +#include +#include +#include +#include +#include +#include +#include +#include "machine.h" +#include "mc68k/Musashi/m68k.h" +#include "mc68k/cpuState.h" + +int main(int argc, char **argv) +{ + if (argc != 5) return 64; + std::ifstream f(argv[1], std::ios::binary); + std::vector image{std::istreambuf_iterator(f), {}}; + const uint32_t origin = std::strtoul(argv[2], 0, 0), render = std::strtoul(argv[3], 0, 0); + ot::Machine m(std::vector{}); + for (size_t i = 0; i < image.size(); ++i) m.write8(origin + uint32_t(i), image[i]); + const uint32_t stack = 0x47f00000, stop = 0x47f80000, buffer = 0x80200000; + std::map profile; + char cmd[16]; + unsigned a, b, c, d; + while (std::scanf("%15s", cmd) == 1) { + if (!std::strcmp(cmd, "w8") && std::scanf("%x %x", &a, &b) == 2) m.write8(a, uint8_t(b)); + else if (!std::strcmp(cmd, "w16") && std::scanf("%x %x", &a, &b) == 2) m.write16(a, uint16_t(b)); + else if (!std::strcmp(cmd, "w32") && std::scanf("%x %x", &a, &b) == 2) m.write32(a, b); + else if (!std::strcmp(cmd, "reset")) profile.clear(); + else if (!std::strcmp(cmd, "call") && std::scanf("%u %u %u %u", &a, &b, &c, &d) == 4) { + m.write32(0x80001c80, buffer); + m68k_set_reg(m.getCpuState(), M68K_REG_SR, 0x2700); + m68k_set_reg(m.getCpuState(), M68K_REG_SP, stack); + m.write32(stack, stop), m.write32(stack + 4, a), m.write32(stack + 8, b), m.write32(stack + 12, c), + m.write32(stack + 16, d); + for (unsigned r = 2; r < 15; ++r) + if (r != 8 && r != 9) m68k_set_reg(m.getCpuState(), m68k_register_t(M68K_REG_D0 + r), 0x5a5a0000 + r); + m68k_set_reg(m.getCpuState(), M68K_REG_PC, render); + unsigned n = 0; + while (m.pc() != stop && n < 2000000) { + ++profile[m.pc()], ++n; + if (!m.step()) { std::fprintf(stderr, "stopped at %08x: %s\n", m.pc(), m.why().c_str()); return 1; } + } + if (m.pc() != stop || m68k_get_reg(m.getCpuState(), M68K_REG_SP) != stack + 4) return 2; + for (unsigned r = 2; r < 15; ++r) + if (r != 8 && r != 9 && m68k_get_reg(m.getCpuState(), m68k_register_t(M68K_REG_D0 + r)) != 0x5a5a0000 + r) { + std::fprintf(stderr, "register %u not saved\n", r); + return 3; + } + const uint32_t count = m.read32(buffer), end = m.read32(0x80001c80); + if (end != buffer + 16 + 8 * count) return 4; + std::printf("out %u %u", count, n); + for (unsigned k = 0; k < count; ++k) { + uint32_t l = m.read32(buffer + 16 + 8 * k), r = m.read32(buffer + 20 + 8 * k); + if (l != r || (l & 0xffff)) return 5; + std::printf(" %d", int16_t(l >> 16)); + } + std::printf("\n"); + } else return 65; + } + FILE *p = std::fopen(argv[4], "w"); + for (auto &[pc, k] : profile) std::fprintf(p, "%x %llu\n", pc, (unsigned long long)k); + std::fclose(p); + return 0; +} diff --git a/sdk/octatrack/modules/syntiz/tools/cf_probe.py b/sdk/octatrack/modules/syntiz/tools/cf_probe.py new file mode 100644 index 0000000000..d02db3efa8 --- /dev/null +++ b/sdk/octatrack/modules/syntiz/tools/cf_probe.py @@ -0,0 +1,194 @@ +#!/usr/bin/env python3 +# SPDX-License-Identifier: MIT +"""SYNTIZ's render on an emulated ColdFire, through the machine glue (wave_render_track), and two versions compared. + + python3 -B tools/cf_probe.py count [REV] instructions a frame per model, at C3, for this tree or a git revision + python3 -B tools/cf_probe.py compare REV [N] N random scenarios (default 300): this tree's samples must equal REV's + python3 -B tools/cf_probe.py host REV tools/render_matrix.c on the host: this tree's engine against REV's + +The image is linked as build.py links the package, with build.py's flags. cf_probe.cpp runs it on upstream ot_emu's V4e +core (`npm run upstream:tools`, then Octabam's `make emu-cf`; OCTABAM names another checkout) against a synthetic stock +environment: the Part's signature, the parameter record, the live lane, the event bytes and a 2^(x/12) curve built as +test_machine_map.c builds it (no stock byte). Emulator counts, not cycles: the base's frame guard on a unit is the measure. +"allowance" weighs each executed instruction with Grain's zero-wait allowances (grain/evidence/timing/bound.py): a +yardstick that counts memory operands, multiplies and divides above register work, not a cycle count. +""" +import os +import random +import re +import subprocess +import sys +import tempfile +from pathlib import Path + +HERE = Path(__file__).resolve().parents[1] +ROOT = HERE.parents[3] +sys.path.insert(0, str(ROOT / 'sdk/runtime/loader')) +import build # noqa: E402 + +CROSS = 'm68k-elf-' +UPSTREAM = Path(os.environ.get('OCTABAM', Path.home() / '.cache/modwerk-upstream/octabam')) +ORIGIN = 0x47000000 +BANK, PART_OFF, SIG = 0x46200000, 0x8ed80, 60 +FPREC, LANE, EVENTS, CURVE = 0x80300000, 0x80000810, 0x46104d0c, 0x400aa294 +NAMES = ['SAW', 'PULSE', 'ENS', 'TABLE', 'MORPH', 'CHOIR'] +# SRC A-F and SETUP A-F bytes (SRC A, PTCH, is the parameter word): each model's defaults, and bench_cf.c's heavy settings. +DEFAULTS = {0: ([64, 24, 0, 0, 0, 0], [64, 3, 64, 0, 0, 0]), 1: ([64, 64, 0, 0, 0, 0], [64, 3, 64, 0, 16, 0]), + 2: ([64, 24, 24, 24, 0, 64], [64, 3, 64, 0, 0, 0]), 3: ([64, 0, 0, 0, 0, 0], [64, 3, 64, 0, 0, 0]), + 4: ([64, 8, 64, 24, 0, 0], [64, 3, 64, 0, 0, 0]), 5: ([64, 24, 24, 24, 108, 64], [64, 3, 64, 0, 0, 0])} +HEAVY = {0: ([64, 40, 127, 90, 90, 90], [64, 3, 64, 0, 0, 0]), 1: ([64, 64, 100, 30, 90, 90], [64, 3, 64, 0, 40, 127]), + 2: ([64, 27, 31, 36, 32, 100], [64, 3, 64, 0, 90, 90]), 3: ([64, 64, 0, 30, 80, 90], [64, 3, 64, 0, 90, 0]), + 4: ([64, 8, 64, 60, 80, 127], [64, 3, 64, 0, 60, 90]), 5: ([64, 27, 31, 36, 52, 100], [64, 3, 64, 0, 90, 90])} +BRANCH = re.compile(r'b(?:hi|ls|cc|cs|ne|eq|vc|vs|pl|mi|ge|lt|gt|le|ra)[swl]?') + + +def sources(rev, tmp): + """The module folder of this tree, or of a git revision exported under tmp (with the header machine.c includes).""" + if rev is None: + return HERE + out = tmp / rev.replace('/', '_') + out.mkdir() + tar = subprocess.check_output(['git', 'archive', rev, 'sdk/octatrack/modules/syntiz', 'sdk/machines/octatrack/include'], cwd=ROOT) + subprocess.run(['tar', '-x', '-C', str(out)], input=tar, check=True) + return out / 'sdk/octatrack/modules/syntiz' + + +def image(folder, tmp): + out = Path(tempfile.mkdtemp(dir=tmp)) + objs = [] + for s in ('engine.c', 'machine_map.c', 'machine.c'): + subprocess.run([CROSS + 'gcc', *build.CFLAGS, '-fno-late-combine-instructions', '-c', str(folder / s), '-o', + str(out / (s + '.o'))], check=True) + objs.append(out / (s + '.o')) + (out / 'link.ld').write_text(build.SCRIPT % ORIGIN) + subprocess.run([CROSS + 'ld', '--orphan-handling=error', '--no-warn-rwx-segments', '-T', str(out / 'link.ld'), '-o', + str(out / 'syn.elf'), *map(str, objs)], check=True) + subprocess.run([CROSS + 'objcopy', '-O', 'binary', '-j', '.image', str(out / 'syn.elf'), str(out / 'image')], check=True) + nm = subprocess.check_output([CROSS + 'nm', str(out / 'syn.elf')], text=True) + render = next(int(l.split()[0], 16) for l in nm.splitlines() if l.endswith(' wave_render_track')) + return out, render + + +def probe(tmp): + exe, emu = tmp / 'cf_probe', UPSTREAM / 'out/emu' + if not (emu / 'libot_machine.a').exists(): + sys.exit('[SKIP] no ot_emu build under %s (npm run upstream:tools, then make emu-cf there)' % UPSTREAM) + subprocess.run(['c++', '-std=c++17', '-O2', '-I', str(UPSTREAM / 'tools/emu/ot_emu'), '-I', str(UPSTREAM / 'vendor'), + '-I', str(UPSTREAM / 'vendor/dsp56300/source'), str(HERE / 'tools/cf_probe.cpp'), + *[str(emu / a) for a in ('libot_machine.a', 'mc68k/lib68kEmu.a', 'dsp56300/dsp56kEmu/libdsp56kEmu.a', + 'dsp56300/dsp56kBase/libdsp56kBase.a', 'dsp56300/asmjit/libasmjit.a')], + '-o', str(exe)], check=True) + return exe + + +def env(): + s = ['w32 46c82456 %x' % BANK, 'w8 100b14cf 0', 'w32 800062a8 %x' % FPREC] + return s + ['w32 %x %x' % (CURVE + 4 * i, round(2 ** ((i * 32 - 0x0400) / 0x500 / 12) * (1 << 26))) for i in range(1024)] + + +def track(t, model, src, setup, ptch=0x4000): + part = BANK + PART_OFF + SIG + 30 * t + s = ['w8 %x 1' % (BANK + PART_OFF + 0x22 + t), 'w8 %x 57' % part, 'w8 %x 56' % (part + 1), 'w8 %x %x' % (part + 2, model + 1), + 'w16 %x %x' % (FPREC, ptch)] + return s + ['w16 %x %x' % (FPREC + 2 * k, src[k] << 8) for k in range(1, 6)] + \ + ['w8 %x %x' % (LANE + 72 * t + 0x20 + k, setup[k]) for k in range(6)] + + +def run(exe, img, script, profile): + p = subprocess.run([str(exe), str(img[0] / 'image'), hex(ORIGIN), hex(img[1]), str(profile)], + input='\n'.join(script) + '\n', capture_output=True, text=True) + if p.returncode: + sys.exit('[FAIL] the probe stopped (%d): %s' % (p.returncode, p.stderr.strip())) + return [list(map(int, l.split()[1:])) for l in p.stdout.splitlines()] + + +def weight(op, arg): + if op.startswith(('rem', 'div')): return 48 + if op == 'moveml': return 64 + if op in ('jsr', 'rts', 'linkw', 'unlk') or op.startswith('bsr'): return 16 + if BRANCH.fullmatch(op): return 8 + if op.startswith('mul'): return 16 + return 12 if '@' in arg or ' <' in arg else 4 + + +def count(rev, tmp, frames=64): + exe, img = probe(tmp), image(sources(rev, tmp), tmp) + ops = {} + for line in subprocess.check_output([CROSS + 'objdump', '-d', '--no-show-raw-insn', str(img[0] / 'syn.elf')], text=True).splitlines(): + m = re.match(r'^\s*([0-9a-f]+):\s+(\S+)\s*(.*)', line) + if m: ops[int(m[1], 16)] = (m[2], m[3]) + pcs = sorted(ops) + size = {a: b - a for a, b in zip(pcs, pcs[1:])} + print('One track at C3, 63 frames after the first, each frame a [0,0) and a [0,16) call (no trig):') + for model in range(6): + for label, table in (('defaults', DEFAULTS), ('heavy', HEAVY)): + src, setup = table[model] + s = env() + track(1, model, src, setup) + for fr in range(frames): # MORPH heavy: WAV1 alternates each frame, a crossfade always running + s += (['w16 %x %x' % (FPREC + 2, (8 if fr & 1 else 108) << 8)] if model == 4 and label == 'heavy' else []) + \ + ['call 1 0 0 0', 'call 1 0 0 16'] + (['reset'] if not fr else []) + outs = run(exe, img, s, tmp / 'profile.txt') + hist = {int(a, 16): int(b) for a, b in (l.split() for l in (tmp / 'profile.txt').read_text().splitlines())} + lines = {pc >> 4 for pc in hist} | {(pc + size.get(pc, 2) - 1) >> 4 for pc in hist} + per = lambda f: sum(k for pc, k in hist.items() if f(*ops.get(pc, ('', '')))) / (frames - 1) + print('%-6s %-8s %5.0f instructions, %4d code bytes, %3.0f multiplies, %2.0f divides, %4.0f memory operands, ' + '%6.0f allowance a frame' % (NAMES[model], label, sum(o[1] for o in outs[2:]) / (frames - 1), len(lines) * 16, + per(lambda o, a: o.startswith(('mul', 'mac', 'msac'))), per(lambda o, a: o.startswith(('div', 'rem'))), + per(lambda o, a: '@' in a and not o.startswith(('lea', 'pea', 'j', 'b'))), + sum(k * weight(*ops.get(pc, ('nop', ''))) for pc, k in hist.items()) / (frames - 1))) + + +def scenario(rng, frames): + """Two tracks: models, knobs and PTCH moving, model changes, trigs (RTRG on or off), split frames.""" + s = env() + for t in (1, 4): + s += track(t, rng.randrange(6), [64] + [rng.choice([0, 1, 63, 64, 65, 126, 127, rng.randrange(128)]) for _ in range(5)], + [rng.randrange(128), rng.randrange(7), rng.randrange(128), rng.choice([0, 0, 1]), rng.randrange(128), + rng.randrange(128)], rng.randrange(0x10000)) + for _ in range(frames): + t, r = rng.choice((1, 4)), rng.random() + if r < 0.05: s.append('w8 %x %x' % (BANK + PART_OFF + SIG + 30 * t + 2, rng.randrange(1, 7))) + elif r < 0.25: s.append('w16 %x %x' % (FPREC + 2 * rng.randrange(1, 6), rng.choice([0, 1, 63, 64, 127, rng.randrange(128)]) << 8 | rng.randrange(256))) + elif r < 0.35: s.append('w8 %x %x' % (LANE + 72 * t + 0x20 + rng.randrange(6), rng.choice([0, 1, 3, 6, 64, 127, rng.randrange(256)]))) + elif r < 0.55: s.append('w16 %x %x' % (FPREC, rng.choice([rng.randrange(0x10000), 0x4000, 0x0400, 0x7c00, 0]))) + trig = rng.random() < 0.15 + s.append('w8 %x %x' % (EVENTS + t, 16 if trig else rng.choice([0, 0, 0, 0xef]))) + k = rng.randrange(17) if trig or rng.random() < 0.1 else 0 + s += ['call %d 0 0 %d' % (t, k), 'call %d 1 %d 16' % (t, k)] + return s + + +def compare(rev, tmp, n=300, frames=600): + exe = probe(tmp) + old, new = image(sources(rev, tmp), tmp), image(HERE, tmp) + rng, total = random.Random(7), 0 + for i in range(n): + s = scenario(rng, frames) + a, b = run(exe, old, s, tmp / 'p'), run(exe, new, s, tmp / 'p') + for k, (x, y) in enumerate(zip(a, b)): + if x[0] != y[0] or x[2:] != y[2:]: + sys.exit('[FAIL] scenario %d, call %d: %s against %s' % (i, k, y[:8], x[:8])) + total += sum(x[0] for x in a) + print('[PASS] %d scenarios, %d samples through wave_render_track: identical to %s' % (n, total, rev)) + + +def host(rev, tmp): + raws = [] + for folder in (sources(rev, tmp), HERE): + exe = tmp / ('matrix%d' % len(raws)) + subprocess.run(['cc', '-std=c11', '-O1', '-g', '-fsanitize=undefined,address', '-fno-sanitize-recover=all', + '-I', str(folder), '-o', str(exe), str(HERE / 'tools/render_matrix.c'), + str(folder / 'engine.c'), '-lm'], check=True) + raws.append(subprocess.run([str(exe)], check=True, capture_output=True).stdout) + if raws[0] != raws[1]: + sys.exit('[FAIL] the engine renders differently from %s' % rev) + print('[PASS] %d samples from tools/render_matrix.c: identical to %s' % (len(raws[0]) // 2, rev)) + + +if __name__ == '__main__': + with tempfile.TemporaryDirectory() as tmp: + cmd, args = sys.argv[1], sys.argv[2:] + if cmd == 'count': count(args[0] if args else None, Path(tmp)) + elif cmd == 'compare': compare(args[0], Path(tmp), *map(int, args[1:])) + elif cmd == 'host': host(args[0], Path(tmp)) + else: sys.exit(__doc__) diff --git a/sdk/octatrack/modules/syntiz/tools/render_matrix.c b/sdk/octatrack/modules/syntiz/tools/render_matrix.c new file mode 100644 index 0000000000..a65a439787 --- /dev/null +++ b/sdk/octatrack/modules/syntiz/tools/render_matrix.c @@ -0,0 +1,53 @@ +/* SPDX-License-Identifier: MIT + * The engine's output over a fixed matrix, as raw samples on stdout, for comparing two versions of engine.c + * byte for byte (tools/cf_probe.py host). Only the public API: wave_reset, wave_note, wave_render. + * 1. every model with every control at 0, 1, 63, 64, 65, 126, 127, every third note, blocks of 1 to 16; + * 2. 3,000 random walks: a control, the model or the pitch moves between blocks, trigs with RTRG, any block size, + * increments from silent to past Nyquist. */ +#include +#include +#include "engine.h" /* -I the module folder: this tree's or an older one's */ + +static uint32_t seed = 0x2545f491u; +static uint32_t rnd(void) { seed ^= seed << 13, seed ^= seed >> 17, seed ^= seed << 5; return seed; } +static uint32_t inc_of(double note) { return (uint32_t)(440.0 * pow(2.0, (note - 69.0) / 12.0) / WAVE_RATE * 4294967296.0); } +static void block(Wave *w, const WaveControls *c, uint32_t inc, unsigned n) +{ + int16_t out[16]; + wave_render(w, c, inc, out, n); + fwrite(out, sizeof out[0], n, stdout); +} + +int main(void) +{ + static Wave w; + static const uint8_t ends[] = { 0, 1, 63, 64, 65, 126, 127 }; + for (unsigned m = 0; m < WAVE_MODELS; ++m) + for (unsigned e = 0; e < sizeof ends; ++e) + for (unsigned note = 0; note < 128u; note += 3u) { + WaveControls c = wave_defaults[m]; + uint8_t v = ends[e]; + c.det = c.uni = c.wide = c.sub = c.sub2 = c.pw = c.pwm = c.pws = c.chor = c.drive = c.rtrg = v; + c.table = c.morph = c.msweep = c.sync = c.wav2 = c.mix = c.wid = c.fade = c.bit1 = c.bit2 = v; + c.note[0] = v, c.note[1] = (uint8_t)(127 - v), c.note[2] = 88; + wave_reset(&w); + wave_note(&w, &c); + for (unsigned b = 0; b < 48u; ++b) block(&w, &c, inc_of(note), 1u + (b * 7u + note) % 16u); + } + for (unsigned run = 0; run < 3000u; ++run) { + WaveControls c = wave_defaults[rnd() % WAVE_MODELS]; + uint8_t *bytes = &c.det; /* every control after the model */ + for (unsigned k = 0; k < sizeof c - 1u; ++k) bytes[k] = (uint8_t)(rnd() % 3u ? rnd() % 128u : ends[rnd() % sizeof ends]); + uint32_t inc = rnd() % 4u ? inc_of((double)(rnd() % 1400u) / 10.0) : rnd(); + wave_reset(&w); + for (unsigned b = 0; b < 200u; ++b) { + uint32_t r = rnd() % 100u; + if (r < 10u) bytes[rnd() % (sizeof c - 1u)] = (uint8_t)(rnd() % 128u); + else if (r < 13u) c.model = (uint8_t)(rnd() % WAVE_MODELS); + else if (r < 25u) inc = rnd() % 4u ? inc + (rnd() % 65536u) - 32768u : inc_of((double)(rnd() % 1400u) / 10.0); + if (rnd() % 16u == 0) wave_note(&w, &c); + block(&w, &c, inc, 1u + rnd() % 16u); + } + } + return 0; +} diff --git a/src/catalog/module-documents.json b/src/catalog/module-documents.json index 4247d13aff..63ac9182fd 100644 --- a/src/catalog/module-documents.json +++ b/src/catalog/module-documents.json @@ -11795,7 +11795,7 @@ "id": "syntiz", "key": "SYNTIZ", "name": "SYNTIZ", - "version": "0.1.0-experimental", + "version": "0.1.1-experimental", "category": "machines", "access": { "location": "Audio track: FUNC + SRC (SRC SETUP) → SYNTIZ; a double tap of the track key opens its models.", @@ -12218,15 +12218,15 @@ ] }, "resources": { - "recorded": "Package f501a6a4, and the author's MKII, 31 Oct to 7 Nov 2026", + "recorded": "Storage: package c3a97ecc. CPU: 0.1.0 (f501a6a4) on the author's MKII, 31 Oct to 7 Nov 2026", "storage": { "label": "Storage", - "display": "73,304 bytes", - "value": 73304, + "display": "66,652 bytes", + "value": 66652, "unit": "bytes", "method": "static", - "conditions": "From the USB package f501a6a4: 53,500 bytes of ColdFire code and data (engine 49,051 with the 32 tables, knob map 788, machine glue 3,381, 280 of image alignment and hook records) and 19,804 of bss (eight tracks' oscillator state and the three page records). No DSP memory, no heap, no stock code written.", - "source": "evidence/hardware.md" + "conditions": "From the USB package c3a97ecc (0.1.1, build.py): 46,008 bytes of ColdFire code and data and 20,644 of bss (eight tracks' oscillator state, held controls and chorus lines, the three page records). Before the link merges repeated strings, the engine is 41,755 bytes (8,360 of code, the rest the 32 tables), the knob map 788, the machine glue 3,479. No DSP memory, no heap, no stock code written.", + "source": "TESTING.md" }, "processing": { "label": "CPU load", @@ -12234,7 +12234,7 @@ "value": 134.6, "unit": "us", "method": "hardware", - "conditions": "The author's MKII, 7 Nov 2026, the base's frame guard and per-render timers on a development twin (7bce173d) of his base, package f501a6a4: one track's render takes up to 37.1 % of the 362.8 us frame (134.6 us) when it follows stock's trig work in the same frame, at most 16.2 % (58.8 us) otherwise; three heavy tracks together averaged 48.2 % of each frame (31 Oct, twin 04e94075). His live set with two SYNTIZ tracks: 69 % of each frame in the frame interrupt against 34 % without SYNTIZ, no render dropped.", + "conditions": "Measured on 0.1.0 (package f501a6a4); 0.1.1 is not yet measured on a unit (TESTING.md: the same samples with about a quarter fewer instructions and half the memory operands in the emulator). The author's MKII, 7 Nov 2026, the base's frame guard and per-render timers on a development twin (7bce173d) of his base, package f501a6a4: one track's render takes up to 37.1 % of the 362.8 us frame (134.6 us) when it follows stock's trig work in the same frame, at most 16.2 % (58.8 us) otherwise; three heavy tracks together averaged 48.2 % of each frame (31 Oct, twin 04e94075). His live set with two SYNTIZ tracks: 69 % of each frame in the frame interrupt against 34 % without SYNTIZ, no render dropped.", "source": "evidence/performance.json" }, "impact": { @@ -12242,7 +12242,7 @@ "cpu": { "level": "high", "basis": "measured-comparison", - "rationale": "Each SYNTIZ track renders on the ColdFire in the frame interrupt. Measured on the author's MKII with the base's frame guard: a render costs about 15 % of a frame, up to 37 % after stock's trig work; two heavy tracks beside a THRU, three samples, a NEIGHBOR and a master compressor take the interrupt to 74 % of each frame (36 % without SYNTIZ) and the guard drops about two renders a second, unheard; three heavy tracks with long notes crackle. The base's guard renders a track's silent source rather than overrun; a Part admits three SYNTIZ tracks at most.", + "rationale": "Measured on 0.1.0; 0.1.1 renders the same samples with less work a frame, not yet measured on a unit. Each SYNTIZ track renders on the ColdFire in the frame interrupt. Measured on the author's MKII with the base's frame guard: a render costs about 15 % of a frame, up to 37 % after stock's trig work; two heavy tracks beside a THRU, three samples, a NEIGHBOR and a master compressor take the interrupt to 74 % of each frame (36 % without SYNTIZ) and the guard drops about two renders a second, unheard; three heavy tracks with long notes crackle. The base's guard renders a track's silent source rather than overrun; a Part admits three SYNTIZ tracks at most.", "source": "evidence/performance.json" }, "dsp": { @@ -12254,15 +12254,15 @@ "memory": { "level": "low", "basis": "source-estimate", - "rationale": "73,304 bytes of ColdFire code, tables and state in DRAM, from the package; no heap.", - "source": "evidence/hardware.md" + "rationale": "66,652 bytes of ColdFire code, tables and state in DRAM, from the package; no heap.", + "source": "TESTING.md" } } }, "tests": { "report": "TESTING.md", - "summary": "Host: 5,376 extreme renders of the six models under sanitizers, levels, DC, aliasing, pitch within 1.5 cents of stock's curve, every knob byte, package rebuilt byte for byte (verify.py). Emulator: chooser, pages, model list, notes for every model. The author's MKIIs, 28 Oct to 7 Nov 2026, this package since 31 Oct: six models over USB, projects back after power cycles, a fourth track refused, his live set measured with the base's guard (two SYNTIZ tracks beside a THRU, three samples, NEIGHBOR and a compressor: 74 % of a frame, nothing heard). Open: MKI, mute module, MIDI flood.", - "hardwareStatus": "reported", + "summary": "0.1.1: the same samples as 0.1.0 bit for bit (host matrix of 5.8 million samples under sanitizers, 300 random scenarios through the machine glue on an emulated ColdFire), about a quarter fewer instructions and half the memory operands a frame in the emulator; not yet on a unit. 0.1.0 on the author's MKIIs, 28 Oct to 7 Nov 2026: six models over USB, projects back after power cycles, a fourth track refused, his live set at 74 % of a frame with two SYNTIZ tracks, nothing heard. Open: MKI, mute module, MIDI flood.", + "hardwareStatus": "untested", "evidenceRevision": "b36c79977dc4470d497c39f723ba8536fb865efe", "gates": [ "modules/syntiz/verify.py" @@ -12284,115 +12284,6 @@ "media/ot-table-src.png" ], "screenshotStyle": "black-and-white" - }, - "qualification": { - "documentation": { - "tutorial": { - "title": "Quick tutorial: play a SYNTIZ track", - "steps": [ - "Select an audio track, hold FUNC and press SRC: SRC SETUP's machine list opens. Go DOWN to SYNTIZ and press YES.", - "Tap the track key twice quickly: the model list opens, 001 SAW to 006 CHOIR. Pick one with the arrows and YES; LEFT goes back to the machine list.", - "Press SRC for the model's page and turn the encoders; FUNC + SRC again shows SETUP, where OCT moves the register and DRIV adds drive.", - "Place trigs or play the trig keys in chromatic mode: the track's filter, AMP envelope, LFOs and effects shape the sound as they would a sample's." - ] - }, - "screenshots": [ - "media/ot-chooser.png", - "media/ot-model-list.png", - "media/ot-saw-src.png", - "media/ot-table-src.png" - ], - "screenshotStyle": "black-and-white" - }, - "moduleVersion": "0.1.0-experimental", - "sourceSha256": "6fb4883386f10e512da989a97b4d748e69d2ade1bffdfd10bcac30ab1b5bc163", - "imageSha256": "f501a6a4ea3c8361427b85302fc77274906b9de2e3dfd6f3c81bc1759767c5e8", - "cycles": [ - { - "processor": "coldfire", - "worstCase": 35536, - "maxConfiguration": 35536, - "maxInstances": 3, - "budget": 95782, - "unit": "cycles/event", - "method": "hardware", - "conditions": { - "parameterExtremes": "The dearest render measured was a SAW with both detuned pairs, both subs and DRIV, filter and chorus on the track, holding a long note: 37.1 % of a frame as the second call of a frame with a trig, 16.2 % at most as a first call (7 Nov 2026). Three tracks at their heaviest (CHOIR and ENS with three chord notes, SAW with both pairs, all with CHOR, SUB, SUB2 and DRIV at maximum) averaged 48.2 % of each frame together (31 Oct). Under qemu the heaviest branch is ENS with a four-note chord and chorus, 6,372 instructions a frame, SAW 4,044 (tools/count_cf.sh); the host matrix renders every model with every control at 0, 1, 63, 64, 65, 126 and 127.", - "parameterModulation": "SRC controls are the track's own: locks, scenes and LFOs on them reach the render through the Part's bytes each frame, as a FLEX track's. The author's live runs turned encoders and switched scenes while playing (7 Nov, measure 3 and 4); the cost per render did not depend on it, and no control-update path exists apart from reading the bytes.", - "modeSwitching": "Model changes rewrite the DSP halfwords as a lock would; STOP/PLAY, pattern and scene changes were part of the live runs (7 Nov); a trig in the frame splits the render in two calls, and the second is the dearest case recorded. Choosing SYNTIZ for a fourth track is refused (31 Oct, on the unit). RTRG restarts the oscillators at each trig with no extra cost measured.", - "maxLoad": "Three SYNTIZ tracks a Part. Three second-call renders in one frame would sum to 106,608 cycles, more than the 95,782-cycle frame: the base's guard then renders a track's silent source for that frame (16 samples) rather than overrun. Measured: three heavy tracks with long notes and four long samples dropped 24 to 75 renders in 120 s, a crackle the author hears (3 Nov); two SYNTIZ tracks beside a THRU, three samples, a NEIGHBOR with flanger and a master compressor, 73.8 % of each frame, 259 dropped in 120 s, unheard (7 Nov); the same with two samples, 69.3 %, none dropped. Budget basis: one frame, 362.8 us, 95,782 cycles at 264 MHz, 80 % of it for the whole frame interrupt (stock about 34-36 % on these sets, 103.7 % in its worst frame).", - "inputConditions": "The render takes no input: it makes its samples from the Part's bytes. Silence costs the same as a note (the oscillators run unless RTRG restarts them); a note above Nyquist is silent; the subs are silent below 25 Hz. The author's MKII, OS 1.40C, package f501a6a4, the base's guard with its 80 % share; one run per case; counts of the 132 MHz timer converted to 264 MHz cycles." - }, - "report": "evidence/performance.json" - } - ], - "memory": { - "regions": [ - { - "name": "ColdFire code and the 32 tables (engine.o, DRAM)", - "space": "sdram", - "words": 49051, - "wordBits": 8, - "bytes": 49051, - "scope": "shared" - }, - { - "name": "Knob map (machine_map.o)", - "space": "sdram", - "words": 788, - "wordBits": 8, - "bytes": 788, - "scope": "shared" - }, - { - "name": "Machine glue, code and data (machine.o)", - "space": "sdram", - "words": 3381, - "wordBits": 8, - "bytes": 3381, - "scope": "shared" - }, - { - "name": "Image alignment and the two hook records", - "space": "sdram", - "words": 280, - "wordBits": 8, - "bytes": 280, - "scope": "shared" - }, - { - "name": "State (bss): eight tracks' oscillators and chorus lines, the three page records", - "space": "sdram", - "words": 19804, - "wordBits": 8, - "bytes": 19804, - "scope": "shared" - } - ], - "perInstanceBytes": 0, - "sharedBytes": 73304, - "maxInstances": 3, - "totalBytes": 73304, - "conditions": "From the USB package f501a6a4 (build.py: 53,500 bytes of code and data, 19,804 of bss, 174 relocations) and m68k-elf-size of the three objects compiled with build.py's flags (engine 49,051 text, machine_map 788, machine 3,377 text and 4 data; the 280 bytes left are the image's alignment and its hook records). State is allocated for all eight tracks whatever the Part holds, so it is shared, not per instance. No DSP memory, no heap, no stock code written (the base owns the chooser and SRC SETUP). The render runs on the base's frame-interrupt stack; its depth was not measured (no canary).", - "report": "evidence/hardware.md" - }, - "hardware": { - "kind": "functional", - "status": "reported", - "model": "MKII", - "testedOn": "2026-11-07", - "tester": "stigmagit (the author, on his own MKII, driven over USB from his Claude Code session)", - "sourceRevision": "b36c79977dc4470d497c39f723ba8536fb865efe", - "imageSha256": "f501a6a4ea3c8361427b85302fc77274906b9de2e3dfd6f3c81bc1759767c5e8", - "summary": "The author's Octatrack MKII, OS 1.40C, flashed with his private base 86388105 (Modwerk's base of 31 October with --raise and a start logo); this package f501a6a4 kept over USB since 31 October 2026, beside FM Synth 0.1.2 until 7 November. 7 November 2026, on a RAM-booted development twin (7bce173d) of that base, the base's frame guard, 120 s a run, the author at the keys: his reference set (THRU, two samples, THRU, SAW heavy with filter and chorus, TABLE with filter and chorus, NEIGHBOR with flanger, master compressor) 60 % of each frame with the pattern alone and 69 % played live, no render dropped, no crackle heard; his complete set (a third sample) 74 %, 259 renders dropped in 120 s, nothing heard. Power-cycled twice back onto the flashed base: do inventory lists syntiz alone, nothing missing, the set plays. Reported by the author since 28 October (earlier packages, two MKIIs): the six models play, projects saved with SYNTIZ tracks come back after a power cycle; since 31 October, this package: a fourth SYNTIZ track is refused, three heavy tracks with long notes crackle. With FM Synth installed but never played the SYNTIZ tracks crackled lightly; removing it cured it (one A/B, 7 November).", - "limitations": [ - "One MKII with this package (a second MKII ran an earlier package on 29 October); no MKI.", - "The measurements come from the author's own development twins of his base, not Modwerk's beta base, and from his own sets, one run each; on 3 November the same run repeated gave 24 to 75 dropped renders.", - "Not run: a mute module's muted trigs, the level against a FLEX sample measured, a MIDI flood, a stress project with eight tracks and three LFOs a track.", - "Three heavy SYNTIZ tracks holding long notes still crackle at moments: the three-track limit bounds the load, it does not make the worst frame fit." - ], - "report": "evidence/hardware.md" - } } }, "license": { diff --git a/src/community/module-changelogs/syntiz.json b/src/community/module-changelogs/syntiz.json index a6700e85ca..f70aca06e1 100644 --- a/src/community/module-changelogs/syntiz.json +++ b/src/community/module-changelogs/syntiz.json @@ -1,4 +1,12 @@ [ + { + "version": "0.1.1-experimental", + "date": "2026-11-22", + "changes": [ + "SYNTIZ makes the same sound with less ColdFire work in every frame, so its tracks leave more room for the rest of a set.", + "Known issue: the lower cost is not yet measured on a unit." + ] + }, { "version": "0.1.0-experimental", "date": "2026-10-31", diff --git a/src/engine/assets/octatrack-module-packages.json b/src/engine/assets/octatrack-module-packages.json index e56a236d9a..4171dc5555 100644 --- a/src/engine/assets/octatrack-module-packages.json +++ b/src/engine/assets/octatrack-module-packages.json @@ -576,8 +576,8 @@ "SETUP_ALL" ] }, - "version": "0.1.0-experimental", - "path": "octatrack-modules/syntiz/0.1.0-experimental.mwrm", + "version": "0.1.1-experimental", + "path": "octatrack-modules/syntiz/0.1.1-experimental.mwrm", "abi": 8, "features": 128, "sites": 0, @@ -585,8 +585,8 @@ "fills": 0, "name": "syntiz", "module": "970f03ad", - "bytes": 54416, - "sha256": "f501a6a4ea3c8361427b85302fc77274906b9de2e3dfd6f3c81bc1759767c5e8" + "bytes": 46944, + "sha256": "c3a97ecc50c92b305a45fcd6cf75d3f48a194538891c5398eedfa5f3aad39df5" }, { "id": "track-solo", From 32df915a67ea7774fa8882af6dd93ce60dac6494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20A=C3=9Ffalg?= <67785539+repeat98@users.noreply.github.com> Date: Mon, 23 Nov 2026 15:35:25 +0100 Subject: [PATCH 2/4] SYNTIZ 0.1.1: frame cost and admission on base 0.8 (first 18.6, each 5.5) Measured with the release cost procedure (#2043) on a 0.8 development twin (678843cc), Dev17 C04, picks on C02: first instance read at 97.7 % of a frame, admitted alone on the empty (56 %) and the medium pattern (95.4 %), no render dropped, no stall. Published 0.1.0 on the same twin and scene: first 27.5 (read at 101.1 %, saturated). Co-Authored-By: Claude Opus 5.5 --- sdk/machines/octatrack/frame-costs.json | 2 +- .../modules/syntiz/evidence/frame-cost.json | 55 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 sdk/octatrack/modules/syntiz/evidence/frame-cost.json diff --git a/sdk/machines/octatrack/frame-costs.json b/sdk/machines/octatrack/frame-costs.json index afe5a4b77c..ac1eb3e8a5 100644 --- a/sdk/machines/octatrack/frame-costs.json +++ b/sdk/machines/octatrack/frame-costs.json @@ -15,7 +15,7 @@ "ring-sc": {"first":0.8,"each":0,"rest":0,"points":[-1.4,0.8,-1.2,-0.1],"measured":"ring-sc 0.2.1-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples), picks on empty C02; owner's MKII; base 0.8 twin 28 053fd054; 8 s a reading; 2026-11-22"}, "sidechain-compressor": {"first":0.9,"each":0.5,"measured":"On T5 FX1, base 0.7.8: +0.5 on the mean (evidence/cpu-price.json); the longest frame not measured"}, "synth": {"first":31.3,"each":0.5,"rest":0,"points":[26.9,31.8,32.3,31.1],"measured":"synth 0.1.5-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples; stock alone 79.4 %), picks on empty C02; owner's MKII; base dce1d30e (0.8 development twin); 8 s a reading; 2026-11-22 (evidence/frame-cost.json)"}, - "syntiz": {"first":24.9,"each":4,"rest":0,"points":[19.5,28.9,32.9,33.6],"measured":"syntiz 0.1.0-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples; stock alone 79.4 %), picks on empty C02; base dce1d30e (0.8 twin); 8 s a reading; 2026-11-22 (npm run device:price -- --curve)"}, + "syntiz": {"first":18.6,"each":5.5,"rest":0,"points":[16.2,24.1,29.6,30.9],"measured":"syntiz 0.1.1-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples), picks on empty C02, Part 1; owner's MKII; base 678843cc (base 0.8 development twin, main b5864cce7); 8 s a reading; 2026-11-23 (evidence/frame-cost.json)"}, "tapeecho": {"first":11.5,"each":4.1,"rest":0,"points":[9.6,15.6,19.7,21.8],"measured":"tapeecho 0.1.9-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples), picks on empty C02, Part 1; owner's MKII; base 856cbbcf (0.8 development twin, base/octatrack-next 9ac83b232); 8 s a reading; 2026-11-23 (evidence/frame-cost.json)"}, "tapehead": {"first":0,"each":0,"rest":0,"points":[-0.4,-0.4,-1.3,0],"measured":"tapehead 0.1.2-experimental on T1 T3 T6 T7: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples), picks on empty C02; owner's MKII; base 0.8 twin 28 053fd054; 8 s a reading; 2026-11-22"}, "vector": {"first":0.2,"each":0,"rest":0,"points":[-0.6,0.2,-1.1],"measured":"vector 0.3.2-experimental on T1 T3 T6: Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples), picks on empty C02; owner's MKII; base 0.8 twin 28 053fd054; 8 s a reading; 2026-11-22; a phrase generator that writes stock trigs and locks (no render of its own): stock's playback of them is the reserve's, so this is its whole cost (modwerk-bd)"}, diff --git a/sdk/octatrack/modules/syntiz/evidence/frame-cost.json b/sdk/octatrack/modules/syntiz/evidence/frame-cost.json new file mode 100644 index 0000000000..a661355c70 --- /dev/null +++ b/sdk/octatrack/modules/syntiz/evidence/frame-cost.json @@ -0,0 +1,55 @@ +{ + "module": "syntiz", + "version": "0.1.1-experimental", + "base": "678843cc (base 0.8 development twin, main b5864cce7)", + "scene": "Dev17 C04 at 126 BPM, trigs on steps 1/5/9/13 of T1-T4, T6, T7 (T2 and T4 play samples), picks on empty C02, Part 1; owner's MKII", + "seconds": 8, + "measuredAt": "2026-11-23T14:28:21.043Z", + "tracks": [ + "T1", + "T3", + "T6", + "T7" + ], + "rest": 0, + "first": 18.6, + "each": 5.5, + "points": [ + 81.5, + 97.7, + 105.6, + 111.1, + 112.4 + ], + "adds": [ + 16.2, + 24.1, + 29.6, + 30.9 + ], + "admission": [ + { + "pattern": "empty", + "number": 2, + "track": "T1", + "seconds": 8, + "admitted": true, + "frameMax": 56, + "frame": 36.9, + "dropped": 0, + "stalls": 0 + }, + { + "pattern": "medium", + "number": 4, + "track": "T1", + "seconds": 8, + "admitted": true, + "frameMax": 95.4, + "frame": 48.6, + "dropped": 0, + "stalls": 0 + } + ], + "notes": [] +} From 86f775ed9ebf597a49a4b7a93d4c125c1329e056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20A=C3=9Ffalg?= <67785539+repeat98@users.noreply.github.com> Date: Tue, 24 Nov 2026 10:30:33 +0100 Subject: [PATCH 3/4] SYNTIZ 0.1.1: the owner's approval record Adds the owner's approval for SYNTIZ 0.1.1-experimental (source a354b178), waiving current-build hardware, chip worst-case cycles and release documentation, keeping 0.1.0's UI captures, after the #2043 cost run on base 0.8 (first copy 18.6 points, each further 5.5, admitted empty and medium). SYNTIZ now qualifies as an owner-approved update, so the qualification test lists it with the others. Co-Authored-By: Claude Opus 5.5 --- sdk/approvals/syntiz-build-approval.json | 14 ++++++++------ src/catalog/module-qualification.test.ts | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sdk/approvals/syntiz-build-approval.json b/sdk/approvals/syntiz-build-approval.json index 74755a4ad2..9d1cc67324 100644 --- a/sdk/approvals/syntiz-build-approval.json +++ b/sdk/approvals/syntiz-build-approval.json @@ -1,14 +1,16 @@ { "kind": "owner-approved-update", "id": "syntiz", - "version": "0.1.0-experimental", + "version": "0.1.1-experimental", "approvedBy": "repeat98", - "approvedOn": "2026-11-11", + "approvedOn": "2026-11-24", "waived": [ "current-build-hardware", - "chip-worst-case-cycles" + "chip-worst-case-cycles", + "release-documentation" ], - "sourceSha256": "6fb4883386f10e512da989a97b4d748e69d2ade1bffdfd10bcac30ab1b5bc163", - "ownerStatement": "Waiver offered by repeat98 on #1304 on 8 November 2026 (\"I'll waive the rows you asked about for 0.1.0-experimental, as I did for POLY8: chip-worst-case-cycles and current-build-hardware, for this exact source\"); release approved by repeat98 on 11 November 2026 (\"ok no let's release it\"), after the release session's run on his MKII found that a note held with AMP HOLD/REL at INF never ends and that Undo while tracks use SYNTIZ stays in recovery until a power cycle (TESTING.md, README limitations).", - "reason": "SYNTIZ renders its tracks' audio on the ColdFire in the frame interrupt, so its cost is a share of every frame, not a per-event cost the audit can bound: a render is about 15 % of a frame, up to 37 % after stock's trig work, and a fourth SYNTIZ track in a Part is refused. The base's frame guard drops a render rather than overrun. The author measured it on his MKII with his own bases and package f501a6a4 (evidence/performance.json, TESTING.md); no static cycle bound and no MIDI flood exist, and those numbers stay null. Waived for this exact source: chip worst-case cycles and the audit's current-build hardware rows (stock benchmark, stress)." + "retainedUiVersion": "0.1.0-experimental", + "sourceSha256": "a354b17840cc31fddc4aa20858f04a4885208515940698bb899ba798b4cb69d5", + "ownerStatement": "Approve SYNTIZ 0.1.1-experimental, the same sound for less ColdFire time, for this exact source, keeping 0.1.0's UI captures.", + "reason": "SYNTIZ 0.1.1 (#1978) renders the same samples as 0.1.0 for less ColdFire time: bit-exact over 5.8 million samples on the host and 2.9 million on the emulator. The #2043 cost procedure ran on a base 0.8 development twin (678843cc) on the owner's MKII: the first copy costs 18.6 points against 0.1.0's 27.5 and each further copy 5.5; it was admitted on an empty pattern at 56.0 % and on a medium one at 95.4 % (first reading 97.7 %), with no render dropped and no stall (evidence/frame-cost.json). On that busy scene (Dev17 C04, stock alone at 81.5 %) a second copy already reads 105.6 % of the frame and four copies 112.4 %, so several SYNTIZ tracks still need a pattern with room.Its controls, pages and labels are unchanged from 0.1.0, whose captures are retained. Not run on this build: the test procedure's screenshots, the MAIN/CUE recording and a listening check, the flashed base and an MKI; no static cycle bound exists." } diff --git a/src/catalog/module-qualification.test.ts b/src/catalog/module-qualification.test.ts index 42f83ccd3a..929916b3d1 100644 --- a/src/catalog/module-qualification.test.ts +++ b/src/catalog/module-qualification.test.ts @@ -89,7 +89,7 @@ describe('module qualification hard gates',()=>{ // Generated web documents include display-only baseline resource estimates. // Qualify the source manifest, as publication validation does. const source = parseModuleDocument(JSON.parse(readFileSync(resolve(folder, 'octamod.module.json'), 'utf8'))) - expect(await requireFolderQualification(folder, source, frozen)).toBe(unchanged ? 'retained' : source.tests.retainedEvidence ? 'retained-evidence' : ['miniverb', 'synth', 'usb-audio-out-tracks-main-cue', 'euclid', 'recorder-loop-fix', 'analog-bassdrum', 'airwindows-chorus', 'poly8', 'quantizer', 'everb', 'repitch', 'playmodes', 'tapeecho', 'amiga', 'temp-save', 'midi-scenes', 'kits', 'grain'].includes(module.id) ? 'owner-approved-update' : 'qualified') + expect(await requireFolderQualification(folder, source, frozen)).toBe(unchanged ? 'retained' : source.tests.retainedEvidence ? 'retained-evidence' : ['miniverb', 'synth', 'usb-audio-out-tracks-main-cue', 'euclid', 'recorder-loop-fix', 'analog-bassdrum', 'airwindows-chorus', 'poly8', 'quantizer', 'everb', 'repitch', 'playmodes', 'tapeecho', 'amiga', 'temp-save', 'midi-scenes', 'kits', 'grain', 'syntiz'].includes(module.id) ? 'owner-approved-update' : 'qualified') }) } it('binds an owner-approved update to its exact version and native source, never to verified hardware',async()=>{ From d14aa5803cfda1851ace0115de72b52fa2734ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannik=20A=C3=9Ffalg?= <67785539+repeat98@users.noreply.github.com> Date: Tue, 24 Nov 2026 10:56:11 +0100 Subject: [PATCH 4/4] SYNTIZ 0.1.1: the performance record names this version; checks follow the approval evidence/performance.json now names 0.1.1-experimental. Its figures stay 0.1.0's and its method text says so: 0.1.1 renders the same samples bit for bit in less ColdFire time, so they bound it from above, and its own reading is evidence/frame-cost.json. The approval's source hash follows the changed folder (39035e75), and a missing space in its reason is fixed. The resource gauge test counts SYNTIZ's approval as the qualification test already does, and no longer expects 0.1.0's 8.5 % active-load gauge, which is bound to 0.1.0's package. Co-Authored-By: Claude Opus 5.5 --- sdk/approvals/syntiz-build-approval.json | 4 ++-- sdk/octatrack/modules/syntiz/evidence/performance.json | 6 +++--- src/catalog/resource-indicators.test.ts | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/sdk/approvals/syntiz-build-approval.json b/sdk/approvals/syntiz-build-approval.json index 9d1cc67324..da8edc16f4 100644 --- a/sdk/approvals/syntiz-build-approval.json +++ b/sdk/approvals/syntiz-build-approval.json @@ -10,7 +10,7 @@ "release-documentation" ], "retainedUiVersion": "0.1.0-experimental", - "sourceSha256": "a354b17840cc31fddc4aa20858f04a4885208515940698bb899ba798b4cb69d5", + "sourceSha256": "39035e7545432df7447ae48fbc08d5cde02a5546a2e0a9f41ee64d0c75d5eebc", "ownerStatement": "Approve SYNTIZ 0.1.1-experimental, the same sound for less ColdFire time, for this exact source, keeping 0.1.0's UI captures.", - "reason": "SYNTIZ 0.1.1 (#1978) renders the same samples as 0.1.0 for less ColdFire time: bit-exact over 5.8 million samples on the host and 2.9 million on the emulator. The #2043 cost procedure ran on a base 0.8 development twin (678843cc) on the owner's MKII: the first copy costs 18.6 points against 0.1.0's 27.5 and each further copy 5.5; it was admitted on an empty pattern at 56.0 % and on a medium one at 95.4 % (first reading 97.7 %), with no render dropped and no stall (evidence/frame-cost.json). On that busy scene (Dev17 C04, stock alone at 81.5 %) a second copy already reads 105.6 % of the frame and four copies 112.4 %, so several SYNTIZ tracks still need a pattern with room.Its controls, pages and labels are unchanged from 0.1.0, whose captures are retained. Not run on this build: the test procedure's screenshots, the MAIN/CUE recording and a listening check, the flashed base and an MKI; no static cycle bound exists." + "reason": "SYNTIZ 0.1.1 (#1978) renders the same samples as 0.1.0 for less ColdFire time: bit-exact over 5.8 million samples on the host and 2.9 million on the emulator. The #2043 cost procedure ran on a base 0.8 development twin (678843cc) on the owner's MKII: the first copy costs 18.6 points against 0.1.0's 27.5 and each further copy 5.5; it was admitted on an empty pattern at 56.0 % and on a medium one at 95.4 % (first reading 97.7 %), with no render dropped and no stall (evidence/frame-cost.json). On that busy scene (Dev17 C04, stock alone at 81.5 %) a second copy already reads 105.6 % of the frame and four copies 112.4 %, so several SYNTIZ tracks still need a pattern with room. Its controls, pages and labels are unchanged from 0.1.0, whose captures are retained. Not run on this build: the test procedure's screenshots, the MAIN/CUE recording and a listening check, the flashed base and an MKI; no static cycle bound exists." } diff --git a/sdk/octatrack/modules/syntiz/evidence/performance.json b/sdk/octatrack/modules/syntiz/evidence/performance.json index 54f592c807..0ff7f5a2c5 100644 --- a/sdk/octatrack/modules/syntiz/evidence/performance.json +++ b/sdk/octatrack/modules/syntiz/evidence/performance.json @@ -1,14 +1,14 @@ { "schema": 1, "module": "syntiz", - "version": "0.1.0-experimental", + "version": "0.1.1-experimental", "kind": "coldfire", "cycles": { "unit": "cycles/event", "static": null, "measured": 35536, "budget": 95782, - "method": "An event is one track's render for one 16-sample frame, called by the base in the frame interrupt (two calls when a trig falls inside the frame, split at its sample offset). The budget is the whole frame, the render's deadline: 362.8 us, 47,891 counts of the 132 MHz timer, 95,782 cycles at 264 MHz; the base's guard lets the interrupt use 80 % of it. Measured on the author's MKII, 7 November 2026, with the base's frame guard (npm run device -- do guard) and the per-render timers of a RAM-booted development twin (diag v3, 7bce173d) of his flashed base 86388105, package f501a6a4, 120 s a run, the author playing his live set: the dearest single render was the second call of a frame holding a trig, 37.1 % of the frame (35,536 cycles, a heavy SAW with both detuned pairs, both subs, DRIV, filter and chorus on the track), while no first call of a frame passed 16.2 % (15,517). The same ratio, 1.8 to 2.4, was seen in every run from 3 to 7 November on three bases; its cause was not found (not code size: a build with half the code cost more; not the samples' starts; stock's START is never called on a SYNTIZ track). At the three-track limit three such renders in one frame would sum to 106,608 cycles, above the frame: the guard then drops a render, 16 samples of silence on that track. Three heavy tracks measured together on 31 October (twin 04e94075, same package, each holding a note at its heaviest): 48.2 % of each frame on average over 120 s, 16.1 % a track, 2 renders dropped, longest frame 109.6 %. A static bound is not established: under qemu cfv4e the render executes at most 6,372 instructions (ENS, tools/count_cf.sh), 4,044 for a heavy SAW, but on the unit the same render costs about 2.5 cycles an instruction warm and up to about 8.8 cold (the 37.1 % render)." + "method": "These figures were measured on 0.1.0-experimental and are carried to 0.1.1-experimental under the owner’s approval of 24 November 2026 (sdk/approvals/syntiz-build-approval.json): 0.1.1 renders the same samples bit for bit in less ColdFire time, so they bound it from above. 0.1.1’s own reading is its instance curve on base 0.8 (evidence/frame-cost.json: first copy 18.6 points against 0.1.0’s 27.5). An event is one track's render for one 16-sample frame, called by the base in the frame interrupt (two calls when a trig falls inside the frame, split at its sample offset). The budget is the whole frame, the render's deadline: 362.8 us, 47,891 counts of the 132 MHz timer, 95,782 cycles at 264 MHz; the base's guard lets the interrupt use 80 % of it. Measured on the author's MKII, 7 November 2026, with the base's frame guard (npm run device -- do guard) and the per-render timers of a RAM-booted development twin (diag v3, 7bce173d) of his flashed base 86388105, package f501a6a4, 120 s a run, the author playing his live set: the dearest single render was the second call of a frame holding a trig, 37.1 % of the frame (35,536 cycles, a heavy SAW with both detuned pairs, both subs, DRIV, filter and chorus on the track), while no first call of a frame passed 16.2 % (15,517). The same ratio, 1.8 to 2.4, was seen in every run from 3 to 7 November on three bases; its cause was not found (not code size: a build with half the code cost more; not the samples' starts; stock's START is never called on a SYNTIZ track). At the three-track limit three such renders in one frame would sum to 106,608 cycles, above the frame: the guard then drops a render, 16 samples of silence on that track. Three heavy tracks measured together on 31 October (twin 04e94075, same package, each holding a note at its heaviest): 48.2 % of each frame on average over 120 s, 16.1 % a track, 2 renders dropped, longest frame 109.6 %. A static bound is not established: under qemu cfv4e the render executes at most 6,372 instructions (ENS, tools/count_cf.sh), 4,044 for a heavy SAW, but on the unit the same render costs about 2.5 cycles an instruction warm and up to about 8.8 cold (the 37.1 % render)." }, "load": { "frameUs": null, @@ -16,7 +16,7 @@ "moduleLongestUs": null, "stockIdlePercent": null, "moduleIdlePercent": null, - "method": "The base's frame guard (npm run device -- do guard), not cfmeter.py, on the RAM-booted development twin 7bce173d of the author's MKII base, 7 November 2026, package f501a6a4, the guard's share 80 %: the author's complete live set (T1 THRU, T2-T4 three samples, T5 SAW with both detuned pairs, both subs, filter and chorus, T6 TABLE with filter and chorus, T7 NEIGHBOR with flanger, T8 master compressor), long notes, the author playing it as on stage (STOP/PLAY, scenes, encoders). Without SYNTIZ loaded, the first 15,935 frames of the run: 36.3 % of each frame in the frame interrupt, longest frame 103.7 % (376.2 us: stock's own peaks at transitions). With SYNTIZ on T5 and T6, 344,936 frames: 73.8 %, longest 114.1 % (414.0 us), 259 renders dropped by the guard in 120 s (about two a second, on T5 and T6), the guard's credit exhausted at moments (minimum -2.6 %); the author heard nothing and called it clean. Idle is 100 minus the interrupt's share. The same set with two samples instead of three (his reference set): 69.3 % while playing, longest 111.2 %, 0 renders dropped; the pattern playing alone, 60.3 %, longest 94.5 %, 0 dropped. A render is about 15 % of a frame, so the longest-frame rise and the idle fall are far above the audit's 10 % rule: the owner waived these rows for 0.1.0-experimental on the release pull request, 8 November 2026." + "method": "These figures were measured on 0.1.0-experimental and are carried to 0.1.1-experimental under the owner’s approval of 24 November 2026 (sdk/approvals/syntiz-build-approval.json): 0.1.1 renders the same samples bit for bit in less ColdFire time, so they bound it from above. 0.1.1’s own reading is its instance curve on base 0.8 (evidence/frame-cost.json: first copy 18.6 points against 0.1.0’s 27.5). The base's frame guard (npm run device -- do guard), not cfmeter.py, on the RAM-booted development twin 7bce173d of the author's MKII base, 7 November 2026, package f501a6a4, the guard's share 80 %: the author's complete live set (T1 THRU, T2-T4 three samples, T5 SAW with both detuned pairs, both subs, filter and chorus, T6 TABLE with filter and chorus, T7 NEIGHBOR with flanger, T8 master compressor), long notes, the author playing it as on stage (STOP/PLAY, scenes, encoders). Without SYNTIZ loaded, the first 15,935 frames of the run: 36.3 % of each frame in the frame interrupt, longest frame 103.7 % (376.2 us: stock's own peaks at transitions). With SYNTIZ on T5 and T6, 344,936 frames: 73.8 %, longest 114.1 % (414.0 us), 259 renders dropped by the guard in 120 s (about two a second, on T5 and T6), the guard's credit exhausted at moments (minimum -2.6 %); the author heard nothing and called it clean. Idle is 100 minus the interrupt's share. The same set with two samples instead of three (his reference set): 69.3 % while playing, longest 111.2 %, 0 renders dropped; the pattern playing alone, 60.3 %, longest 94.5 %, 0 dropped. A render is about 15 % of a frame, so the longest-frame rise and the idle fall are far above the audit's 10 % rule: the owner waived these rows for 0.1.0-experimental on the release pull request, 8 November 2026." }, "stress": { "floodMessagesPerSecond": null, diff --git a/src/catalog/resource-indicators.test.ts b/src/catalog/resource-indicators.test.ts index cd97e26903..36202603ca 100644 --- a/src/catalog/resource-indicators.test.ts +++ b/src/catalog/resource-indicators.test.ts @@ -23,6 +23,7 @@ import amigaApproval from '../../sdk/approvals/amiga-build-approval.json' import tempSaveApproval from '../../sdk/approvals/temp-save-build-approval.json' import kitsApproval from '../../sdk/approvals/kits-build-approval.json' import grainApproval from '../../sdk/approvals/grain-build-approval.json' +import syntizApproval from '../../sdk/approvals/syntiz-build-approval.json' import sdkCatalog from '../../sdk/catalog.json' import packageManifest from '../engine/assets/octatrack-module-packages.json' @@ -33,7 +34,7 @@ describe('module resource gauges', () => { it('populates CPU, DSP and memory for every current version without inventing measurements', () => { expect(MODULE_DOCUMENTS).toHaveLength(sdkCatalog.modules.length) // Only versions under an owner exception may go without a qualification record; none is invented for them. - const exempt = new Set([...baseline.modules, ...waivers.modules, synthApproval, muteApproval, recorderApproval, airChorusApproval, poly8Approval, everbApproval, playmodesApproval, amigaApproval, tempSaveApproval, kitsApproval, grainApproval].map(module => module.id)) + const exempt = new Set([...baseline.modules, ...waivers.modules, synthApproval, muteApproval, recorderApproval, airChorusApproval, poly8Approval, everbApproval, playmodesApproval, amigaApproval, tempSaveApproval, kitsApproval, grainApproval, syntizApproval].map(module => module.id)) for (const document of MODULE_DOCUMENTS) { const indicators = moduleResourceIndicators(document) expect(indicators.map(indicator => indicator.id)).toEqual(['cpu', 'dsp', 'memory']) @@ -121,7 +122,7 @@ describe('module resource gauges', () => { it('shows the measured active CPU load when an Octatrack build has a verified workload', () => { const analog = MODULE_DOCUMENTS.find(module => module.id === 'analog-bassdrum')! for (const [id, value] of [ - ['amiga', '7.4%'], ['analog-bassdrum', '10.1%'], ['poly8', '41.9%'], ['syntiz', '8.5%'], + ['amiga', '7.4%'], ['analog-bassdrum', '10.1%'], ['poly8', '41.9%'], ['vector', '0.6%'], ]) { const document = MODULE_DOCUMENTS.find(module => module.id === id)!