V10.8.27: JIANT BYTE's DRONE CLAY fix (1adbf0a6 + d7f32b11, GPL, without its keys): each modulator its own RATE on the bar's grid (1/64 .. 4BAR, dotted, triplets, polyrhythms), PITCH -24..+36, the HITs a drum on any engine (a DRUM track's pads), FM xN a sine at its ratio, one MOD on CLAY MOD / CLAY RHYTHM (pages DRONE CLAY, CLAY MOD, CLAY RHYTHM, CLAY TIME), the drone held on any envelope; 'C' 'L' blocks, an older 'C' 'Y' read; PUNCH LANE's page out (the lane kept: GEN and REC); its flash from the help texts (the owner): the song mode's hints, LIFE's and CHORD's knob hints, SCENE's role lines, the STEP FX / parts / name footers' hints and confirm subtitles shortened or gone; the mirror's state in the RAM (the pool's 8 KiB); tests: clay_test on the new settings and an older block, tests/clay_engines_test.c (BYTE's, on FM's engines) in CI; layout re-recorded (REPIN=keep)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KMHk6yH4XbP1xxHYKCo9Mh
This commit is contained in:
Claude committed 2026-11-24 10:50:30 +00:00
1 parent f9954c4727
commit 5bf1bb77a3
26 files changed
+2818 -2631

No files matched your search

+2
View File
@@ -182,6 +182,8 @@ jobs:
build/song-check/stepfx | tee build/song-check/stepfx.log
cc -O1 -w -Wno-implicit-function-declaration -Ibuild/gen -Ifirmware/src -Itests tests/clay_test.c -lm -o build/song-check/clay
build/song-check/clay | tee build/song-check/clay.log
cc -O1 -w -Wno-implicit-function-declaration -Ibuild/gen -Ifirmware/src -Itests tests/clay_engines_test.c -lm -o build/song-check/clay-engines
build/song-check/clay-engines | tee build/song-check/clay-engines.log
cc -O1 -w -Wno-implicit-function-declaration -Ibuild/gen -Ifirmware/src tests/life_test.c -lm -o build/song-check/life
build/song-check/life | tee build/song-check/life.log
cc -O1 -w -Wno-implicit-function-declaration -Ibuild/gen -Ifirmware/src tests/fill_test.c -lm -o build/song-check/fill
+154 -52
View File
@@ -1,43 +1,70 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant) */
/* (V10.8.21) JIANT BYTE's DRONE CLAY (GPL, its clay.c of 93e9eb1), ported: CL_N as CLAY_NF (fx.c's CL_N is CLOUD's),
* the state in the bss (zeroed at power-on: no clay_boot), no FORM part to migrate, no white punch-ins' time here */
* the state in the bss (zeroed at power-on: no clay_boot), no FORM part to migrate, no white punch-ins' time here;
* (V10.8.27) BYTE's 1adbf0a6 + d7f32b11 without its keys (FM's DRONE CLAY has none): each modulator its own RATE, PITCH,
* the HITs a drum on any engine (a DRUM track's own pads), one MOD on CLAY MOD / CLAY RHYTHM, 'C' 'L' ('C' 'Y' read) */
/* (BYTE) DRONE CLAY, a track's sequencer (the owner: FORM out as an engine; "the voice the track has, a drone,
* endless timbres"). Each audio block, before the parts (fx.c mix_block, after the macros): for every track with it
* ON and running (RUN SONG: while the transport plays; FREE: always), FORM's composer (eng_form.c) on the track's
* settings: the euclids strike gestures on the STEP, the gestures summed into what each modulator adds now (clay_v,
* settings: each modulator's euclid strikes a gesture on its own RATE's steps, the gestures summed into what each
* modulator adds now (clay_vk,
* mod.c mod_begin moves its DEST with it); a NOTE gesture (ARP, CHORD ..) a real note on the voice, on the scale,
* two octaves over the drone; the drone itself, a very low note (C0 .. C3 on the track's ROOT) held, or struck again
* every RATE. Off, stopped, muted: its notes end. Included by seq.c (its notes, the scale) */
static void ui_message(const char *s); /* (ui.c) */
static uint32_t clay_free; /* (FREE stopped: its own beat, Q16) */
static int16_t clay_sp[CLAY_SPN]; /* (the audio's FORM slots: clay_fill) */
static uint32_t clay_b0[NTRK], clay_pq[NTRK]; /* (BYTE's ff242c4) a punch-in's restart: the time it began; what was held */
static int16_t clay_sp[18] __attribute__((used)); /* (V10.8.21's, kept in place, unused: the RAM after it where it was) */
uint32_t clay_rng; /* (clay_tick's noise; not static: after the RAM's others) */
static void clay_stop(uint32_t tr)
{
track_t *t = &trk[tr];
form_st_t *st = &form_st[tr];
if (clay_dn[tr]) seq_note_off(t, clay_dn[tr]);
if (clay_nn[tr]) seq_note_off(t, clay_nn[tr]);
clay_dn[tr] = clay_nn[tr] = 0;
clay_v[tr][0] = clay_v[tr][1] = clay_v[tr][2] = clay_v[tr][3] = 0;
if (st->pn) seq_note_off(t, st->pn);
clay_dn[tr] = clay_nn[tr] = st->pn = st->rt = 0;
st->mv[0] = st->mv[1] = st->mv[2] = st->mv[3] = 0;
st->hb.on = 0;
form_lit[tr] = 0;
}
/* (BYTE's 1adbf0a6) modulator m strikes its SHAPE: a gesture held for its DECAY, then let go; a HIT on a DRUM track its
* own pad (its GM note, let go a few blocks on), on a voice that does not sustain (SUS under 3/4: a pluck, any
* engine's) the drone struck again with it */
static void clay_strike(uint32_t tr, track_t *t, form_st_t *st, uint32_t m, uint32_t sh, uint32_t vel)
{
form_spawn(st, sh, m, vel, 0u, 64u + (uint32_t)clamp(clay[tr][CL_MF(m, 4u)], 0, 127) * 32u, 0u);
form_lit[tr] |= (uint8_t)(1u << m);
if (sh / 12u != FPG_HIT)
return;
if (drum_track(t)) {
if (st->pn) seq_note_off(t, st->pn);
st->pn = CLAY_HIT[sh % 12u].gm;
st->pt = 8u;
seq_note_on(t, st->pn, clamp(vel, 1, 127));
} else if (t->p[P_SUS] < 96 && vel > st->rt)
st->rt = (uint8_t)vel;
}
static __attribute__((noinline)) void clay_tick(uint32_t n)
{
static const uint32_t PER[8] = {0, 16u << 16, 8u << 16, 4u << 16, 2u << 16, 1u << 16, 1u << 15, 1u << 14};
uint32_t s16 = div_samples(2), bps = beat_samples(), b, tr, k;
if (song.playing && clk_pos != CLK_START)
b = (((uint32_t)clk_n << 16) + ((uint32_t)clk_pos << 16) / (s16 ? s16 : 1u)) >> 2;
uint32_t s16 = div_samples(2), bps = beat_samples(), b, tr, k, playing = song.playing && clk_pos != CLK_START;
if (playing) /* (Q16 beats from PLAY: the bar's start; wraps at 16384 bars) */
b = ((clk_n & 0x3FFFFu) << 14) + (clk_pos << 14) / (s16 ? s16 : 1u);
else
b = clay_free += (n << 16) / (bps | 1u);
for (tr = 0; tr < NTRK; tr++) {
track_t *t = &trk[tr];
const int16_t *c = clay[tr];
const clay_t *c = clay[tr];
form_st_t *st = &form_st[tr];
uint32_t end = b, seed = (uint32_t)clamp(c[CL_SEED], 0, 127) * 977u + 1u, root, dn;
int32_t D[FV_N] = {0};
uint32_t end = b, seed = (uint32_t)clamp(c[CL_SEED], 0, 127) * 977u + 1u, root, dn, drum = drum_track(t), duck = 0;
clay_out_t o;
if (st->pt && !--st->pt && st->pn) { /* (a DRUM track's pad let go) */
seq_note_off(t, st->pn);
st->pn = 0;
}
if (!c[CL_ON] || tr >= trk_live || t->p[P_MUTE] || (!song.playing && c[CL_RUN] != 1)) {
if (clay_dn[tr] | clay_nn[tr] | form_lit[tr]) clay_stop(tr);
if (clay_dn[tr] | clay_nn[tr] | st->pn | form_lit[tr] | st->hb.on) clay_stop(tr);
continue;
}
{ /* (BYTE's ff242c4, the owner) a punch-in on the time or the pitch: the composition from its first hit, the moment
@@ -50,47 +77,75 @@ static __attribute__((noinline)) void clay_tick(uint32_t n)
}
end = b - clay_b0[tr];
}
clay_fill(c, clay_sp);
st->clk += (n << 18) / (bps ? bps : 1u);
for (k = 0; k < 4u; k++) { /* each modulator on the STEP: its euclid strikes a gesture */
int32_t ds = (int32_t)form_vds_x(clay_sp, FORM_MC, k), dec = clamp(clay_sp[FORM_MC[k][3]], 0, 127);
uint32_t s1 = end >> (16 - form_mexpo(clay_sp, ds));
if ((int32_t)s1 == st->lastm[k]) continue;
st->lastm[k] = (int32_t)s1;
for (k = 0; k < 4u; k++) { /* each modulator on its own RATE's steps: its euclid strikes */
uint32_t eu = (uint32_t)clamp(c[CL_MF(k, 2u)], 0, CLAY_NEU - 1), s1 = clay_step(end, (uint32_t)clamp(c[CL_MF(k, 5u)], 0, CLAY_NRES - 1));
if (clay_is_hit(c, k) && eu && c[CL_MF(k, 3u)] > (int32_t)duck)
duck = (uint32_t)c[CL_MF(k, 3u)]; /* (a HIT on the beat: the drone ducked by its AMOUNT between) */
if ((int16_t)s1 == st->lastm[k]) continue;
st->lastm[k] = (int16_t)s1;
form_lit[tr] = (uint8_t)(form_lit[tr] & ~(1u << k));
if (form_hit(clay_sp, k, s1, seed)) {
form_spawn(st, (uint32_t)((ds & 511) >> 3), k, (s1 & 3u) ? 90u : 127u, 0u, 64u + (uint32_t)dec * 32u, 0u);
form_lit[tr] |= (uint8_t)(1u << k);
}
if (form_hit(eu, k, s1, seed))
clay_strike(tr, t, st, k, clay_sh(c[CL_MF(k, 1u)]), (s1 & 3u) ? 90u : 127u);
}
form_eval(st, clay_sp, D, t->at);
for (k = 0; k < 4u; k++)
clay_v[tr][k] = (int16_t)clamp(st->mv[k] * 256, -32767, 32767);
clay_eval(st, c, &o, t->at);
root = (uint32_t)clamp(t->p[P_ROOT], 0, 11);
dn = 12u * (uint32_t)(clamp(c[CL_OCT], 0, 3) + 1) + root; /* the drone: C0 .. C3 on the ROOT */
dn = (uint32_t)clamp(12 * (clamp(c[CL_OCT], 0, 3) + 1) + (int32_t)root + clamp(c[CL_PIT], -24, 36), 1, 127);
/* the drone: C0 .. C3 on the ROOT, PITCH */
if (drum) /* (a DRUM track: its pads, no drone) */
st->hb.on = 0;
else { /* the HITs' bundle (mod.c clay_mod) */
int32_t dq = (int32_t)duck * 258, hg = clamp(o.hg, 0, 32767), pit = 0;
if (o.ha) { /* (the loudest's pitch, back to the drone's as it fades) */
int32_t w = o.ha * 3 > 32767 ? 32767 : o.ha * 3;
pit = (o.hp - (int32_t)dn * 16) * w >> 15;
}
if (o.hn > 0) { /* (the noise: the pitch thrown each block) */
int32_t nz = clamp(o.hn >> 11, 0, 30 * 16);
clay_rng = clay_rng * 1664525u + 1013904223u;
pit += ((int32_t)(clay_rng >> 24) - 128) * nz >> 7;
}
st->hb.pit = (int16_t)clamp(pit, -2047, 2047);
st->hb.gain = (int16_t)clamp(32767 - dq + (dq * hg >> 15), 0, 32767);
st->hb.cut = (int16_t)((clamp(o.hc, -1966080, 1966080) >> 6) * 5 >> 3); /* (% x Q15 -> Q15 of the range) */
st->hb.on = (int16_t)(duck || o.ha);
}
{
uint32_t per = PER[clamp(c[CL_RATE], 0, 7)], cnt = per ? end / per : 0u, j, busy = 0;
uint32_t r = (uint32_t)clamp(c[CL_RATE], 0, CLAY_NRES), cnt = r ? clay_step(end, r - 1u) : 0u, j, busy = 0, rt = st->rt;
st->rt = 0;
if ((t->p[P_VOICE] & 3) != V_POLY) /* (BYTE's ff242c4, the owner: the sequencers live with it) one voice:
* a step's or a key's note takes it, the drone back after */
for (j = 0; j < t->nmono && j < 8u; j++)
busy |= t->mono_stack[j] != clay_dn[tr] && t->mono_stack[j] != clay_nn[tr];
if (busy) {
if (drum) { /* (a DRUM track: the drone its kick pad, struck each RATE step,
* HOLD each bar; DRONE and PITCH its tuning) */
uint32_t c2 = clay_step(end, r ? r - 1u : 6u);
if (!clay_dn[tr] || (uint16_t)c2 != clay_lr[tr]) {
int8_t dp = t->dpit;
if (clay_dn[tr]) seq_note_off(t, clay_dn[tr]);
t->dpit = (int8_t)clamp((int32_t)dn - 24, -48, 48);
seq_note_on(t, 36u, 110u);
t->dpit = dp;
clay_dn[tr] = 36u;
}
cnt = c2;
} else if (busy) {
if (clay_dn[tr]) seq_note_off(t, clay_dn[tr]);
clay_dn[tr] = 0;
} else if (clay_dn[tr] != dn || (per && cnt != clay_lr[tr])) { /* new, moved, or its RATE's strike */
} else if (clay_dn[tr] != dn || (r && (uint16_t)cnt != clay_lr[tr]) || rt) { /* new, moved, its RATE's strike, a HIT's */
if (clay_dn[tr]) seq_note_off(t, clay_dn[tr]);
seq_note_on(t, dn, 110u);
seq_note_on(t, dn, rt ? rt : 110u);
clay_dn[tr] = (uint8_t)dn;
}
clay_lr[tr] = cnt;
clay_lr[tr] = (uint16_t)cnt;
}
{ /* a NOTE gesture alive: its note on the voice, on the scale, two octaves over the drone */
int32_t sem = D[FV_ESUM] > 0 ? D[FV_SEM] * 32767 / (D[FV_ESUM] > 32767 ? D[FV_ESUM] : 32767) : 0;
uint32_t nn = 0, j, busy = 0;
int32_t sem = o.esum > 0 ? o.sem * 32767 / (o.esum > 32767 ? o.esum : 32767) : 0;
uint32_t nn = 0, j, busy = drum;
if ((t->p[P_VOICE] & 3) != V_POLY) /* (one voice: a step's or a key's note before a gesture's) */
for (j = 0; j < t->nmono && j < 8u; j++)
busy |= t->mono_stack[j] != clay_dn[tr] && t->mono_stack[j] != clay_nn[tr];
if (D[FV_ESUM] > 3000 && !busy)
if (o.esum > 3000 && !busy)
nn = (uint32_t)clamp(scale_snap(t, (int32_t)dn + 24 + (sem * 12 + (sem < 0 ? -2048 : 2048)) / 4096), 12, 108);
if (nn != clay_nn[tr]) {
if (clay_nn[tr]) seq_note_off(t, clay_nn[tr]);
@@ -101,11 +156,11 @@ static __attribute__((noinline)) void clay_tick(uint32_t n)
}
}
/* the pages' knobs (params.c page_desc: ids ID_CL0 + CL_*): the selected track's settings, written in place (ui_input.c
* edit_param, then clay_put) */
/* the pages' knobs (params.c page_desc: ids ID_CL0 + CL_*): the selected track's settings, through their int16 view
* (clay_ui: ui_input.c edit_param writes it, clay_put back); MOD (CL_SEL) the modulator the pages' others edit */
static const char *const CL_ONN[] = {"OFF", "ON", 0};
static const char *const CL_RATEN[] = {"HOLD", "4BAR", "2BAR", "1BAR", "1/2", "1/4", "1/8", "1/16", 0};
static const char *const CL_RUNN[] = {"SONG", "FREE", 0};
static const char *const CL_MODN[] = {"1", "2", "3", "4", 0};
static const char *const CL_NN[12] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"};
static const param_desc_t *clay_desc(const track_t *t, uint32_t f, int16_t **valp)
{
@@ -115,12 +170,17 @@ static const param_desc_t *clay_desc(const track_t *t, uint32_t f, int16_t **val
static const char *const BASE[CLAY_ND] = {"OFF", "PITCH", "CUTOFF", "SHAPE", "VOLUME", "PAN", "DIST", "CHORUS", "DELAY",
"REVERB", "LFO RATE", "VIBRATO", 0, 0, 0, 0, 0, 0, 0, 0, "VOICE CUT", "LEVEL"}; /* (FM: no LIFE
* destination: its own HOME > LIFE) */
static const char *const DECN[4] = {"DECAY 1", "DECAY 2", "DECAY 3", "DECAY 4"};
static const char *const EN[8] = {"E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8"};
uint32_t tr = (uint32_t)(t - trk) % NTRK, i;
f %= CLAY_NF;
*valp = &clay[tr][f];
d.def = 0; d.names = 0; d.fmt = F_ENUM; d.min = 0;
if (f == CL_SEL) { /* (BYTE, the owner: one MOD, scrolled, as the sequences are) */
*valp = &clay_km[tr];
d.label = "MOD"; d.max = 3; d.names = CL_MODN;
return &d;
}
f %= CLAY_NF;
clay_ui[f] = clay[tr][f];
*valp = &clay_ui[f];
if (f == CL_ON) { d.label = "CLAY"; d.max = 1; d.names = CL_ONN; }
else if (f == CL_OCT) { /* (the drone's note: its octave on the track's ROOT) */
uint32_t r = (uint32_t)clamp(t->p[P_ROOT], 0, 11);
@@ -132,10 +192,12 @@ static const param_desc_t *clay_desc(const track_t *t, uint32_t f, int16_t **val
}
on[4] = 0;
d.label = "DRONE"; d.max = 3; d.def = 1; d.names = on;
} else if (f == CL_RATE) { d.label = "RATE"; d.max = 7; d.names = CL_RATEN; }
} else if (f == CL_RATE) { d.label = "RATE"; d.max = CLAY_NRES; d.names = CLAY_RESN; }
else if (f == CL_RUN) { d.label = "RUN"; d.max = 1; d.names = CL_RUNN; }
else if (f < CL_DEC) {
uint32_t k = (f - CL_M0) & 3u;
else if (f == CL_PIT) { d.label = "PITCH"; d.fmt = F_SEMI; d.min = -24; d.max = 36; }
else if (f == CL_SEED) { d.label = "SEED"; d.fmt = F_INT; d.max = 127; }
else {
uint32_t k = (f - CL_M0) % 6u;
if (k == 0u) { /* DEST: the sound's knobs by their own names */
for (i = 0; i < (uint32_t)CLAY_ND; i++) nm[i] = BASE[i];
for (i = 0; i < 8u; i++) {
@@ -146,17 +208,27 @@ static const param_desc_t *clay_desc(const track_t *t, uint32_t f, int16_t **val
d.label = "DEST"; d.max = CLAY_ND - 1; d.names = nm;
} else if (k == 1u) { /* SHAPE: the HITS first (the owner) */
d.label = "SHAPE"; d.max = FORM_NSH - 1; d.names = CLAY_SHN;
} else if (k == 2u) { d.label = "EUCLID"; d.max = FORM_NEU - 1; d.names = FORM_EU; }
else { d.label = "AMOUNT"; d.fmt = F_PCT; d.max = 127; d.def = 100; }
} else if (f < CL_STEP) { d.label = DECN[f - CL_DEC]; d.fmt = F_PCT; d.max = 127; }
else if (f == CL_STEP) { d.label = "STEP"; d.max = 3; d.def = 2; d.names = FORM_RATE; }
else { d.label = "SEED"; d.fmt = F_INT; d.max = 127; }
} else if (k == 2u) { d.label = "EUCLID"; d.max = CLAY_NEU - 1; d.names = CLAY_EU; }
else if (k == 3u) { d.label = "AMOUNT"; d.fmt = F_PCT; d.max = 127; d.def = 100; }
else if (k == 4u) { d.label = "DECAY"; d.fmt = F_PCT; d.max = 127; }
else { d.label = "RATE"; d.max = CLAY_NRES - 1; d.def = 2; d.names = CLAY_RESN + 1; } /* (its own, as FORM's MOD RATE) */
}
return &d;
}
/* a knob of the pages turned (its value already in): ON from a blank one, its first sound (clay_defaults) */
static void clay_put(uint32_t idx, int32_t was, int32_t v)
/* (params.c page_desc) the pages' knobs: MOD 1's fields stand for the chosen modulator's */
static const param_desc_t *clay_page_desc(const track_t *t, uint32_t f, int16_t **valp)
{
uint32_t tr = idx / CLAY_NF % NTRK, f = idx % CLAY_NF, m, any = 0;
if (f >= CL_M0 && f < CL_M0 + 6u)
f = CL_MF((uint32_t)clay_km[(uint32_t)(t - trk) % NTRK] & 3u, f - CL_M0);
return clay_desc(t, f, valp);
}
/* a knob of the pages turned (its view's value already in): into the track's, ON from a blank one its first sound
* (clay_defaults) */
static void clay_put(uint32_t tr, uint32_t f, int32_t was, int32_t v)
{
uint32_t m, any = 0;
tr %= NTRK; f %= CLAY_NF;
clay[tr][f] = (clay_t)clamp(v, -128, 127);
if (f != CL_ON || !v || was)
return;
for (m = 0; m < 4u; m++) any |= clay[tr][CL_MF(m, 3u)] != 0;
@@ -164,3 +236,33 @@ static void clay_put(uint32_t idx, int32_t was, int32_t v)
clay_defaults(clay[tr]);
ui_message("DRONE CLAY ON");
}
/* (BYTE) the stored settings (the project's 'C' 'L'): PITCH biased; a first DRONE CLAY's ('C' 'Y', 26: ON OCT RATE RUN,
* MOD 1..4 DEST SHAPE EUCLID AMOUNT, their DECAYs, STEP, SEED) as today's: its RATE and EUCLID in the new orders, its
* STEP every modulator's RATE */
#define CLAY_V1 26u /* (the first layout's count) */
static const clay_t clay_v2_def[CLAY_NF] = {[CL_MF(0, 5u)] = 2, [CL_MF(1, 5u)] = 2, [CL_MF(2, 5u)] = 2, [CL_MF(3, 5u)] = 2}; /* (a shorter block's rest) */
static void clay_pack(const clay_t *c, uint8_t *b)
{
uint32_t i;
for (i = 0; i < CLAY_NF; i++) b[i] = (uint8_t)clamp(c[i] + (i == CL_PIT && (c[CL_ON] | c[CL_PIT]) ? CL_PITB : 0), 0, 127); /* (a
* track never set: all 0, as clay_unpack reads it back) */
}
static void clay_unpack(const uint8_t *b, clay_t *c)
{
uint32_t i;
for (i = 0; i < CLAY_NF; i++) c[i] = (clay_t)((int32_t)(b[i] & 127u) - (i == CL_PIT && (b[CL_ON] | b[CL_PIT]) ? CL_PITB : 0)); /* (an
* empty block, a track never ON: PITCH 0) */
}
static void clay_from_v1(const uint8_t *o, uint8_t *b)
{
static const uint8_t RATE1[8] = {0, 9, 8, 7, 6, 5, 4, 3}, STEP1[4] = {4, 3, 2, 1};
uint32_t m;
memset(b, 0, CLAY_NF);
b[CL_ON] = o[0] & 1u; b[CL_OCT] = (uint8_t)(o[1] & 3u); b[CL_RATE] = RATE1[o[2] & 7u]; b[CL_RUN] = o[3] & 1u;
b[CL_PIT] = CL_PITB; b[CL_SEED] = o[25] & 127u;
for (m = 0; m < 4u; m++) {
b[CL_MF(m, 0u)] = o[4u + 4u * m] & 127u; b[CL_MF(m, 1u)] = o[5u + 4u * m] & 127u;
b[CL_MF(m, 2u)] = CLAY_EU_OLD[o[6u + 4u * m] % 25u]; b[CL_MF(m, 3u)] = o[7u + 4u * m] & 127u;
b[CL_MF(m, 4u)] = o[20u + m] & 127u; b[CL_MF(m, 5u)] = STEP1[o[24] & 3u];
}
}
+141 -127
View File
@@ -1,13 +1,15 @@
/* SPDX-License-Identifier: GPL-3.0-only
* Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant)
* (V10.8.21) DRONE CLAY's composer, from JIANT BYTE (GPL, its eng_form.c of 93e9eb1: FORM's gestures' machinery, the
* FORM engine itself not here: FM never had it). Included by engines.c (before mod.c, which reads clay_v). */
* FORM engine itself not here: FM never had it); (V10.8.27) BYTE's 1adbf0a6 + d7f32b11: each modulator its own RATE on
* the bar's grid, the HITs a drum on any engine, FM's seven a sine at their ratio. Included by engines.c (before mod.c,
* which reads clay_vk and the HITs' bundle). */
/* DRONE CLAY's composer (was the FORM engine, BYTE 0.17; the owner: "out as an engine, a sequencer of the voice the
* track has: endless timbres"). Four modulators, each a SHAPE out of five tables (TABLES, HITS, GESTURES, NOTES, FM),
* its EUCLID ("--": none), AMOUNT and DECAY, on the track's STEP; a HIT is a bundle of moves (the kick: down, louder),
* its EUCLID ("--": none), AMOUNT, DECAY and RATE; a HIT the track's voice as a drum (its pitch, noise, CUTOFF),
* a NOTE a real note on the track's voice (seq.c clay_tick). What each modulator adds now (form_st.mv) moves the DEST it
* is routed to through the matrix (mod.c mod_begin: the track's own parameters, any engine). The gestures' machinery
* and the stored shapes' coding (FORM_DS) are FORM's */
* is FORM's */
/* (BYTE's fvm.c: the hash and FUSE's euclid, the two DRONE CLAY reads) */
static inline uint32_t fvm_hash(uint32_t h)
{
@@ -32,7 +34,6 @@ static uint32_t fvm_eu(uint32_t s, uint32_t seed)
default: return (s >> 4) & 1u ? g[1] : g[0];
}
}
enum{FD_PITCH,FD_FM,FD_FOLD,FD_NOISE,FD_SHAPE,FD_LEVEL,FD_RATIO,FD_N};
static const char *const FORM_SHAPE[]={
"SINE","S&H","DRIFT","SPRING","STAIRS","BOUNCE","EXP UP","LOG DN","CHAOS","SWEEP","RND GATE","TRIPLET",
"KICK","SNARE","HAT","OPEN HAT","CLAP","RIM","TOM","ZAP","BITHAT","NOISE DN","SWELL","CRASH",
@@ -44,46 +45,61 @@ static const char *const FORM_SHAPE[]={
static const char *const CLAY_SHN[]={"KICK","SNARE","HAT","OPEN HAT","CLAP","RIM","TOM","ZAP","BITHAT","NOISE DN","SWELL","CRASH","SINE","S&H","DRIFT","SPRING","STAIRS","BOUNCE","EXP UP","LOG DN","CHAOS","SWEEP","RND GATE","TRIPLET","RAMP UP","RAMP DN","TRI","GATE","ENV UP","ENV DN","RISER","STUTTER","STUT UP","DOWN","UP","REST","ARP UP","ARP DN","ARP UPDN","ARP RND","CHORD m","CHORD M","SUS4","m7","CLUSTER","+OCT","+5TH","GLIDE DN","FM x1/2","FM x1","FM x1.5","FM x2","FM x3","FM x5","FM x7",0};
enum{FPG_TAB,FPG_HIT,FPG_GES,FPG_NOTE,FPG_FM};
enum{FS_ENVDN=29,FS_REST=35}; /* (BYTE's S_ENVDN, S_REST: its S_* names the USB's registers here) */
/* (a stored parameter is -64 .. 127: 192 values) a modulator's two slots: SHAPE with its DEST (the TABLES and GESTURES
* but REST: 23 x 7 DESTs, then the 31 shapes with no DEST: REST, the HITS, the NOTES, FM but x1), and its EUCLID with
* its RATE (25 x 7). Inside, as one: DEST + 8 x SHAPE + 512 x RATE (form_vds) */
#define FORM_DSC(d,s) (((s)<12u)?(uint32_t)(s)*7u+(uint32_t)(d):((s)>=24u&&(s)<35u)?((uint32_t)(s)-12u)*7u+(uint32_t)(d):\
161u+((s)==35u?0u:(s)<24u?(uint32_t)(s)-11u:(s)<48u?(uint32_t)(s)-23u:(uint32_t)(s)-23u-((s)>49u)))
#define FORM_DS(d,s) ((int32_t)FORM_DSC(d,s)-64)
#define FORM_EUV(e,r) ((int32_t)(e)+25*(int32_t)(r)-64)
#define FORM_DSMAX (512*7-1)
/* a modulator's step: 2^e a beat (e -2 .. 3: 1/1 .. 1/32), its RATE's or FORM's */
static int32_t form_mexpo(const int16_t*p,int32_t ds){int32_t r=ds>>9;return r?r-3:clamp(p[0],0,3);} /* (p: clay_sp, its STEP at 0) */
static const char *const FORM_EU[]={"--","FUSE","1/4","2/4","3/4","1/8","2/8","3/8","5/8","7/8","2/5","3/5","3/7","4/7","2/9","4/9","5/9",
"5/12","7/12","4/11","5/13","3/16","5/16","7/16","9/16",0};
static const uint8_t FORM_EUK[25][2]={{0,0},{0,0},{1,4},{2,4},{3,4},{1,8},{2,8},{3,8},{5,8},{7,8},{2,5},{3,5},{3,7},{4,7},{2,9},{4,9},{5,9},
{5,12},{7,12},{4,11},{5,13},{3,16},{5,16},{7,16},{9,16}};
#define FORM_NEU 25u
static const char *const FORM_RATE[]={"1/4","1/8","1/16","1/32",0};
/* (BYTE, RAM) the same four in DRONE CLAY's compact slots (clay_sp: 0 STEP, 1 SEED, then 4 a modulator) */
static const uint8_t FORM_MC[4][4]={{2,3,4,5},{6,7,8,9},{10,11,12,13},{14,15,16,17}};
#define CLAY_SPN 18u
static uint32_t form_vds_x(const int16_t*p,const uint8_t (*mf)[4],uint32_t m){
uint32_t c=(uint32_t)clamp(p[mf[m][0]]+64,0,191),e=(uint32_t)clamp(p[mf[m][1]]+64,0,174),s,d=0,j;
if(c<161u){s=c/7u;d=c%7u;if(s>=12u)s+=12u;}
else{j=c-161u;s=!j?35u:j<13u?11u+j:j<25u?23u+j:j==25u?48u:24u+j;}
return d+8u*s+512u*(e/25u);
/* (BYTE's 1adbf0a6) DRONE CLAY's EUCLID: the straight ones first (on the bar's grid), then the triplets' 12, then the
* polyrhythms; "--" none, FUSE two drawn from the SEED and joined, 1/1 every step */
static const char *const CLAY_EU[]={"--","FUSE","1/1","1/4","2/4","3/4","1/8","2/8","3/8","5/8","7/8","3/16","5/16","7/16","9/16",
"5/12","7/12","2/5","3/5","3/7","4/7","2/9","4/9","5/9","4/11","5/13",0};
static const uint8_t CLAY_EUK[26][2]={{0,0},{0,0},{1,1},{1,4},{2,4},{3,4},{1,8},{2,8},{3,8},{5,8},{7,8},{3,16},{5,16},{7,16},{9,16},
{5,12},{7,12},{2,5},{3,5},{3,7},{4,7},{2,9},{4,9},{5,9},{4,11},{5,13}};
#define CLAY_NEU 26u
/* (a first DRONE CLAY's EUCLID: FORM's order, 25) -> this order */
static const uint8_t CLAY_EU_OLD[25]={0,1,3,4,5,6,7,8,9,10,17,18,19,20,21,22,23,15,16,24,25,11,12,13,14};
/* (BYTE, the owner: "more resolutions, not polyrhythmic, and faster") DRONE CLAY's resolutions, each a modulator's RATE
* (its euclid's steps, its shapes' time) and the drone's (struck again each): straight first, then dotted, triplets,
* the polyrhythms last. num steps a bar in den bars (the bar 4 beats); a step's index is the bar's (never out of
* phase), more than one a bar: spb a bar, the last one cut short when they do not fill it (the dotted). rl: 2^32 / its
* length (Q16 beats), its gestures' time */
typedef struct { uint8_t num, den, spb; uint32_t rl; } clay_res_t;
#define CLAY_RL(num, den) (uint32_t)(0xFFFFFFFFu / (262144u * (den) / (num)))
#define CR(num, den, spb) {num, den, spb, CLAY_RL(num, den)}
static const clay_res_t CLAY_RES[25] = {
CR(64, 1, 64), CR(32, 1, 32), CR(16, 1, 16), CR(8, 1, 8), CR(4, 1, 4), CR(2, 1, 2), CR(1, 1, 1), CR(1, 2, 1), CR(1, 4, 1),
CR(64, 3, 22), CR(32, 3, 11), CR(16, 3, 6), CR(8, 3, 3), CR(4, 3, 2),
CR(48, 1, 48), CR(24, 1, 24), CR(12, 1, 12), CR(6, 1, 6), CR(3, 1, 3),
CR(5, 1, 5), CR(10, 1, 10), CR(20, 1, 20), CR(7, 1, 7), CR(14, 1, 14), CR(28, 1, 28)};
#undef CR
#define CLAY_NRES 25u
static const char *const CLAY_RESN[]={"HOLD","1/64","1/32","1/16","1/8","1/4","1/2","1BAR","2BAR","4BAR",
"1/32D","1/16D","1/8D","1/4D","1/2D","1/32T","1/16T","1/8T","1/4T","1/2T","1/5","1/10","1/20","1/7","1/14","1/28",0};
/* the step of resolution r at the time e (Q16 beats from the bar's start of PLAY) */
static uint32_t clay_step(uint32_t e, uint32_t r)
{
const clay_res_t *q = &CLAY_RES[r % CLAY_NRES];
uint32_t bar = e >> 18, pib = e & 262143u;
if (q->num <= q->den)
return q->den == 1u ? bar : q->den == 2u ? bar >> 1 : bar >> 2;
return bar * q->spb + (q->den == 1u ? (pib * q->num) >> 18 : pib * q->num / ((uint32_t)q->den << 18));
}
/* ---- the gestures: a key's or a euclid's, alive until their envelope is out ---- */
typedef struct{uint8_t sh,mod,fl,vel,key,spd;uint16_t len;uint32_t t0,rel;} form_g_t; /* fl: 1 held 2 latched 4 inverted 8 alive */
#define FORM_G 6u
typedef struct{int32_t lastm[4];int16_t mv[4];uint32_t clk;uint8_t modes;form_g_t g[FORM_G];} form_st_t; /* (FM: only DRONE CLAY's; FORM's keys and hold not here) */
/* the HITs' bundle this block, for mod.c clay_mod (written by clay_tick): pitch (1/16 semitones), gain (Q15), CUTOFF
* (Q15 of its range); on: any */
typedef struct { int16_t pit, gain, cut, on; } clay_hb_t;
/* a track's composer: each modulator's last step (lastm, its low 16 bits: a change is a new step), what each adds now
* (mv), the gestures' clock (clk, Q18 beats); a HIT's drone strike (rt, its velocity), a DRUM track's pad sounding (pn)
* and the blocks until it is let go (pt); the bundle (hb). (FM: only DRONE CLAY's; FORM's keys not here) */
typedef struct{int16_t lastm[4],mv[4];uint32_t clk;clay_hb_t hb;uint8_t modes,rt,pn,pt;form_g_t g[FORM_G];} form_st_t;
static form_st_t form_st[NTRK];
static uint8_t form_lit[NTRK]; /* (the panel: the modulators that struck this step, bit m) */
/* modulator m's hit at step s ("--": none, FUSE: two drawn from the seed and joined) */
static int form_hit(const int16_t*p,uint32_t m,uint32_t s,uint32_t seed)
/* modulator m's hit at step s on its EUCLID e (CLAY_EU; "--": none, FUSE: two drawn from the seed and joined) */
static int form_hit(uint32_t e,uint32_t m,uint32_t s,uint32_t seed)
{
uint32_t e=(uint32_t)clamp(p[FORM_MC[m][1]]+64,0,174)%25u;
e%=CLAY_NEU;
if(!e)return 0;
if(e==1u)return (int)fvm_eu(s,seed+m*37u);
uint32_t k=FORM_EUK[e][0],n=FORM_EUK[e][1],q=s%n; /* (the owner: on the step, with the others: a hit on the
uint32_t k=CLAY_EUK[e][0],n=CLAY_EUK[e][1],q=s%n; /* (the owner: on the step, with the others: a hit on the
* cycle's first step, no rotation by the seed) */
(void)m;
return (q*k)%n<k;
}
/* 2^(-x/256), Q15 */
@@ -131,7 +147,7 @@ static int32_t form_shape(uint32_t sh,uint32_t tau,uint32_t seed)
default:return ((tau*3u)&1023u)<512u?32767:0;
}
}
/* a HIT's envelope (Q15) and its moves: lift, octaves (Q12), level, shape, fm, ratio (Q12 oct), noise, crush */
/* a HIT's envelope (Q15) at tau (sixteenths, Q8) */
static int32_t form_henv(uint32_t g,uint32_t tau)
{
switch(g){
@@ -147,107 +163,105 @@ static int32_t form_henv(uint32_t g,uint32_t tau)
default:return form_fexp((tau*166u)>>8);
}
}
static const int16_t FORM_HIT[12][8]={
/* lift oct lvl shape fm ratio noise crush */
{32767,-6144,13107,-32767, 0, 0, 0, 0}, /* KICK (its octaves falling: form_eval) */
{32767, 1229, 9830,-21845,3120, 1434,29491, 0}, /* SNARE */
{32767,19661, 0,-10923,6760, 3645, 6554, 0}, /* HAT */
{32767,19661, 0,-10923,6760, 3645, 6554, 0}, /* OPEN HAT */
{32767,10650, 6554,-10923,1040, 0,32767, 0}, /* CLAP */
{32767, 9830, 3277,-21845,2080, 0, 0, 0}, /* RIM */
{32767,-2458,13107,-32767, 0, 0, 0, 0}, /* TOM */
{32767,-4096, 9830,-10923, 0,-1638, 0, 0}, /* ZAP */
{32767,15565, 3277, 0, 0, 0, 0,18022}, /* BITHAT */
{ 0, 0, 0, 0, 0, 0,29491, 0}, /* NOISE DN */
{ 0, 0, 0, 0, 0, 0,29491, 0}, /* SWELL */
{32767,18842, 0,-10923,7800, 3645,13107, 0}}; /* CRASH */
/* (BYTE's 1adbf0a6, the owner: "KICK, SNARE .. don't work on ANALOG") a HIT on any engine: the track's own voice moved
* as a drum, a bundle beside its DEST: its pitch swept from p0 to p1 (MIDI notes) at pace pr (the kick's fall, 0 none),
* thrown at random each block over nz semitones (the noise of a snare, a hat: the pitch's, any engine's), the track's
* CUTOFF moved (cut, % of its range), the voice gated by it (clay.c: the drone ducked by the AMOUNT between hits); on a
* DRUM track the kit's own pad instead (gm, a GM note) */
typedef struct { uint8_t p0, p1; uint16_t pr; uint8_t nz; int8_t cut; uint8_t gm, pad; } clay_hit_t;
static const clay_hit_t CLAY_HIT[12] = {
{55, 31, 3324, 0, -20, 36, 0}, /* KICK: G3 down to G1 in ~10 ms, darker */
{55, 50, 5170, 14, 40, 38, 0}, /* SNARE: a short body and its rattle */
{100, 100, 0, 24, 60, 42, 0}, /* HAT */
{100, 100, 0, 24, 60, 46, 0}, /* OPEN HAT */
{76, 76, 0, 18, 40, 39, 0}, /* CLAP */
{79, 76, 4800, 0, 30, 37, 0}, /* RIM */
{50, 43, 1847, 0, 0, 45, 0}, /* TOM */
{96, 36, 1477, 0, 30, 50, 0}, /* ZAP */
{108, 108, 0, 30, 60, 42, 0}, /* BITHAT */
{84, 84, 0, 30, 30, 39, 0}, /* NOISE DN */
{84, 84, 0, 30, 30, 49, 0}, /* SWELL */
{103, 103, 0, 24, 60, 49, 0}}; /* CRASH */
static const int8_t FORM_ARP[3][6]={{0,3,7,12,0,0},{12,7,3,0,0,0},{0,3,7,12,7,3}};
static const int8_t FORM_CH[5][4]={{0,3,7,0},{0,4,7,0},{0,5,7,0},{0,3,7,10},{0,1,2,3}};
static const int16_t FORM_RAT[7]={-8192,-4096,-1700,0,2396,5415,7403};
enum{FV_OCT,FV_FM,FV_FOLD,FV_CRUSH,FV_NOISE,FV_SHAPE,FV_LEVEL,FV_RATIO,FV_LIFT,FV_SEM,FV_ESUM,FV_N};
/* every gesture alive, summed into the eight (and the lift, the notes' semitones) */
static void form_eval(form_st_t*st,const int16_t*p,int32_t*D,uint32_t at)
{
uint32_t i;int32_t M[4]={0,0,0,0}; /* (the panel: what each modulator adds now) */
for(i=0;i<FORM_G;i++){
form_g_t*g=&st->g[i];if(!(g->fl&8u))continue;
uint32_t m=g->mod&3u,raw=(st->clk-g->t0)>>8,sh=g->sh,pg=sh/12u,k=sh%12u;
int32_t ds=(int32_t)form_vds_x(p,FORM_MC,m),dst=ds&7,amt=clamp(p[FORM_MC[m][2]],0,127),dec=clamp(p[FORM_MC[m][3]],0,127),e,xe=form_mexpo(p,ds)-2;
uint32_t tau=xe>=0?raw<<xe:raw>>(-xe); /* (its time in its own RATE's steps) */
tau=g->spd==1u?tau<<1:g->spd==2u?tau>>1:tau;
if(form_oneshot(sh)){if(tau>=2048u){g->fl=0;continue;}e=32767;}
else if((g->fl&3u)||(g->len&&tau<g->len))e=32767;
else{if(!g->rel)g->rel=st->clk|1u;uint32_t rt=(st->clk-g->rel)>>8,T=64u+(uint32_t)dec*32u;e=form_fexp(rt*369u/T);if(e<200){g->fl=0;continue;}}
int32_t gn=amt*g->vel*2;if(g->fl&1u)gn+=gn*(int32_t)at/127;
int32_t a=mul64_sh15(e,gn);
if(pg==FPG_HIT){
const int16_t*h=FORM_HIT[k];int32_t A=form_henv(k,tau)*gn>>15,oct=h[1],fm=h[4];
if(k==0)oct=-6144+(9011*form_fexp((tau*3324u)>>8)>>15);
else if(k==1)oct=1229+(3277*form_fexp((tau*5170u)>>8)>>15);
else if(k==6)oct=-2458+(4915*form_fexp((tau*1847u)>>8)>>15);
else if(k==7){int32_t x=form_fexp((tau*1477u)>>8);oct=-4096+(24576*x>>15);fm=5200*x>>15;}
D[FV_LIFT]+=h[0]*A>>15;D[FV_OCT]+=oct*A>>15;D[FV_LEVEL]+=h[2]*A>>15;D[FV_SHAPE]+=h[3]*A>>15;
D[FV_FM]+=fm*A>>15;D[FV_RATIO]+=h[5]*A>>15;D[FV_NOISE]+=h[6]*A>>15;D[FV_CRUSH]+=h[7]*A>>15;
M[m]+=A;continue;}
if(pg==FPG_NOTE){
int32_t sem,pl=0;
if(k<3u){sem=FORM_ARP[k][(tau>>8)%(k==2u?6u:4u)];pl=1;}
else if(k==3u){static const int8_t R[7]={0,3,5,7,10,12,15};sem=R[fvm_hash(g->t0+(tau>>8))%7u];pl=1;}
else if(k<9u){const int8_t*c=FORM_CH[k-4u];sem=c[(tau>>6)%(k==7u||k==8u?4u:3u)];}
else if(k==9u)sem=12;else if(k==10u)sem=7;else sem=-(int32_t)(tau>=512u?12:tau*12u/512u);
D[FV_LIFT]+=a;D[FV_SEM]+=mul64_sh15(sem*341,a);D[FV_ESUM]+=a;
if(pl){int32_t q=32767-form_fexp(((tau&255u)*923u)>>8);D[FV_LEVEL]-=(27852*q>>15)*a>>15;}
M[m]+=sem*a/12;continue;}
if(pg==FPG_FM){if(k<7u){D[FV_RATIO]+=FORM_RAT[k]*e>>15;D[FV_FM]+=5200*a>>15;}M[m]+=a;continue;}
if(sh==FS_REST){D[FV_OCT]-=a;M[m]-=a;continue;}
int32_t v=form_shape(sh,tau,g->t0);if(g->fl&4u)v=-v;
int32_t va=v*a>>15;M[m]+=va;
switch(dst){
case FD_PITCH:D[FV_OCT]+=va>>2;if(va>0)D[FV_LIFT]+=va;break;
case FD_FM:D[FV_FM]+=va*15600>>15;break;
case FD_NOISE:D[FV_NOISE]+=va+(va>>1);break;
case FD_RATIO:D[FV_RATIO]+=va>>3;break;
case FD_FOLD:D[FV_FOLD]+=va;break;
case FD_SHAPE:D[FV_SHAPE]+=va;break;
default:D[FV_LEVEL]+=va;break;
}
}
for(i=0;i<4u;i++)st->mv[i]=(int16_t)clamp(M[i]>>8,-1024,1024);
}
/* ---- (BYTE) DRONE CLAY: a track's settings (ui pages SEQ > DRONE CLAY, CLAY MOD 1..4, CLAY DECAY, CLAY TIME; the
* project's 'C' 'Y' block). ON, the drone's OCTave (C0 .. C3 on the track's ROOT), its RATE (HOLD: held; else struck
* again every 4 BAR .. 1/16), RUN (SONG: while the transport plays; FREE: always); each modulator's DEST (the matrix's,
* CLAY_MD), SHAPE (the knob's order: the HITS first, CLAY_SH), EUCLID, AMOUNT; their DECAYs; the STEP and the SEED */
enum { CL_ON, CL_OCT, CL_RATE, CL_RUN, CL_M0, CL_DEC = CL_M0 + 16, CL_STEP = CL_DEC + 4, CL_SEED, CLAY_NF };
#define CL_MF(m, f) (CL_M0 + 4u * (m) + (f)) /* f: 0 DEST, 1 SHAPE, 2 EUCLID, 3 AMOUNT */
static int16_t clay[NTRK][CLAY_NF]; /* (FM: in the bss, zeroed at power-on) */
static int16_t clay_v[NTRK][4]; /* what each modulator adds now (Q15): mod.c's per-block source */
/* what the gestures give the track this block: the NOTEs' semitones (sem, weighted by esum), the HITs' bundle: the
* loudest one's pitch (hp, MIDI Q4) and its level (ha), their sum (hg, Q15), noise (hn, semitones Q15) and CUTOFF (hc) */
typedef struct { int32_t sem, esum, hp, ha, hg, hn, hc; } clay_out_t;
/* ---- (BYTE) DRONE CLAY: a track's settings (ui pages SEQ > DRONE CLAY, CLAY MOD, CLAY RHYTHM, CLAY TIME; the project's
* 'C' 'L' block). ON, the drone's OCTave (C0 .. C3 on the track's ROOT), its RATE (HOLD: held; else struck again each
* CLAY_RES step), RUN (SONG: while the transport plays; FREE: always), PITCH (the drone and its notes, -24 .. +36
* semitones), the SEED; each modulator's DEST (the matrix's, CLAY_MD), SHAPE (the knob's order: the HITS first,
* CLAY_SH), EUCLID (CLAY_EU), AMOUNT, DECAY and its own RATE (CLAY_RES) */
enum { CL_ON, CL_OCT, CL_RATE, CL_RUN, CL_PIT, CL_SEED, CL_M0, CLAY_NF = CL_M0 + 24 };
#define CL_MF(m, f) (CL_M0 + 6u * (m) + (f)) /* f: 0 DEST, 1 SHAPE, 2 EUCLID, 3 AMOUNT, 4 DECAY, 5 RATE */
#define CL_SEL CLAY_NF /* (the pages' MOD: which modulator their knobs edit; not stored) */
#define CL_PITB 24 /* (PITCH stored biased in the project: 0 .. 60) */
typedef int8_t clay_t; /* (a setting: -24 .. 127) */
static clay_t clay[NTRK][52]; /* (FM: in the bss, zeroed at power-on; a row CLAY_NF used: the room
* V10.8.21's int16 rows had, so that the RAM after it stays where it
* was: the image's code reaches it as before) */
static int16_t clay_v[NTRK][4] __attribute__((used)); /* (V10.8.21's, kept in place, unused: as above) */
int16_t clay_ui[CLAY_NF]; /* (the pages' knobs: the selected track's, as int16, clay.c clay_desc;
* not static: after the RAM's others, as the new ones) */
int16_t clay_km[NTRK]; /* (the pages' MOD: the modulator CLAY MOD / CLAY RHYTHM edit) */
/* what modulator k of track tr adds now (Q15): mod.c's per-block source, the panel's */
static int32_t clay_vk(uint32_t tr, uint32_t k) { return clamp(form_st[tr % NTRK].mv[k & 3u] * 256, -32767, 32767); }
static uint8_t clay_dn[NTRK], clay_nn[NTRK]; /* the drone's note sounding, a NOTE gesture's (0: none) */
static uint32_t clay_lr[NTRK]; /* the drone's last strike (RATE's period count) */
static uint32_t clay_lr[NTRK]; /* the drone's last strike (RATE's step, its low 16 bits) */
static int clay_on(uint32_t tr) { return tr < NTRK && clay[tr][CL_ON]; }
/* the knob's SHAPE order -> FORM's shape: the HITS (12..23) first, then the TABLES (0..11), then the rest */
static uint32_t clay_sh(int32_t i) { uint32_t k = (uint32_t)clamp(i, 0, FORM_NSH - 1); return k < 12u ? k + 12u : k < 24u ? k - 12u : k; }
/* the stored settings as FORM's slots (form_hit, form_eval, form_vds read p[]): into sp */
static void clay_fill(const int16_t *c, int16_t *sp)
static int clay_is_hit(const clay_t *c, uint32_t m) { return clay_sh(c[CL_MF(m, 1u)]) / 12u == FPG_HIT; }
/* every gesture alive, summed: what each modulator adds now (st->mv), the NOTEs' and the HITs' (o). Each its time in
* its modulator's RATE's steps; a HIT's in sixteenths, whatever its RATE (a kick is a kick), DECAY its length */
static void clay_eval(form_st_t*st,const clay_t*c,clay_out_t*o,uint32_t at)
{
uint32_t m;
sp[0] = (int16_t)clamp(c[CL_STEP], 0, 3);
sp[1] = c[CL_SEED];
for (m = 0; m < 4u; m++) {
uint32_t s = clay_sh(c[CL_MF(m, 1)]);
sp[FORM_MC[m][0]] = (int16_t)FORM_DS(0u, s);
sp[FORM_MC[m][1]] = (int16_t)FORM_EUV(clamp(c[CL_MF(m, 2)], 0, FORM_NEU - 1), 0);
sp[FORM_MC[m][2]] = c[CL_MF(m, 3)];
sp[FORM_MC[m][3]] = c[CL_DEC + m];
}
uint32_t i;int32_t M[4]={0,0,0,0};
o->sem=o->esum=o->hp=o->ha=o->hg=o->hn=o->hc=0;
for(i=0;i<FORM_G;i++){
form_g_t*g=&st->g[i];if(!(g->fl&8u))continue;
uint32_t m=g->mod&3u,sh=g->sh,pg=sh/12u,k=sh%12u,d16=(st->clk-g->t0)>>2;
int32_t amt=clamp(c[CL_MF(m,3u)],0,127),dec=clamp(c[CL_MF(m,4u)],0,127),e;
uint32_t tau=(uint32_t)(umul64(d16,CLAY_RES[(uint32_t)clamp(c[CL_MF(m,5u)],0,CLAY_NRES-1)].rl)>>24); /* (its RATE's steps, Q8) */
int32_t gn=amt*g->vel*2;if(g->fl&1u)gn+=gn*(int32_t)at/127;
tau=g->spd==1u?tau<<1:g->spd==2u?tau>>1:tau;
if(pg==FPG_HIT){
uint32_t th=d16>>6; /* (sixteenths, Q8; DECAY: 0 x1.5 as fast .. 64 x1 .. 127 half) */
if(th>=8192u){g->fl=0;continue;}
th=th*(384u-2u*(uint32_t)dec)>>8;th=g->spd==1u?th<<1:g->spd==2u?th>>1:th;
if(th>=2048u){g->fl=0;continue;}
const clay_hit_t*h=&CLAY_HIT[k];int32_t A=form_henv(k,th)*gn>>15;
o->hg+=A;o->hn+=(int32_t)h->nz*A;o->hc+=(int32_t)h->cut*A;
if(A>o->ha){o->ha=A;o->hp=(int32_t)h->p1*16+(((int32_t)h->p0-(int32_t)h->p1)*16*(h->pr?form_fexp((th*h->pr)>>8):32767)>>15);}
M[m]+=A;continue;}
if(form_oneshot(sh)){if(tau>=2048u){g->fl=0;continue;}e=32767;}
else if((g->fl&3u)||(g->len&&tau<g->len))e=32767;
else{if(!g->rel)g->rel=st->clk|1u;uint32_t rt=(st->clk-g->rel)>>8,T=64u+(uint32_t)dec*32u;e=form_fexp(rt*369u/T);if(e<200){g->fl=0;continue;}}
int32_t a=e*gn>>15;
if(pg==FPG_NOTE){
int32_t sem;
if(k<3u)sem=FORM_ARP[k][(tau>>8)%(k==2u?6u:4u)];
else if(k==3u){static const int8_t R[7]={0,3,5,7,10,12,15};sem=R[fvm_hash(g->t0+(tau>>8))%7u];}
else if(k<9u){const int8_t*ch=FORM_CH[k-4u];sem=ch[(tau>>6)%(k==7u||k==8u?4u:3u)];}
else if(k==9u)sem=12;else if(k==10u)sem=7;else sem=-(int32_t)(tau>=512u?12:tau*12u/512u);
o->sem+=sem*341*a>>15;o->esum+=a;
M[m]+=sem*a/12;continue;}
if(pg==FPG_FM){ /* (BYTE's review: the seven sounded alike) a sine on DEST at its ratio
* of the RATE's step: x1/2 once in two steps .. x7 seven times a step */
static const uint8_t R2[7]={1,2,3,4,6,10,14};int32_t v=sine_i(tau*(uint32_t)R2[k%7u]<<23);if(g->fl&4u)v=-v;
M[m]+=v*a>>15;continue;}
if(sh==FS_REST){M[m]-=a;continue;}
int32_t v=form_shape(sh,tau,g->t0);if(g->fl&4u)v=-v;
M[m]+=v*a>>15;
}
for(i=0;i<4u;i++)st->mv[i]=(int16_t)clamp(M[i]>>8,-1024,1024);
}
/* a new DRONE CLAY: a drone on C1 held, a kick on the cutoff, an arp's notes, a slow triangle on the sound's KNOB 2, a
* hat on its shape (the knobs as any FORM preset's) */
static void clay_defaults(int16_t *c)
/* a new DRONE CLAY: a drone on C1 held, a kick on the cutoff at 1/16 on the beat, an arp's notes, a slow triangle on
* the sound's KNOB 2, a hat on its shape (DEST SHAPE EUCLID AMOUNT DECAY RATE each) */
static void clay_defaults(clay_t *c)
{
static const int8_t D[CLAY_NF] = {1, 1, 0, 0, 2, 0, 2, 100, 0, 36, 7, 90, 13, 26, 2, 60, 3, 2, 22, 70,
10, 14, 30, 10, 2, 7};
static const int8_t D[CLAY_NF] = {1, 1, 0, 0, 0, 7, 2, 0, 3, 100, 10, 2, 0, 36, 8, 90, 14, 2,
13, 26, 3, 60, 30, 2, 3, 2, 12, 70, 10, 2};
uint32_t i;
for (i = 0; i < CLAY_NF; i++) c[i] = D[i];
}
+1 -1
View File
@@ -38,7 +38,7 @@ struct scr_state {
uint32_t prev, run;
uint32_t frames, lost; /* (the host test's counters) */
};
struct scr_state scr __attribute__((section(".pool.mirror")));
struct scr_state scr; /* (V10.8.27: in the RAM, not the pool: the pool keeps its 8 KiB) */
static void mir_put(uint32_t b) { scr.out[scr.n++] = (uint8_t)(b & 0x7Fu); }
static void mir_flush_run(void)
+1 -1
View File
@@ -49,7 +49,7 @@
#define FELUCCA_ID "FM-1_900" /* package identity (build.py: the .fwsc marker string) */
#endif
#ifndef FELUCCA_VERSION
#define FELUCCA_VERSION "V10.8.26" /* (2026-11-23) V10.8.21: SEQ > CLAY (the owner): DRONE CLAY, JIANT BYTE's drone and its four modulators (DEST SHAPE EUCLID AMOUNT; DECAY, STEP, SEED) on any track, kept with the project ('C' 'Y'), its pages' picture the modulators' telemetry. V10.7.77: GEN (the owner): DUBSTEP's wobble its rate moving (the wobble bass's LFO RATE automated half a bar each: 1/4 1/8 1/8T 1/16); CUMBIA villera one throw in two (a villera 'teclado': 92 .. 100, minor, the keyboard's lead up front). V10.7.76: DRUM-X MATH a wavetable (the owner: "harsh"): its t whole cycles of the hit's time (one shape evolving), interpolated between its samples; SOUND 3 draws it (four moments, cold to hot); hints trimmed (flash). V10.7.75: DRUM-X MATH (the owner): its RATIO (1/4 .. 16, 24, the inharmonic between) on SOUND 3's KNOB 4, COLOR read MOD AMT; MATH's RESTART the scope (its ramps' picture gone), ten more hints out (flash). V10.7.74: DRUM-X MATH (the owner): a sound's WAVE past BELL a MATH formula F01..F48 as its FM's modulator (COLOR its index; its t the hit's time, a sample in eight), kept with the project ('D' 'F'). V10.7.73: SCL > HARMONY its own tab (KEY CHORD HARMONY SCENE); the defaults once (the owner): LARGE off, CLICK REC, COUNT-IN 1 BAR. V10.7.72: GEN (the owner): MATH WEST STRING more (the archetypes' third options theirs, 25 %; a bass's one time in ten); GLO > GLOBAL the scope, its bars gone. V10.7.71: SCL > HARMONY's picture (the owner): the progression's chords as roman numerals in the key ("-" minor, "o" diminished), each its root's colour, the one playing lit; the obvious knobs' hints out (flash). V10.7.70: FX > PUNCH IN: KNOB 4 M4 (its ERASE PUNCH LANE's only), so OCT+ always the punch-in editor (an ERASE picked took it). V10.7.69: MATH FLOAT MORPH (the owner): ALGO B where CHIP was, MORPH A -> B where BEND was (between the ends B a sample in eight, interpolated: +12.5 % CPU); MATH's formulas (lofi_float, lofi_byte) their 14 divisions by a constant as multiplies (JIANT BYTE 0.16's build pass, tools/build.py const_divs: exact, less CPU a sample); the MACRO layer's dead branches out (flash). V10.7.68: EUCLID MODES > ROLE (MELODY CHORDS BASS ARP, was CHORD) on the harmony the other melodic tracks play, bar by bar (four bars when it changes), else SCL's key; a recorded melody EUCLID takes: its notes as they were; LFO / FX dice leftovers out (flash). V10.7.67: GEN and EUCLID MUTATE fuse two seeds (the owner: never one as it is; the second far from the first), A+B in the name; FX + OCT+ opens the punch-in editor again (as OCT+ on FX > PUNCH IN). V10.7.66: SCL > HARMONY (PROG LENGTH EVOLVE SKIP: every melodic sequence follows a progression); GEN 8 progressions more (neo-soul, jazz, IDM, progressive); EUCLID's melody CONTOUR RANGE MOTIF CHORD; macros FX > PUNCH IN's only (LFO's layer, HOME > ROUTES gone, MACROS in FX), GLO's layer says G4 UNDO; the PUNCH-IN EDITOR redone (the owner): a key WHAT (an effect, or PARAM: M1..M4, CUT PITCH TIMBRE VOLUME PAN DIST CHORUS DELAY REVERB VIBRATO on every track), HOW (an effect HOLD LATCH QUANT; PARAM HOLD RAMP UP RAMP DN SINE STUTTER S&H), AMOUNT (-100..+100 %; an effect its TARGET), TIME (1/16 .. 8 BARS); two slots A B; FX > PUNCH IN its knobs M1..M4 (PUNCH LANE: LEN RES); the layers MAP only (KNOBS STATE gone, ALGORITHM nothing held), the FX cards "M1 CUT"; FX + SELECT the FX pages (its dice gone). GENE while it plays waits for the bar to end (Hollusion); GENE 4: KEY NEW / KEEP (the first melodic track's key and mode kept), ENTRY ALL / BUILD (the new piece in a track a bar, the kit first); the old DIGITAL / NOISE / retired engines' conversions out (flash), the songs 7-8 notice out; voices past V10.6c's budget: tails first, FM6's quarter rate gone. V10.7.65: the PUNCH-IN EDITOR (the owner): OCT+ on FX > PUNCH IN opens it (the FX layer locked open; an ERASE picked on KNOB 4: OCT+ does it), DICE gone; the COMB / COMB- cut-off moved by the LFO and the ENV as the other filters; a key held and KNOB 1..4 its EFFECT (any, MOD a macro moved) TARGET (ALL SYN DRM T1..T6; MOD M1..M4) AMOUNT (MOD 1 BEAT .. 4 BARS) MODE (HOLD LATCH QUANT; MOD RAMP UP / DOWN SINE S&H), the mode said in the header; SELECT a slot (four, in the settings), OCT+ saves and plays it, OCT- leaves. V10.7.64: SCENE's LEADER PRESS (a key's note on every live track at once, each its own sound); SCENE on the live tracks only (it opened on T6, asleep with four: nothing heard, nothing drawn), every role with the key: a kit's DRUM loops its beat while a key is held, stopped too; the engines as the kit (the owner): FILTER TYPE CUT RES IMAGE (DIST the SENDS' only), PLAY POLY GLIDE UNISON VEL (the plain MORE gone, GL MODE off the panel), GAIN 0..+12 dB clean where a DRIVE was (ANALOG's MORE, WHEEL's COLOR; their DRIVE off the panel, kept), saved ('T' 'G'); FUGA's subject and answer on live tracks (the continuo after: with four tracks it began unheard); DUBSTEP's bass the wobble (a resonant low-pass on aLine truncated
#define FELUCCA_VERSION "V10.8.27" /* (2026-11-23) V10.8.21: SEQ > CLAY (the owner): DRONE CLAY, JIANT BYTE's drone and its four modulators (DEST SHAPE EUCLID AMOUNT; DECAY, STEP, SEED) on any track, kept with the project ('C' 'Y'), its pages' picture the modulators' telemetry. V10.7.77: GEN (the owner): DUBSTEP's wobble its rate moving (the wobble bass's LFO RATE automated half a bar each: 1/4 1/8 1/8T 1/16); CUMBIA villera one throw in two (a villera 'teclado': 92 .. 100, minor, the keyboard's lead up front). V10.7.76: DRUM-X MATH a wavetable (the owner: "harsh"): its t whole cycles of the hit's time (one shape evolving), interpolated between its samples; SOUND 3 draws it (four moments, cold to hot); hints trimmed (flash). V10.7.75: DRUM-X MATH (the owner): its RATIO (1/4 .. 16, 24, the inharmonic between) on SOUND 3's KNOB 4, COLOR read MOD AMT; MATH's RESTART the scope (its ramps' picture gone), ten more hints out (flash). V10.7.74: DRUM-X MATH (the owner): a sound's WAVE past BELL a MATH formula F01..F48 as its FM's modulator (COLOR its index; its t the hit's time, a sample in eight), kept with the project ('D' 'F'). V10.7.73: SCL > HARMONY its own tab (KEY CHORD HARMONY SCENE); the defaults once (the owner): LARGE off, CLICK REC, COUNT-IN 1 BAR. V10.7.72: GEN (the owner): MATH WEST STRING more (the archetypes' third options theirs, 25 %; a bass's one time in ten); GLO > GLOBAL the scope, its bars gone. V10.7.71: SCL > HARMONY's picture (the owner): the progression's chords as roman numerals in the key ("-" minor, "o" diminished), each its root's colour, the one playing lit; the obvious knobs' hints out (flash). V10.7.70: FX > PUNCH IN: KNOB 4 M4 (its ERASE PUNCH LANE's only), so OCT+ always the punch-in editor (an ERASE picked took it). V10.7.69: MATH FLOAT MORPH (the owner): ALGO B where CHIP was, MORPH A -> B where BEND was (between the ends B a sample in eight, interpolated: +12.5 % CPU); MATH's formulas (lofi_float, lofi_byte) their 14 divisions by a constant as multiplies (JIANT BYTE 0.16's build pass, tools/build.py const_divs: exact, less CPU a sample); the MACRO layer's dead branches out (flash). V10.7.68: EUCLID MODES > ROLE (MELODY CHORDS BASS ARP, was CHORD) on the harmony the other melodic tracks play, bar by bar (four bars when it changes), else SCL's key; a recorded melody EUCLID takes: its notes as they were; LFO / FX dice leftovers out (flash). V10.7.67: GEN and EUCLID MUTATE fuse two seeds (the owner: never one as it is; the second far from the first), A+B in the name; FX + OCT+ opens the punch-in editor again (as OCT+ on FX > PUNCH IN). V10.7.66: SCL > HARMONY (PROG LENGTH EVOLVE SKIP: every melodic sequence follows a progression); GEN 8 progressions more (neo-soul, jazz, IDM, progressive); EUCLID's melody CONTOUR RANGE MOTIF CHORD; macros FX > PUNCH IN's only (LFO's layer, HOME > ROUTES gone, MACROS in FX), GLO's layer says G4 UNDO; the PUNCH-IN EDITOR redone (the owner): a key WHAT (an effect, or PARAM: M1..M4, CUT PITCH TIMBRE VOLUME PAN DIST CHORUS DELAY REVERB VIBRATO on every track), HOW (an effect HOLD LATCH QUANT; PARAM HOLD RAMP UP RAMP DN SINE STUTTER S&H), AMOUNT (-100..+100 %; an effect its TARGET), TIME (1/16 .. 8 BARS); two slots A B; FX > PUNCH IN its knobs M1..M4 (PUNCH LANE: LEN RES); the layers MAP only (KNOBS STATE gone, ALGORITHM nothing held), the FX cards "M1 CUT"; FX + SELECT the FX pages (its dice gone). GENE while it plays waits for the bar to end (Hollusion); GENE 4: KEY NEW / KEEP (the first melodic track's key and mode kept), ENTRY ALL / BUILD (the new piece in a track a bar, the kit first); the old DIGITAL / NOISE / retired engines' conversions out (flash), the songs 7-8 notice out; voices past V10.6c's budget: tails first, FM6's quarter rate gone. V10.7.65: the PUNCH-IN EDITOR (the owner): OCT+ on FX > PUNCH IN opens it (the FX layer locked open; an ERASE picked on KNOB 4: OCT+ does it), DICE gone; the COMB / COMB- cut-off moved by the LFO and the ENV as the other filters; a key held and KNOB 1..4 its EFFECT (any, MOD a macro moved) TARGET (ALL SYN DRM T1..T6; MOD M1..M4) AMOUNT (MOD 1 BEAT .. 4 BARS) MODE (HOLD LATCH QUANT; MOD RAMP UP / DOWN SINE S&H), the mode said in the header; SELECT a slot (four, in the settings), OCT+ saves and plays it, OCT- leaves. V10.7.64: SCENE's LEADER PRESS (a key's note on every live track at once, each its own sound); SCENE on the live tracks only (it opened on T6, asleep with four: nothing heard, nothing drawn), every role with the key: a kit's DRUM loops its beat while a key is held, stopped too; the engines as the kit (the owner): FILTER TYPE CUT RES IMAGE (DIST the SENDS' only), PLAY POLY GLIDE UNISON VEL (the plain MORE gone, GL MODE off the panel), GAIN 0..+12 dB clean where a DRIVE was (ANALOG's MORE, WHEEL's COLOR; their DRIVE off the panel, kept), saved ('T' 'G'); FUGA's subject and answer on live tracks (the continuo after: with four tracks it began unheard); DUBSTEP's bass the wobble (a resonant low-pass on aLine truncated
#endif
#if FELUCCA_OTA && !FELUCCA_FLASH
#error "FELUCCA_OTA needs FELUCCA_FLASH"
+47 -19
View File
@@ -373,37 +373,65 @@ static __attribute__((noinline)) void life_mod(track_t *t, int32_t *off)
}
static void (*const volatile LIFE_MOD)(track_t *, int32_t *) = life_mod; /* (mod_begin's RAM copy: its reach) */
/* (V10.8.21, BYTE's) DRONE CLAY's four: what each adds now on its DEST, as a slot of the whole range (clay.c clay_tick;
* its AMOUNT in it) */
/* (BYTE's 1adbf0a6) a per-block destination id moved by x, Q15 of its range: its slot among the block's, kept to put back */
static void clay_off(const track_t *t, mod_t *mp, int32_t *off, uint32_t id, int32_t x)
{
const param_desc_t *pd = mod_track_desc(t, id);
uint32_t j;
for (j = 0; j < mp->nk && mp->kid[j] != id; j++)
;
if (j == mp->nk) {
if (j >= sizeof mp->kid) /* (V10.8.27: the HITs' CUTOFF and the held SUS beside the four:
* room for them only when the other slots leave it) */
return;
mp->kid[j] = (uint8_t)id;
mp->keep[j] = t->p[id];
off[j] = 0;
mp->nk++;
}
off[j] += (x * (id == P_LRATE ? 127 : pd->max - pd->min)) >> 15;
}
/* (FM) a destination's knob: CUTOFF on the engines whose filter is the track's (as the matrix), ANALOG's its E5 */
static uint32_t clay_param(const track_t *t, uint32_t d)
{
return d == MD_FCUT && t->engine == ENGI_ANALOG ? P_E4 : mod_param(d);
}
/* (V10.8.21, BYTE's; V10.8.27 its 1adbf0a6) DRONE CLAY's four: what each adds now on its DEST, as a slot of the whole
* range (clay.c clay_tick; its AMOUNT in it); the HITs' bundle: the voice as a drum on any engine (its pitch and noise,
* its level gated, the CUTOFF); a held drone held on any envelope */
static __attribute__((noinline)) void clay_mod(mod_t *mp, const track_t *t, uint32_t tr, int32_t *off)
{
const int16_t *p = t->p;
uint32_t k, j;
for (k = 0; k < 4u; k++) { /* (V10.8.21, BYTE's) DRONE CLAY's four: what each adds now on its DEST,
* as a slot of the whole range (seq.c clay.c clay_tick; its AMOUNT in it) */
const clay_hb_t *hb = &form_st[tr].hb;
uint32_t k;
if (hb->on) {
mp->pit += hb->pit;
mp->amp = 1u;
mp->gain = mulq15(mp->gain, hb->gain);
if (hb->cut)
clay_off(t, mp, off, clay_param(t, MD_FCUT), hb->cut);
}
if (!clay[tr][CL_RATE] && t->p[P_SUS] < 100) /* (the owner: "any engine") a held drone held: a decaying envelope
* (a pluck's, any engine's) sustains while it is (RATE: struck) */
clay_off(t, mp, off, P_SUS, (100 - t->p[P_SUS]) * 258);
for (k = 0; k < 4u; k++) {
uint32_t d = CLAY_MD[clamp(clay[tr][CL_MF(k, 0u)], 0, CLAY_ND - 1)], id;
int32_t x = clay_v[tr][k];
const param_desc_t *pd;
int32_t x = clay_vk(tr, k);
if (!d || !x)
continue;
if (d == MD_CUT && (t->engine == ENGI_WHEEL || t->engine == ENGI_DRUM ||
t->engine == ENGI_STRING || t->engine == ENGI_INPUT)) d = MD_FCUT;
if (d <= MD_AMP) {
if (clay_is_hit(clay[tr], k) && (d == MD_PITCH || d == MD_AMP))
continue; /* (a HIT's pitch and level: its bundle's) */
mp->amp |= d == MD_AMP;
mod_voice_add(MS_LFO, d, x, 64, &mp->pit, &mp->cut, &mp->shp, &mp->gain);
continue;
}
id = d == MD_FCUT && t->engine == ENGI_ANALOG ? P_E4 : mod_param(d);
pd = mod_track_desc(t, id);
for (j = 0; j < mp->nk && mp->kid[j] != id; j++)
;
if (j == mp->nk) {
mp->kid[j] = (uint8_t)id;
mp->keep[j] = p[id];
off[j] = 0;
mp->nk++;
}
off[j] += (x * (id == P_LRATE ? 127 : pd->max - pd->min)) >> 15;
id = clay_param(t, d);
if (id != P_LRATE && 2 * (int32_t)t->p[id] > mod_track_desc(t, id)->max + mod_track_desc(t, id)->min)
x = -x; /* (the owner: "a sensible depth") a knob over its middle moved down,
* under it up: a one-sided shape always has room */
clay_off(t, mp, off, id, x);
}
}
/* before a part's block (fx.c mix_part): the per-track offsets, the per-block destinations into t->p.
+11 -13
View File
@@ -280,8 +280,8 @@ static const param_desc_t DXIMG_DESC = {"IMAGE", F_INT, 0, 127, 0, 0}; /*
#define ID_SC0 0xE8u /* (V10.25) SCL > SCENE's four (ui_scene.c sc_desc) */
#define ID_MU0 0xE4u /* (V10.16) SEQ > MUTATE's four (EK_U0 + 0..3) */
#define ID_CL0 0xC0u /* (V10.8.21) DRONE CLAY's settings (seq.c clay.c clay_desc: CL_*) */
_Static_assert(ID_CL0 + CLAY_NF <= 0xDFu && P_COUNT < ID_CL0, "DRONE CLAY's ids between the parameters and GAIN's");
static const param_desc_t *clay_desc(const track_t *t, uint32_t f, int16_t **valp); /* (seq.c clay.c) */
_Static_assert(ID_CL0 + CL_SEL <= 0xDFu && P_COUNT < ID_CL0, "DRONE CLAY's ids between the parameters and GAIN's");
static const param_desc_t *clay_page_desc(const track_t *t, uint32_t f, int16_t **valp); /* (seq.c clay.c) */
static const param_desc_t *eu_desc(uint32_t k, int16_t **valp);
static const param_desc_t *sc_desc(uint32_t k, int16_t **valp); /* (V10.25) ui_scene.c */
static const char *const N_CHRD[] = {"OFF", "TRIAD", "7TH", "ADD9", "SUS2", "SUS4", "MAJ", "MIN", "7", "MAJ7", "MIN7",
@@ -763,8 +763,6 @@ static const page_t PAGES[] = {
{"SL PITCH", FAM_FX, SC_GLOBAL, GR_SLPIT, {0xFF, G_SLP0, G_SLPLEN, G_SLPQ}}, /* KNOB 1 the step (sl_ui_step) */
{"PUNCH IN", FAM_FX, SC_GLOBAL, GR_PUNCH, {0xFF, 0xFF, 0xFF, 0xFF}}, /* (V10.7.66, the owner) KNOB 1..4 the MACROS M1..M4
* (ui_input.c, ui_draw.c), OCT+ the punch-in editor */
{"PUNCH LANE", FAM_FX, SC_GLOBAL, GR_PUNCH, {G_PFXLEN, G_PFXRES, 0xFF, 0xFF}}, /* (0.6.99) the punch-in lane: LEN RES, REC,
* CLEAR (codex/coherence: was PUNCH, MASTER's knob's name) */
{"SCL", FAM_SCL, SC_TRACK, GR_SCALE, {P_ROOT, P_SCALE, P_QUANT, ID_ALLTR}}, /* (JIANT: ROOT, SCALE every melodic track's;
* 0.7.6: ALL TR, the global, where TRANS was: SCL 2 gone) */
{"CHORD", FAM_SCL, SC_TRACK, GR_NONE, {P_CHRD, P_CVOI, P_CSTR, 0xFF}}, /* (0.6.81) a key plays a chord (seq.c) */
@@ -902,13 +900,13 @@ static const page_t PAGES[] = {
{"EDIT 2", FAM_EDIT, SC_ENGINE, GR_NONE, {P_E7, P_E4, P_E5, P_E6}}, /* (codex/coherence) FM6's EDIT 2 (PATCH): SLOT on KNOB 1
* (rule 4: a page that picks, picks with KNOB 1), MEG VMOD SPREAD */
/* (V10.8.21, JIANT BYTE's DRONE CLAY) a track's sequencer: its drone, four modulators on the matrix (seq.c clay.c) */
{"DRONE CLAY", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + CL_ON, ID_CL0 + CL_OCT, ID_CL0 + CL_RATE, ID_CL0 + CL_RUN}},
{"CLAY MOD 1", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + 4u, ID_CL0 + 5u, ID_CL0 + 6u, ID_CL0 + 7u}},
{"CLAY MOD 2", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + 8u, ID_CL0 + 9u, ID_CL0 + 10u, ID_CL0 + 11u}},
{"CLAY MOD 3", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + 12u, ID_CL0 + 13u, ID_CL0 + 14u, ID_CL0 + 15u}},
{"CLAY MOD 4", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + 16u, ID_CL0 + 17u, ID_CL0 + 18u, ID_CL0 + 19u}},
{"CLAY DECAY", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + CL_DEC, ID_CL0 + CL_DEC + 1u, ID_CL0 + CL_DEC + 2u, ID_CL0 + CL_DEC + 3u}},
{"CLAY TIME", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + CL_STEP, ID_CL0 + CL_SEED, 0xFF, 0xFF}},
/* (V10.8.27, BYTE's 1adbf0a6) DRONE CLAY: ON, the drone's OCT, its PITCH, its RATE; CLAY MOD and CLAY RHYTHM: KNOB 1
* the MOD (1 .. 4), the others its DEST SHAPE AMOUNT, its RATE EUCLID DECAY (MOD 1's ids: clay.c clay_page_desc);
* CLAY TIME: RUN SEED */
{"DRONE CLAY", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + CL_ON, ID_CL0 + CL_OCT, ID_CL0 + CL_PIT, ID_CL0 + CL_RATE}},
{"CLAY MOD", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + CL_SEL, ID_CL0 + CL_M0, ID_CL0 + CL_M0 + 1u, ID_CL0 + CL_M0 + 3u}},
{"CLAY RHYTHM", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + CL_SEL, ID_CL0 + CL_M0 + 5u, ID_CL0 + CL_M0 + 2u, ID_CL0 + CL_M0 + 4u}},
{"CLAY TIME", FAM_SEQ, SC_TRACK, GR_CLAY, {ID_CL0 + CL_RUN, ID_CL0 + CL_SEED, 0xFF, 0xFF}},
};
#define SPLIT_PAGE(pg) ((uint32_t)((pg)->graph - GR_SPLIT) < 2u)
#define FIT_PAGE(pg) ((pg)->graph == GR_STEPS && (pg)->id[1] == 0xFFu) /* RHYTHM (BAR: KNOB 2 LEN) */
@@ -1024,8 +1022,8 @@ static const param_desc_t *page_desc(const page_t *pg, uint32_t slot, int16_t **
return eu_desc(id - ID_MU0 + 8u, valp);
if (id >= ID_SC0 && id < ID_SC0 + 4u) /* (V10.25) SCENE's */
return sc_desc(id - ID_SC0, valp);
if (id >= ID_CL0 && id < ID_CL0 + CLAY_NF) /* (V10.8.21) DRONE CLAY's (seq.c clay.c clay_desc) */
return clay_desc(TSEL, id - ID_CL0, valp);
if (id >= ID_CL0 && id <= ID_CL0 + CL_SEL) /* (V10.8.21) DRONE CLAY's (seq.c clay.c clay_page_desc) */
return clay_page_desc(TSEL, id - ID_CL0, valp);
*valp = &TSEL->p[id];
if (id == P_APRATE && TSEL->p[P_APSYNC]) /* (0.6.9) AUTO PAN on the tempo: a division */
return &AP_BEAT;
+22 -10
View File
@@ -132,8 +132,9 @@ typedef struct {
* block after the kit's, when one is set; absent: 0 */
uint8_t dx_gain; /* (V10.7.63) the kit's GAIN (eng_drum.c dx_gain, 0..12): FUNC's 'K' 'G' block
* after LIFE's, when set; absent: 0 */
uint8_t clay[NTRK][CLAY_NF]; /* (V10.8.21) DRONE CLAY (seq.c clay.c clay, 0..127): FUNC's 'C' 'Y' blocks
* (track, its settings) after DRUM-X's MATH, one per track ON; absent: off */
uint8_t clay[NTRK][CLAY_NF]; /* (V10.8.21) DRONE CLAY (seq.c clay.c clay_pack, 0..127): FUNC's 'C' 'L' blocks
* (track, its count, its settings; V10.8.27, BYTE's: 'C' 'Y' the first
* layout's, clay_from_v1) after DRUM-X's MATH, one per track ON; absent: off */
uint8_t lf[4]; /* (V10.7.62) LIFE (params.c life_v, 0..100): FUNC's 'L' 'F' block after
* MACROS', when any is set; absent: all 0 (off) */
uint32_t sum;
@@ -606,7 +607,7 @@ static uint32_t proj_packed_size(const project_t *q)
for (i = 0; i < 8u && !q->dx_fml[i]; i++) {}
n += i < 8u ? 18u : 0u; /* (V10.7.74) DRUM-X's MATH modulators */
for (t = 0; t < NTRK; t++) /* (V10.8.21) DRONE CLAY */
if (q->clay[t][CL_ON]) n += 3u + CLAY_NF;
if (q->clay[t][CL_ON]) n += 4u + CLAY_NF;
return n;
}
static int proj_split_ok(const uint8_t *s)
@@ -824,7 +825,7 @@ static int proj_pack(project_store_t *out, const project_t *q)
}
for (i = 0; i < NTRK; i++) /* (V10.8.21) DRONE CLAY: a block per track ON (the last) */
if (q->clay[i][CL_ON]) {
b[pos++] = 'C'; b[pos++] = 'Y'; b[pos++] = (uint8_t)i;
b[pos++] = 'C'; b[pos++] = 'L'; b[pos++] = (uint8_t)i; b[pos++] = (uint8_t)CLAY_NF;
memcpy(b + pos, q->clay[i], CLAY_NF); pos += CLAY_NF;
}
memcpy(b + PROJC_PFX_OFF, q->pfx_lane, sizeof q->pfx_lane);
@@ -1188,10 +1189,21 @@ static int proj_unpack_c(project_t *q, const uint8_t *b)
pos += 18u;
}
memset(q->clay, 0, sizeof q->clay); /* (V10.8.21) DRONE CLAY: as saved, else off */
while (pos + 3u + CLAY_NF <= room && b[pos] == 'C' && b[pos + 1u] == 'Y') {
if (b[pos + 2u] < NTRK)
for (i = 0; i < CLAY_NF; i++) q->clay[b[pos + 2u]][i] = b[pos + 3u + i] & 127u;
pos += 3u + CLAY_NF;
while (pos + 4u <= room && b[pos] == 'C' && (b[pos + 1u] == 'Y' || b[pos + 1u] == 'L')) { /* (V10.8.27, BYTE's: 'C' 'Y'
* the first layout's; 'C' 'L' its count with it: a later one's more
* left, fewer the rest as a first one's) */
uint32_t tr = b[pos + 2u], y = b[pos + 1u] == 'Y', len = y ? CLAY_V1 : b[pos + 3u], at = pos + (y ? 3u : 4u);
if (!len || at + len > room) break;
if (tr < NTRK) {
if (y)
clay_from_v1(b + at, q->clay[tr]);
else {
uint8_t d[CLAY_NF];
clay_pack(clay_v2_def, d);
for (i = 0; i < CLAY_NF; i++) q->clay[tr][i] = (uint8_t)((i < len ? b[at + i] : d[i]) & 127u);
}
}
pos = at + len;
}
proj_new_tracks(q, nt); /* (a FUNC of fewer tracks: the rest at power-on) */
for (t = nt; t < NTRK; t++)
@@ -1345,7 +1357,7 @@ static __attribute__((noinline)) void proj_master_put(project_t *p)
for (k = 0; k < 4u; k++) p->lf[k] = (uint8_t)clamp(life_v[k], 0, 100); /* (V10.7.62) LIFE, the same */
p->dx_gain = (uint8_t)clamp(dx_gain, 0, 12); /* (V10.7.63) the kit's GAIN, as the kit's TONE */
for (k = 0; k < NTRK; k++) p->tgain[k] = (uint8_t)clamp(trk_gain[k], 0, 12); /* (V10.7.64) */
for (k = 0; k < NTRK * CLAY_NF; k++) (&p->clay[0][0])[k] = (uint8_t)clamp((&clay[0][0])[k], 0, 127); /* (V10.8.21) */
for (k = 0; k < NTRK; k++) clay_pack(clay[k], p->clay[k]); /* (V10.8.21) DRONE CLAY */
for (k = 0; k < 4u; k++) p->eq[k] = (int8_t)eq_v[k];
p->tp[0] = (uint8_t)tape_v[0]; p->tp[1] = (uint8_t)tape_v[1];
}
@@ -1613,7 +1625,7 @@ static int project_restore_runtime(const project_t *input)
for (k = 0; k < 4u; k++) life_v[k] = p->lf[k] > 100u ? 100 : p->lf[k]; /* (V10.7.62) LIFE */
dx_gain = p->dx_gain > 12u ? 12 : p->dx_gain; /* (V10.7.63) the kit's GAIN */
for (k = 0; k < NTRK; k++) trk_gain[k] = p->tgain[k] > 12u ? 12 : p->tgain[k]; /* (V10.7.64) */
for (k = 0; k < NTRK * CLAY_NF; k++) (&clay[0][0])[k] = (&p->clay[0][0])[k] & 127u; /* (V10.8.21) DRONE CLAY */
for (k = 0; k < NTRK; k++) clay_unpack(p->clay[k], clay[k]); /* (V10.8.21) DRONE CLAY */
memset(clay_dn, 0, sizeof clay_dn); memset(clay_nn, 0, sizeof clay_nn); /* (its notes: the load's all-off) */
}
{ /* (V10.31) SCENE */
+1 -1
View File
@@ -601,7 +601,7 @@ static void jam_round_end(void)
jam_vos &= (uint8_t)~(1u << K); /* (the player's is the take's now) */
jam_undo = 1;
live.rec_done = 1;
ui_message("TRACK DONE: OCT- UNDO");
ui_message("TRACK DONE");
}
static uint32_t jam_len(void) /* the take's length in 16ths (its END), 0 none */
{
+1 -2
View File
@@ -2048,7 +2048,7 @@ static uint32_t act_cols(void) /* the columns that are actions
uint32_t c, m = 0;
if (ui.home)
return 0;
if (pg->graph == GR_MOTION || (pg->graph == GR_PUNCH && pg->id[0] != 0xFF)) return 8u; /* (0.6.99) PUNCH: KNOB 4
if (pg->graph == GR_MOTION) return 8u; /* (0.6.99) PUNCH: KNOB 4
* CLEAR (V10.7.70: PUNCH LANE's only; PUNCH IN its knobs the
* macros, OCT+ the editor) */
if (pg->graph == GR_EVENTS || pg->graph==GR_TRACKGEN) return 16u;
@@ -2083,7 +2083,6 @@ static const char *act_name(uint32_t c) /* column c's action (the foote
{
static const char *const UP_GO[3] = {"LOAD", "ERASE", "SAVE"};
uint32_t id = cur_page()->id[c & 3u];
if (cur_page()->graph == GR_PUNCH) return "ERASE"; /* (snd2) the punch-in lane only (V10.7.62: CLR AUTO cut) */
if (cur_page()->graph == GR_MOTION) return "CLEAR";
if (cur_page()->graph == GR_EVENTS) return ev_act_name();
if (cur_page()->graph == GR_LYRIC) return "TYPE";
+3 -22
View File
@@ -1448,17 +1448,6 @@ static void draw_columns(void)
r < n ? VAL(3u) : T_DIM, RATIO(d, enum_rank(d, v)), param_icon(d, v));
return;
}
if (cur_page()->graph == GR_PUNCH) { /* (0.6.99) the punch-in lane: LEN, RES, its state, CLEAR */
uint32_t n = 0, i;
for (i = 0; i < 64u; i++) n += pfx_lane_at(i) != 0u;
fmt_int(val, song.g[G_PFXLEN]);
draw_column(0, "LEN", val, "ST", VAL(0u), RATIO(&GP[G_PFXLEN], song.g[G_PFXLEN]), ICON_AUTO);
hot_text_column(1, "RES", N_PFXRES[(uint32_t)clamp(song.g[G_PFXRES], 0, 2)]);
fmt_int(val, (int32_t)n);
text_column(2, pfx_rec_ok() ? "REC" : song.playing ? "PLAY" : "STEPS", pfx_rec_ok() ? "ON" : song.playing ? "ON" : val, pfx_rec_ok() ? T_ACCENT : T_MID);
draw_act_column(3, "ERASE", n ? T_MID : T_DIM, ICON_X_MOTION_DEL); /* (snd2: the lane only) */
return;
}
if (cur_page()->graph == GR_MOTION) {
hot_text_column(0, "PLAY", motion_enabled(TSEL) ? "ON" : "OFF");
fmt_int(val, (int32_t)(motion_count(TSEL) - motion_lock_count(TSEL)));
@@ -2007,7 +1996,6 @@ static void confirm_text(char *a, char *b)
str_cpy(a, "OVERWRITE PROJECT ", 24);
fmt_int(a + str_len(a), (int32_t)k + 1);
str_cpy(a + str_len(a), "?", 2);
str_cpy(b, "NEXT: K3 SONG OR LOOP", 24); /* (on the NAME screen that follows) */
break;
case CF_OVR_PROJ:
str_cpy(a, "OVERWRITE PROJECT A?", 24);
@@ -2029,21 +2017,19 @@ static void confirm_text(char *a, char *b)
break;
case CF_CPU_TEST: /* (0.6.83) SAVE > TOOLS 6 */
str_cpy(a, "BUILD CPU TEST SONG?", 24);
str_cpy(b, "UNDO AFTER: GLO + G4", 24);
str_cpy(b, "UNDO: GLO + G4", 24);
break;
case CF_INIT_SYS: /* (0.6.40) SAVE > TOOLS; (V10.7.22) CLEAR PROJECT, MENU > INIT */
str_cpy(a, "CLEAR PROJECT?", 24);
str_cpy(b, "THE SAVED ONE STAYS", 24);
break;
case CF_DICE_SOUND: /* (0.6.65) EDIT + SELECT: heard already */
case CF_DICE_LFO:
case CF_DICE_FX:
str_cpy(a, drum_track(TSEL) ? "KEEP DICED KIT?" : "KEEP DICED SOUND?", 24);
str_cpy(b, "SELECT: DICE AGAIN", 24);
break;
case CF_DICE_ALL: /* (0.6.21) HOME + SELECT */
str_cpy(a, "DICE EVERYTHING?", 24);
str_cpy(b, "UNDO AFTER: GLO + G4", 24);
str_cpy(b, "UNDO: GLO + G4", 24);
break;
case CF_RECALL_SOUND:
str_cpy(a, drum_track(TSEL) ? "RECALL SOUND + KIT?" : "RECALL SAVED SOUND?", 24);
@@ -2051,12 +2037,8 @@ static void confirm_text(char *a, char *b)
case CF_CLEAR_MOTION:
str_cpy(a, "CLEAR T1 AUTOMATION?", 24); a[7] = (char)('1' + k % NTRK);
break;
case CF_CLEAR_PFX:
str_cpy(a, "CLEAR PUNCH IN LANE?", 24); /* (snd2: the lane only) */
break;
case CF_CLEAR_COMP: /* (V10.7.62) SEQ > STEP FX, OCT- */
str_cpy(a, "CLEAR T1 STEP FX?", 24); a[7] = (char)('1' + k % NTRK);
str_cpy(b, "THE NOTES STAY", 24);
break;
case CF_OVR_USER:
str_cpy(a, "OVERWRITE ", 24);
@@ -2071,8 +2053,7 @@ static void confirm_text(char *a, char *b)
case CF_ERASE_SECT: /* (V10.17) SAVE > PART SLOTS > ERASE */
str_cpy(a, "ERASE PART A?", 24);
a[11] = (char)('A' + (k & 3u));
str_cpy(b, graph_project_used(k & 3u) && graph_project_name(k & 3u)[0] ? graph_project_name(k & 3u) :
"THE SLOT GOES EMPTY", 24);
str_cpy(b, graph_project_used(k & 3u) && graph_project_name(k & 3u)[0] ? graph_project_name(k & 3u) : "", 24);
break;
case CF_ERASE_USER:
str_cpy(a, "ERASE ", 24);
+2 -5
View File
@@ -216,8 +216,7 @@ static void graph_sing(const track_t *t)
uint16_t bg = cv_bg;
char b[64];
if (!lang) {
cv_text_in(PANEL_X0, 44, PANEL_W, &AF_X, "LANG OFF: VOWELS", T_MID, bg);
cv_text_in(PANEL_X0, 58, PANEL_W, &AF_X, "LANG ES EN JA: WORDS", T_MID, bg);
cv_text_in(PANEL_X0, 44, PANEL_W, &AF_X, "LANG OFF", T_MID, bg);
return;
}
str_cpy(b, N_LANG[lang], sizeof b);
@@ -1220,9 +1219,7 @@ static __attribute__((noinline)) void seq_overlay(const track_t *t, const page_t
if (mine == CA_RAMP && k >= base && k < base + 16u && bt_hw_seg())
ramp_draw_bt(t, dr, top, k - base);
if (bn_on(1)) /* (V10.8.8) the component held, large (V10.8.9; V10.8.13: 0.6 s on) */
hold_banner(bn_nm, bn_k, rec_on(t));
else
cv_text_r(236, (int32_t)graph_h() - 9, &AF_X, "HOLD A KEY: STEP FX", T_MID, cv_bg); /* (V10.8.22: at the foot, off the steps) */
hold_banner(bn_nm, bn_k, rec_on(t)); /* (V10.8.27: the "HOLD A KEY" hint gone) */
} else if (pg->graph == GR_MOTION || pg->graph == GR_EVENTS) {
uint8_t idx[MOTION_MAX];
uint32_t n = ev_rows(idx), cur = ev_row(n);
+4 -33
View File
@@ -4,18 +4,7 @@
/* Felucca UI input: LEDs, knobs and buttons, SEQ step entry, panel setup. */
#include "ui_name.c" /* NAME: naming user presets and projects */
static uint8_t fx_mon; /* (V10.7.59) ui_layer.c: the FX layer moved the MACROS */
/* (V10.7.60, the users: "I don't know what I turned") a knob's plain meaning in the header while it turns (its card
* keeps the value): the labels that need one */
/* (V10.60) a knob's meaning, by its label: "LABEL" "\0" "HINT" "\0" in one string (V10.7.62, BYTE's: no pointers,
* ~600 B of flash); its end the "" after the last */
static void knob_hint(const char *label) /* (V10.7.81: CHORD's the one left, no table) */
{
if (!label || (ui_help_off & 1u)) /* (MENU > DISPLAY > HELP OFF) */
return;
if (str_eq(label, "CHORD"))
ui_say("EACH KEY ITS OWN CHORD", "");
}
/* (V10.8.27) the knobs' hints in the header gone for the flash (DRONE CLAY's fix) */
static void fx_macro_back(void);
/* ----------------------------------------------------------- LEDs --- */
/* The LED picture is built off-line and copied one byte per column: clearing
@@ -1607,7 +1596,6 @@ sect:
}
if (pg->id[0] == G_MIDI && pg->scope == SC_GLOBAL) { /* (V10.6z8, a Discord user) GLO > SYSTEM 2 shows, edits nothing */
ui_message("EDIT: MENU > BLUETOOTH");
str_cpy(ui.msg2, "HOLD HOME, TAB SYSTEM", sizeof ui.msg2);
return;
}
d = page_desc(pg, slot, &vp);
@@ -1626,8 +1614,8 @@ sect:
sc_put((uint32_t)(vp - sc_v), v);
return;
}
if (vp >= &clay[0][0] && vp < &clay[NTRK][0]) { /* (V10.8.21, BYTE's) DRONE CLAY's settings (seq.c clay.c clay_put) */
clay_put((uint32_t)(vp - &clay[0][0]), was_clay, v);
if (vp >= clay_ui && vp < clay_ui + CLAY_NF) { /* (V10.8.21, BYTE's) DRONE CLAY's settings, their view (clay.c clay_put) */
clay_put(song.sel, (uint32_t)(vp - clay_ui), was_clay, v);
return;
}
if (vp >= eu_v && vp < eu_v + EK_N) { /* (V10.6) EUCLID / MODES: the setting, the pattern again */
@@ -1704,11 +1692,6 @@ static __attribute__((noinline)) void act_do(void)
ui_message(pos?"PLACED":"PLACED: AUTO");
return;
}
if (cur_page()->graph == GR_PUNCH) { /* (0.6.99) the punch-in lane cleared (a dialog) */
if (chain_busy()) { ui_message("SONG PLAYS: STOP IT TO EDIT"); return; }
confirm_open(CF_CLEAR_PFX, song.sel);
return;
}
if (cur_page()->graph == GR_EVENTS) {
ev_oct();
return;
@@ -2756,8 +2739,6 @@ static void ui_input_frame(void)
ui_message(dk.msg);
} else if (kind == CF_LOAD_PAT) {
pat_load_ui(&trk[ui.confirm_trk % NTRK], pat_pick());
} else if (kind == CF_CLEAR_PFX) { /* (0.6.99) FX > PUNCH > CLEAR */
if (!chain_busy()) { memset(pfx_lane, 0, sizeof pfx_lane); pfx_ltgt = 0; ui_message("PUNCH IN LANE CLEARED"); }
} else if (kind == CF_CLEAR_COMP) { /* (V10.7.62) every step component of the track */
track_t *t = &trk[ui.confirm_trk % NTRK];
uint32_t i, n = 0;
@@ -3080,8 +3061,6 @@ static void ui_input_frame(void)
}
if (!ui.home && !ui.menu && !ui.confirm) { /* (V10.7.60) its meaning in the header */
const param_desc_t *hd = page_desc(pg, k, &hv);
if (hd)
knob_hint(hd->label);
if (hd && hd->label && ((hd->label[0] == 'S' && hd->label[1] == 'R') || (hd->label[0] == 'D' && hd->label[1] == 'E')) &&
pg->graph == GR_MOD) /* (V10.8.22) a slot's SRC / DEST: its full names (mx_banner) */
mxn_s = (uint8_t)(hd->label[str_len(hd->label) - 1u] - '0');
@@ -3093,15 +3072,7 @@ static void ui_input_frame(void)
const param_desc_t *d = home_param(k, &vp);
int32_t was = *vp;
*vp = (int16_t)param_turn(d, *vp, accel(EN_K1 + k, s, d->fmt == F_ENUM ? 0 : d->max - d->min));
if (home_life()) { /* (V10.7.62) LIFE: the project's, no track's */
static const char *const LH[4] = {"HITS CLOSE, NOTES OPEN", "THE OTHERS SHAPE IT",
"KICKS DUCK THE SYNTHS", "THE OTHERS FEED THE SENDS"};
if (ui.msg_t && str_eq(ui.msg, LH[k & 3u]))
ui.msg_t = 40; /* (still turning: it stays) */
else if (!(ui_help_off & 1u))
ui_say(LH[k & 3u], "");
}
else {
if (!home_life()) { /* (V10.7.62) LIFE: the project's, no track's (V10.8.27: its hints gone) */
knob_cap(TSEL, (uint32_t)(vp - TSEL->p));
excite_turn(TSEL, vp, was);
}
-1
View File
@@ -1373,7 +1373,6 @@ static BTAPP_FN int pke_oct_bt(int up)
pk.edit = 1;
fx_lock = 1; /* (the FX layer locked open: the keys its, the map shown) */
ui_message("HOLD A KEY");
str_cpy(ui.msg2, "OCT+ SAVE OCT- EXIT", sizeof ui.msg2);
} else if (up) {
memcpy(pk_row(pk.eslot, 0), pk.we, PK_KEYS);
memcpy(pk_row(pk.eslot, 1), pk.wo, PK_KEYS);
+2 -3
View File
@@ -82,8 +82,7 @@ static const nv_t CE_SEQ[] = {NV("STEP", 0, 0, LV_BAR), NV("PATTERN", "LENGTH",
NV("PLAYHEADS", 0, 3, LV_PAT),
NV("COMP", "STEP FX", 4, LV_STEP), NV("COMP 2", "STEP FX 2", 4, LV_STEP), NV("AUTOMATION", 0, 5, LV_BAR),
NV("AUTO LIST", 0, 5, LV_BAR), NV("LYRIC STEP",0,5,LV_BAR),NV("TRACK GEN",0,6,LV_BAR),
NV("DRONE CLAY", 0, 7, LV_PAT), NV("CLAY MOD 1", 0, 7, LV_PAT), NV("CLAY MOD 2", 0, 7, LV_PAT),
NV("CLAY MOD 3", 0, 7, LV_PAT), NV("CLAY MOD 4", 0, 7, LV_PAT), NV("CLAY DECAY", 0, 7, LV_PAT),
NV("DRONE CLAY", 0, 7, LV_PAT), NV("CLAY MOD", 0, 7, LV_PAT), NV("CLAY RHYTHM", 0, 7, LV_PAT),
NV("CLAY TIME", 0, 7, LV_PAT)}; /* (V10.8.21: BYTE's DRONE CLAY) */ /* (V10.8.20: STRETCH gone) */
static const ng_t CG_SEQ[] = {{"STEP", 0}, {"PATTERN", "PAT"}, {"EUCLID", "EUCL"}, {"PLAYHEADS", "HEAD"},
{"STEP FX", "SFX"}, {"AUTO", 0}, {"TRACK GEN", "GEN"}, {"DRONE CLAY", "CLAY"}}; /* (V10.7.59: STEP FX, was COMP) */ /* (codex/coherence: PATTERN, was LENGTH: its
@@ -93,7 +92,7 @@ static const nv_t CE_FX[] = {NV("FX", "SENDS", 0, FXL_TRACK), NV("DIST", 0, 0, F
NV("BUSES", 0, 1, FXL_BUSES), NV("DLY", 0, 2, FXL_EFFECT), NV("DLY 2", 0, 2, FXL_EFFECT),
NV("DLY 3", 0, 2, FXL_EFFECT), NV("REVERB", 0, 3, FXL_EFFECT), NV("REVERB 2", 0, 3, FXL_EFFECT),
NV("CHORUS", 0, 4, FXL_EFFECT), NV("SLICER", 0, 5, FXL_EFFECT), NV("SL BUS", 0, 5, FXL_EFFECT),
NV("SL BUS 2", 0, 5, FXL_EFFECT), NV("SL PITCH", 0, 5, FXL_EFFECT), NV("PUNCH IN", 0, 6, FXL_EFFECT), NV("MACROS", 0, 6, FXL_EFFECT), NV("PUNCH LANE", "LANE", 6, FXL_EFFECT),
NV("SL BUS 2", 0, 5, FXL_EFFECT), NV("SL PITCH", 0, 5, FXL_EFFECT), NV("PUNCH IN", 0, 6, FXL_EFFECT), NV("MACROS", 0, 6, FXL_EFFECT),
NV("MASTER", 0, 7, FXL_EFFECT), NV("TAPE", 0, 7, FXL_EFFECT),
NV("EQ", 0, 7, FXL_EFFECT)}; /* (p9: the master's EQ) */ /* (0.9.9-snd2: MASTER last, the
* end of the chain; snd8: its TAPE) */
+1 -1
View File
@@ -276,7 +276,7 @@ static void graph_eco(void)
cv_text_in(px - 30, ny, 60, &AF_S, num, eco_off(c) ? T_DIM : trk_col(c), T_SURF); /* (V10.8.10) */
}
if (home_set()) /* (V10.7.62) LIFE (was MACROS: the FX layer's knobs since V10.7.59) */
cv_text(6, 2, &AF_X, life_on ? "TRACKS MOVE EACH OTHER" : "LIFE OFF: TURN A KNOB", life_on ? T_MID : T_DIM);
cv_text(6, 2, &AF_X, life_on ? "LIFE ON" : "LIFE OFF", life_on ? T_MID : T_DIM);
}
/* BEING: the track's being large, its HOME knobs as organs at the corners */
static const int16_t ORG_X[4] = {30, 210, 30, 210}, ORG_Y[4] = {28, 28, 116, 116};
+2 -2
View File
@@ -288,14 +288,14 @@ static __attribute__((noinline)) void graph_chord(const track_t *t)
param_format(&CHORD_DESC[1], t->p[P_CVOI], v, &u);
str_cpy(b + str_len(b), v, 32 - str_len(b));
} else
str_cpy(b, "CHORD OFF \xB7 ONE NOTE A KEY", 32);
str_cpy(b, "CHORD OFF", 32);
kd = (key + 12u - rt) % 12u;
for (k = 0; k < NVOICE; k++) snd |= t->v[k].active && t->v[k].gate;
for (d = 0; d < c; d++) if (deg[d] == kd) pd = d;
n = t->p[P_CHRD] ? chord_peek(t, key, pn) : 0u;
if (n == 1u) { /* (V10.8.20) CHORD on, one note sounds: say why (a kit, not POLY) */
str_cpy(nm, drum_track(t) ? "DRUM TRACK" : "NOT POLY", sizeof nm);
str_cpy(b, drum_track(t) ? "CHORDS PLAY ON SYNTH TRACKS" : "CHORDS NEED EDIT > PLAY > POLY", 32);
b[0] = 0;
n = 0;
} else if (t->p[P_CHRD]) chord_label(pn, n, nm, 1); else str_cpy(nm, "OFF", sizeof nm);
cv_text(10, 4 - AF_L_CAP_Y + 1, text_w(&AF_L, nm) <= 220 ? &AF_L : &AF_M, nm, snd ? HUD_YE : t->p[P_CHRD] ? tc : T_DIM);
+4 -22
View File
@@ -94,8 +94,7 @@ static __attribute__((noinline)) void graph_lz_tools(void)
}
cv_rect(4, (int32_t)h - 20, 232, 6, T_RAISE); /* OCT+ held: the bar */
if (hold > 0) cv_rect(4, (int32_t)h - 20, hold > 232 ? 232 : hold, 6, col);
cv_text_in(4, (int32_t)h - 11, 232, &AF_X, ui.act == 1u ? "OCT+ ASKS FIRST" : ui.act ? "HOLD OCT+ TO DO IT" :
"TURN A KNOB TO PICK", T_MID, T_SURF);
if (ui.act > 1u) cv_text_in(4, (int32_t)h - 11, 232, &AF_X, "HOLD OCT+", T_MID, T_SURF); /* (V10.8.27: hints cut) */
}
/* the song's length and END ("120 BARS . LOOP") into b (24) */
static void song_len_txt(char *b, uint32_t total)
@@ -183,8 +182,6 @@ static void graph_parts(void)
song_strip(110, 10, ui.part & 3u, 0);
else
cv_text(4, 110, &AF_X, "NO SONG ROWS", T_DIM);
GFX_HOOK_ALIGN(0, 128, 0, 139, AL_V | AL_PASS, "parts hint");
cv_text(4, 128, &AF_X, "OCT+ LOOP \xB7 OCT- SONG \xB7 F3-B3 A-D", T_MID);
}
/* (V10.6s, the owner's mock-up C) CLIPS: the six tracks x the four parts, a cell a track's pattern in a part (its part's
* colour calm where it plays there, grey where silent or the part empty); the part each track sounds framed in its
@@ -233,19 +230,6 @@ static void jam_lanes(int32_t y, int32_t dy, int32_t h, int32_t sel)
}
if (xp) cv_rect((int32_t)xp, y - dy * NTRK - 2, 1, dy * NTRK + 2, T_TEXT);
}
/* (V10.8.9, the owner) the song mode's hint, by its state (MENU > DISPLAY > HELP OFF: none); the cards name the knobs */
static const char *song_hint(void)
{
if (ui_help_off & 1u)
return 0;
if (SONG_TAKE(cur_page()))
return jam_len() ? "OCT+ A NEW CHANGE \xB7 OCT- DELETE IT" : "NO TAKE: REC ONE ON JAM";
return live.srec == 2u ? "RECORDING: CHANGE SEQS \xB7 REC ENDS" : live.srec ? "REC: FROM THE NEXT BAR" :
jam_tr & 8u ? "RECORDING THE TRACK: ONE ROUND" : jam_tr ? "TRACK REC: FROM THE TAKE START" :
jam_undo ? "OCT- UNDO THE ROUND" : jam_lock ? "PLAY OVER IT: YOU \xB7 REC: REDO A TRACK" :
jam_len() ? "K4 LOCK: THE TAKE PLAYS \xB7 JAM OVER IT" :
song.playing ? "KEYS A-D ALL \xB7 OCT+ GO \xB7 REC: A TAKE" : "PLAY \xB7 KEYS A-D ALL \xB7 OCT+ GO \xB7 OCT- STOP";
}
static void graph_clips(void) /* (V10.8.2) and TAKE: the take full screen, the change picked */
{ /* ringed, its track lit */
uint32_t s, k, i, tk = SONG_TAKE(cur_page()), full = tk || jam_full(), hi = song.sel;
@@ -289,8 +273,6 @@ static void graph_clips(void) /* (V10.8.2) and TAKE: t
}
} else if (jam_len())
jam_lanes(120, 3, 2, -1);
if (song_hint()) /* (V10.8.9) TAKE: over its lanes (its zoom row below) */
cv_text(tk ? 26 : 4, tk ? 2 : 128, &AF_X, song_hint(), live.srec || jam_tr ? T_ACCENT : T_MID);
}
/* (V10.6o, the owner's mock-up B) TIMELINE: the song as blocks (the cursor's row framed), what plays; under it the row
* opened: each track's bar (its own part's colour calm, another part's bright with FROM and its letter,
@@ -310,7 +292,7 @@ static __attribute__((noinline)) void graph_tl(void)
uint32_t n = chain_config.count, r = ui.song_row < n ? ui.song_row : n - 1u, k;
char b[24];
if (!n) {
cv_text_in(4, 60, 232, &AF_X, "NO ROWS: OCT+ ADDS ONE", T_MID, T_SURF);
cv_text_in(4, 60, 232, &AF_X, "NO ROWS", T_MID, T_SURF);
return;
}
song_strip(3, 18, 4u, 1);
@@ -411,7 +393,7 @@ static void graph_score(int gen)
if (gen)
return;
if (!n) {
cv_text_in(4, 128, 232, &AF_X, "NO ROWS: OCT+ ADDS ONE", T_MID, T_SURF);
cv_text_in(4, 128, 232, &AF_X, "NO ROWS", T_MID, T_SURF);
return;
}
if (ui.song_row < n) { /* the row picked: ROW n/N . its part and bars */
@@ -476,7 +458,7 @@ static void graph_proj(void)
return;
song_len_txt(b, total);
GFX_HOOK_ALIGN(0, 128, 0, 139, AL_V | AL_PASS, "project song length");
cv_text_r(236, 128, &AF_X, n ? b : "NO ROWS: OCT+ ADDS ONE", T_MID, T_SURF);
cv_text_r(236, 128, &AF_X, n ? b : "NO ROWS", T_MID, T_SURF);
}
/* a being small at (cx, cy) radius r (px): engine e's species, its outline in heat c; 24 vertices (bg_outline's form,
* its spikes and lobes, at a slot's size: a quarter of the lines) */
+4 -4
View File
@@ -416,7 +416,7 @@ static __attribute__((noinline)) void nm_draw_panel(void)
}
cv_text(14 + 14 * (int32_t)n, 48 - AF_X_CAP_Y, &AF_X, "TAP AGAIN: NEXT", T_MID);
} else
cv_text(10, 48 - AF_X_CAP_Y, &AF_X, nm.num ? "ONE TAP, ONE CHARACTER" : "TAP AGAIN: NEXT", T_MID);
cv_text(10, 48 - AF_X_CAP_Y, &AF_X, "TAP AGAIN: NEXT", T_MID);
GFX_HOOK_ALIGN(4, 0, 236, 0, AL_H | AL_CELLS | AL_N(8), "name keys' row in the panel");
for (i = 0; i < 16u; i++) { /* the white keys: the left octave, then the right one */
int32_t x = 9 + 28 * (int32_t)(i % 8u), y = i < 8u ? 62 : 84;
@@ -442,9 +442,9 @@ static __attribute__((noinline)) void nm_draw_panel(void)
static void nm_draw_foot(void)
{
cv_begin(240, LZ_FOOT_H, T_BG);
cv_text(6, CRUMB_Y, &AF_X, nm.kind == NK_LYRIC ? "LENTE \xB7 LYRIC \xB7 K3 DICE \xB7 OCT- CANCEL" : /* (0.8.5: playing too) */
transport_busy() ? "LENTE \xB7 NAME \xB7 STOP TO SAVE" :
nm.kind == NK_SONG_SAVE ? "NAME \xB7 K3 SONG/LOOP \xB7 OCT- CANCEL" : "LENTE \xB7 NAME \xB7 OCT- CANCEL", T_DIM);
cv_text(6, CRUMB_Y, &AF_X, nm.kind == NK_LYRIC ? "K3 DICE \xB7 OCT- CANCEL" : /* (0.8.5: playing too) */
transport_busy() ? "STOP TO SAVE" :
nm.kind == NK_SONG_SAVE ? "K3 SONG/LOOP \xB7 OCT- CANCEL" : "OCT- CANCEL", T_DIM);
cv_blit(0, LZ_FOOT_Y);
}
static void name_draw(void)
+4 -11
View File
@@ -106,8 +106,8 @@ static __attribute__((noinline)) void sc_put(uint32_t k, int32_t v)
{
char b[16] = "SCENE: T1 LEADS";
b[8] = (char)('1' + (scn_on >= 2u ? scn_on - 2u : 0u));
ui_message(!scn_on ? "SCENE OFF: ONE TRACK" : need ? "T5 T6 ASLEEP: MENU > 6 TRACKS" :
scn_on == 1u ? "SCENE: KEYS PLAY ROLES" : b);
ui_message(!scn_on ? "SCENE OFF" : need ? "T5 T6 ASLEEP: MENU > 6 TRACKS" :
scn_on == 1u ? "SCENE ON" : b);
}
} else if (k == 1u)
sc_trk = (uint8_t)clamp(v, 0, (int32_t)(trk_live > 0u && trk_live < NTRK ? trk_live - 1u : NTRK - 1u));
@@ -166,14 +166,12 @@ static __attribute__((noinline)) void graph_harm(void)
}
cv_rect(8, 82, 218, 3, T_RAISE);
if (now < n) cv_rect(8, 82, 218 * (int32_t)(now + 1u) / (int32_t)n, 3, T_ACCENT);
if (off) cv_text(8, 94, &AF_X, "PROG OFF \xB7 KNOB 1 PICKS ONE", T_DIM);
if (off) cv_text(8, 94, &AF_X, "PROG OFF", T_DIM);
}
/* (V10.8.14) SCL > SCENE: a row a track, its colour's pill, its role, the notes it plays (their range: names and a bar
* over C2 .. C7), the one picked its role lit; one line: what that role does */
static void graph_scene(void)
{
static const char *const RD[SC_N] = {"PLAYS ITS OWN SEQUENCE", "HOLDS EACH CHORD", "ARPEGGIATES EACH CHORD",
"A BASS LINE UNDER THE NOTES", "A LINE ABOVE THE NOTES", "A NEW BEAT EACH KEY HELD"};
uint32_t i, j, n;
uint8_t o[KB_CH + 1];
char b[48];
@@ -201,12 +199,7 @@ static void graph_scene(void)
lo = (uint32_t)clamp((int32_t)lo, 36, 96); hi = (uint32_t)clamp((int32_t)hi, 36, 96);
cv_rect(150 + (int32_t)(lo - 36u) * 84 / 60, y + 6, (int32_t)(hi - lo) * 84 / 60 + 2, 5, trk_col(i));
}
str_cpy(b, "T1 ", 48);
b[1] = (char)('1' + sc_trk % NTRK);
if (scn_on == 8u) str_cpy(b, "EVERY TRACK PLAYS THE KEYS", 48);
else if (scn_on >= 2u && sc_trk % NTRK == scn_on - 2u) str_cpy(b + 3, "ITS NOTES LEAD THE OTHERS", 45);
else str_cpy(b + 3, RD[scn_role[sc_trk % NTRK] % SC_N], 45);
cv_text_in(4, 120, 232, &AF_X, scn_on ? b : "SCENE OFF: K1 KEYS OR A TRACK", scn_on ? T_TEXT : T_DIM, T_SURF);
if (!scn_on) cv_text(4, 120, &AF_X, "SCENE OFF", T_DIM); /* (V10.8.27: the roles' lines gone, flash) */
}
/* (V10.6j) SCENE's DRUM: key k's beat into the kit, 16 steps (main loop: ui_input.c's poll; the key in the audio side
+116
View File
@@ -0,0 +1,116 @@
// Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant). All rights reserved.
/* (V10.8.27) JIANT BYTE's tests/clay_engines_test.c (d7f32b11), on JIANT FM's engines.
* DRONE CLAY on every engine (the owner: "it must work with ANY engine"): ANALOG PHASE MATH VOICE WHEEL STRING WEST FM6
* ADD ANIMAL and DRUM. For each: the drone sounds and keeps sounding (a decaying envelope too), follows DRONE / PITCH,
* a modulator of each family (TABLE, GESTURE, NOTE, FM, HIT) moves the sound on each kind of DEST (PITCH, CUTOFF, SHAPE,
* VOLUME, the engine's own knobs E1..E8), a KICK is a hit; a table of it */
#define UI_TEST_NO_MAIN 1
#include "ui_test.c"
static int ce_bad;
#define NS (FS * 4u)
static double ya[NS], yb[NS];
/* (FM) zc: an oscillator engine, its OCT and PITCH told by its zero crossings (a formant, noise or resonator voice keeps
* its own: VOICE ANIMAL WEST ADD STRING, a kit's pads their own tuning); sus: the drone held at the level asked (STRING
* plucks: its string rings out, a known gap, only shown) */
typedef struct { const char *name; uint32_t eng; int mode, zc, sus; } ce_eng_t;
static const ce_eng_t CE[] = {{"ANALOG", ENGI_ANALOG, -1, 1, 1}, {"PHASE", ENGI_PHASE, -1, 1, 1}, {"MATH", ENGI_LOFI, -1, 1, 1},
{"VOICE", ENGI_VOICE, -1, 0, 1}, {"WHEEL", ENGI_WHEEL, -1, 1, 1}, {"STRING", ENGI_STRING, -1, 0, 0},
{"WEST", ENGI_WEST, -1, 0, 1}, {"FM6", ENGI_TRIO, -1, 1, 1}, {"ADD", ENGI_ADD, -1, 0, 1},
{"ANIMAL", ENGI_ANIMAL, -1, 0, 1}, {"DRUM", ENGI_DRUM, -1, 0, 1}};
static void ce_setup(const ce_eng_t *e, int pluck)
{
ui_power_on(); song.sel = 0; set_engine(e->eng); frame();
if (e->mode >= 0) trk[0].p[P_E1] = (int16_t)e->mode;
for (unsigned k = 1; k < NTRK; k++) trk[k].p[P_MUTE] = 1;
if (pluck) { trk[0].p[P_SUS] = 0; trk[0].p[P_DEC] = 30; }
clay_defaults(clay[0]); song.master_q12 = 4096; song.g[G_BPM] = 120; frames(8);
for (unsigned m = 0; m < 4u; m++) { clay[0][CL_MF(m, 3u)] = 0; clay[0][CL_MF(m, 2u)] = 0; }
rng_state = 0x1234567u; clay_rng = 1u; dx_mot_rng = 0x9E3779B9u; mod_seed = 0x2545F491u; /* (the same render twice the same) */
}
static void ce_play(double *y)
{
int32_t b[CTL * 2]; unsigned n = 0;
transport_req = 1;
unsigned k = 0; /* (the main loop's frame each 16 ms: MATH USER's text built) */
while (n < NS) { mix_block(b, CTL); for (unsigned i = 0; i < CTL && n < NS; i++) y[n++] = (b[2 * i] + b[2 * i + 1]) / 65536.0; if (++k % (FS / 60u / CTL) == 0u) frame(); }
transport_req = 2; for (unsigned j = 0; j < FS / 4u / CTL; j++) mix_block(b, CTL);
}
static double rms_r(const double *y, unsigned a, unsigned b) { double e = 0; for (unsigned i = a; i < b; i++) e += y[i] * y[i]; return sqrt(e / (b - a)); }
/* how far two renders sound apart: their level and brightness (zero crossings) overall and in each 20 ms of the beat
* (the beats folded: a kit's or a formula's own chance averaged out), not the waveform (a formula's phase is free) */
static void feat(const double *y, double *f)
{
unsigned w = FS / 50u, nb = FS / 2u / w, i, k;
for (k = 0; k < 2u * nb + 2u; k++) f[k] = 0;
for (i = 0; i + w <= NS; i += w) {
unsigned z = 0, b = (i / w) % nb; double r = rms_r(y, i, i + w);
for (unsigned j = i + 1; j < i + w; j++) z += (y[j] >= 0) != (y[j - 1] >= 0);
f[b] += r; f[nb + b] += z; f[2u * nb] += r; f[2u * nb + 1u] += z;
}
}
static double dlt(const double *a, const double *b)
{
double fa[64], fb[64], d = 0, s = 0, dz = 0, sz = 0; unsigned nb = FS / 2u / (FS / 50u);
feat(a, fa); feat(b, fb);
for (unsigned k = 0; k < nb; k++) { d += fabs(fa[k] - fb[k]); s += fa[k] + fb[k]; dz += fabs(fa[nb + k] - fb[nb + k]); sz += fa[nb + k] + fb[nb + k]; }
return 2 * d / (s + 1e-12) + 2 * dz / (sz + 1);
}
static double zc(const double *y) { unsigned z = 0; for (unsigned i = NS / 4; i < NS; i++) z += (y[i] >= 0) != (y[i - 1] >= 0); return z; }
/* a modulator: MOD 1 SHAPE (the knob's rank), DEST, on 1/1 at 1/8, AMOUNT 127 */
static void ce_mod(int rank, int dest) { clay[0][CL_MF(0, 0u)] = (int8_t)dest; clay[0][CL_MF(0, 1u)] = (int8_t)rank; clay[0][CL_MF(0, 2u)] = 2; clay[0][CL_MF(0, 3u)] = 127; clay[0][CL_MF(0, 4u)] = 40; clay[0][CL_MF(0, 5u)] = 3; }
int main(int argc, char **argv)
{
(void)argv; if (argc > 1) return 0;
static const int RANK[5] = {12, 24, 36, 51, 0}; /* SINE, RAMP UP, ARP UP, FM x2, KICK */
static const char *const FAM[5] = {"TABLE", "GESTURE", "NOTE", "FM", "HIT"};
static const int DEST[12] = {1, 2, 3, 4, 12, 13, 14, 15, 16, 17, 18, 19}; /* PITCH CUTOFF SHAPE VOLUME E1 .. E8 */
static const char *const DN[12] = {"PITCH", "CUT", "SHAPE", "VOL", "E1", "E2", "E3", "E4", "E5", "E6", "E7", "E8"};
printf("clay_engines: %-10s %6s %6s %5s %5s %5s", "ENGINE", "DRONE", "PLUCK", "OCT", "PITCH", "NOISE");
for (unsigned d = 0; d < 12u; d++) printf(" %5s", DN[d]);
for (unsigned f = 0; f < 5u; f++) printf(" %6s", FAM[f]);
printf(" %5s\n", "KICK");
for (unsigned e = 0; e < sizeof CE / sizeof CE[0]; e++) {
const ce_eng_t *E = &CE[e]; int drum = E->eng == ENGI_DRUM, func = 0, ok = 1;
double dr, pl, oc = 0, pt = 0, dd[12], ff[5], kick = 0, fl;
ce_setup(E, 0); ce_play(ya); /* (once to warm it: a formula's first run) */
ce_setup(E, 0); ce_play(ya); dr = rms_r(ya, NS / 2, NS);
ce_setup(E, 0); ce_play(yb); fl = dlt(ya, yb); /* (the same twice: how far a render is from itself) */
ce_setup(E, 1); ce_play(yb); pl = rms_r(yb, NS / 2, NS);
{
double z0 = zc(ya);
ce_setup(E, 0); clay[0][CL_OCT] = 2; ce_play(yb); oc = zc(yb) / (z0 + 1);
ce_setup(E, 0); clay[0][CL_PIT] = 12; ce_play(yb); pt = zc(yb) / (z0 + 1);
}
for (unsigned d = 0; d < 12u; d++) { /* a SINE on each DEST against the drone alone */
ce_setup(E, 0); ce_mod(12, DEST[d]); ce_play(yb); dd[d] = dlt(ya, yb);
}
for (unsigned f = 0; f < 5u; f++) { /* each family on the CUTOFF */
ce_setup(E, 0); ce_mod(RANK[f], 2); ce_play(yb); ff[f] = dlt(ya, yb);
}
{ /* a KICK on the beat: louder on it than between (DRUM-W: its pad) */
ce_setup(E, 0); ce_mod(0, 0); clay[0][CL_MF(0, 2u)] = 3; clay[0][CL_MF(0, 5u)] = 2; ce_play(yb);
double on = 0, off = 0; unsigned beat = FS / 2u;
for (unsigned i = beat; i + beat <= NS; i += beat) { on += rms_r(yb, i, i + FS / 40u); off += rms_r(yb, i + beat - FS / 20u, i + beat - FS / 40u); }
kick = on / (off + 1e-6);
}
if (E->sus) ok &= dr > 0.005 && (drum || pl > 0.005); /* (FM: WEST quiet at its preset, ~0.03) */
if (E->zc) ok &= oc > 1.5 && pt > 1.5;
{ /* CUTOFF VOLUME always, PITCH but on a kit (its pads' own) and FUNC (its recipe's time, not the voice's
* phase: DRONE and PITCH reach it as its note); SHAPE shown (WAVE: its POS, MATH: VAR, USER
* and a kit none); 3 of the 8 knobs at least (a knob may be a choice that sounds alike in this sound: a
* table's POS, WARP's AMT with WARP off, B with MIX 0) */
unsigned kn = 0; double th = 0.08 + fl; /* (FM: 1x the render's own spread, WHEEL's noise) */
for (unsigned d = 4; d < 12u; d++) kn += dd[d] > th;
ok &= (drum || func || !E->zc || dd[0] > th) && dd[1] > th && dd[3] > th && kn >= 3u;
for (unsigned f = 0; f < 5u; f++) ok &= ff[f] > th;
}
ok &= kick > (drum ? 1.3 : 3.0);
printf("clay_engines: %-10s %6.3f %6.3f %5.2f %5.2f %5.2f", E->name, dr, pl, oc, pt, fl);
for (unsigned d = 0; d < 12u; d++) printf(" %5.2f", dd[d]);
for (unsigned f = 0; f < 5u; f++) printf(" %6.2f", ff[f]);
printf(" %5.1f %s\n", kick, ok ? "ok" : "FAIL");
ce_bad += !ok;
}
printf("clay_engines: %s\n", ce_bad ? "FAIL" : "all ok");
return ce_bad != 0;
}
+28 -11
View File
@@ -1,6 +1,8 @@
// Copyright (C) 2026 Juan Ignacio Antonucci (Juan Jiant). All rights reserved.
/* (V10.8.21) DRONE CLAY (seq.c clay.c, JIANT BYTE's): the drone on and off, RATE's strikes, a modulator moving its
* destination through mod_begin, the 'C' 'Y' block saved and loaded, an older project loading with it off.
* destination through mod_begin, the 'C' 'L' block saved and loaded, an older project loading with it off.
* (V10.8.27) BYTE's fix: RATE on the bar's grid (0 HOLD, 3 1/16), each modulator its own RATE, clay_vk what it adds;
* tests/clay_engines_test.c every engine.
* cc -O1 -w -Wno-implicit-function-declaration -Ibuild/gen -Ifirmware/src -Itests tests/clay_test.c -lm */
#define UI_TEST_NO_MAIN 1
#include "ui_test.c"
@@ -40,10 +42,10 @@ int main(void)
clay[tr][CL_ON] = 0;
blocks(40);
ok = !clay_dn[tr] && !clay_nn[tr] && !clay_v[tr][0] && !clay_v[tr][1] && !clay_v[tr][2] && !clay_v[tr][3];
ok = !clay_dn[tr] && !clay_nn[tr] && !clay_vk(tr, 0) && !clay_vk(tr, 1) && !clay_vk(tr, 2) && !clay_vk(tr, 3);
bad += check("clay OFF: the drone and its gestures end, the modulators at 0", ok);
clay[tr][CL_ON] = 1; clay[tr][CL_RATE] = 7; /* 1/16: struck again each sixteenth */
clay[tr][CL_ON] = 1; clay[tr][CL_RATE] = 3; /* 1/16: struck again each sixteenth */
last = clay_lr[tr];
for (k = 0; k < 400u; k++) { blocks(4); if (clay_lr[tr] != last) { strikes++; last = clay_lr[tr]; } }
bad += check("clay RATE 1/16: the drone struck again and again", strikes >= 8u);
@@ -60,19 +62,19 @@ int main(void)
seq_note_off(t, 72u);
blocks(40);
ok &= clay_dn[tr] == n0;
t->p[P_VOICE] = V_POLY; clay[tr][CL_RATE] = 7;
t->p[P_VOICE] = V_POLY; clay[tr][CL_RATE] = 3;
bad += check("clay on MONO: a key's note takes the voice, the drone back after it", ok);
}
{ /* a modulator on DIST (CLAY_MD 6): mod_begin moves the track's parameter by what it adds, mod_end puts it back */
uint32_t id = mod_param(MD_DIST), moved = 0;
int16_t keep;
for (k = 0; k < 4u; k++) { clay[tr][CL_MF(k, 0u)] = 0; clay[tr][CL_MF(k, 3u)] = 0; }
clay[tr][CL_MF(0u, 0u)] = 6; clay[tr][CL_MF(0u, 3u)] = 127; clay[tr][CL_MF(0u, 2u)] = 2;
clay[tr][CL_MF(0u, 0u)] = 6; clay[tr][CL_MF(0u, 3u)] = 127; clay[tr][CL_MF(0u, 2u)] = 2; clay[tr][CL_MF(0u, 5u)] = 2; /* 1/16 */
t->p[id] = 64;
keep = t->p[id];
for (k = 0; k < 600u && !moved; k++) {
blocks(2);
if (clay_v[tr][0]) {
if (clay_vk(tr, 0)) {
macro_master();
if (mod_begin(t)) { moved = t->p[id] != keep; mod_end(t); }
}
@@ -81,18 +83,22 @@ int main(void)
bad += check("clay MOD 1 on DIST: mod_begin moves it, mod_end restores the stored value", ok);
}
{ /* saved and loaded: the 'C' 'Y' block, the track's 26 settings back */
{ /* saved and loaded: the 'C' 'L' block, the track's 30 settings back (PITCH biased) */
static project_t q, r;
static project_store_t st;
int16_t was[CLAY_NF];
memcpy(was, clay[tr], sizeof was);
clay[tr][CL_PIT] = -7; clay[tr][CL_MF(2u, 5u)] = 17;
project_capture(&q);
ok = proj_pack(&st, &q);
memset(&r, 0, sizeof r);
ok &= proj_unpack_c(&r, st.raw) != 0;
for (k = 0; k < CLAY_NF; k++) ok &= r.clay[tr][k] == (uint8_t)clamp(was[k], 0, 127);
ok &= !memcmp(r.clay[tr], q.clay[tr], CLAY_NF);
{
clay_t back[CLAY_NF];
clay_unpack(r.clay[tr], back);
ok &= back[CL_PIT] == -7 && back[CL_MF(2u, 5u)] == 17 && back[CL_ON] == 1;
}
for (k = 0; k < NTRK; k++) ok &= k == tr || !r.clay[k][CL_ON];
bad += check("clay saved and loaded: its 26 settings back, the other tracks off", ok);
bad += check("clay saved and loaded: its 30 settings back (PITCH -7, MOD 3's RATE), the other tracks off", ok);
clay[tr][CL_ON] = 0;
blocks(20);
project_capture(&q); /* no track ON: no 'C' 'Y' block, as an older project */
@@ -102,6 +108,17 @@ int main(void)
for (k = 0; k < NTRK; k++) ok &= !r.clay[k][CL_ON];
bad += check("a project without the block (older): DRONE CLAY off on every track", ok);
}
{ /* (V10.8.27) an older project's 'C' 'Y' (V10.8.21 .. 26: 26 settings): ON, RATE 1/16, MOD 1 on DIST, STEP 1 */
uint8_t o[26], nb[CLAY_NF];
clay_t c[CLAY_NF];
memset(o, 0, sizeof o);
o[0] = 1; o[1] = 2; o[2] = 7; o[4] = 6; o[7] = 100; o[24] = 1; o[25] = 33;
clay_from_v1(o, nb);
clay_unpack(nb, c);
ok = c[CL_ON] == 1 && c[CL_OCT] == 2 && c[CL_RATE] == 3 && c[CL_PIT] == 0 && c[CL_SEED] == 33 &&
c[CL_MF(0u, 0u)] == 6 && c[CL_MF(0u, 3u)] == 100 && c[CL_MF(0u, 5u)] == 3;
bad += check("an older 'C' 'Y' block read: ON, OCT, RATE 1/16, PITCH 0, MOD 1 on DIST, its STEP its RATE", ok);
}
printf(bad ? "clay: %d FAILED\n" : "clay: all passed\n", bad);
return bad != 0;
}
+1 -1
View File
@@ -52,7 +52,7 @@ static int test_song_save_ui(void)
turn(EN_K4, 1); press(B_OCTUP); frame();
ok = ui.confirm == CF_OVR_SONG && !name_on();
confirm_text(a, b);
ok &= strstr(a, "OVERWRITE PROJECT") != 0 && !strcmp(b, "NEXT: K3 SONG OR LOOP");
ok &= strstr(a, "OVERWRITE PROJECT") != 0 && !b[0] /* (V10.8.27: the hint gone) */;
press(B_OCTDN); frame();
ok &= !ui.confirm && !name_on();
bad += check("occupied destination asks to overwrite (SONG or LOOP comes on NAME); cancel writes nothing", ok);
+1 -24
View File
@@ -120,30 +120,7 @@ int main(void)
btn_up(B_FX); frame();
bad += check("FX layer banner: the punch-in held (RPT 1/32) large with its key; 0.6 s after, then gone, latched too", ok);
}
{ /* (V10.8.9) the song mode's hints: one a state, each fits the line; HELP OFF: none */
const char *h[6];
uint8_t ho = ui_help_off;
stop_transport(); frame();
nav_put(SEC_HOME, "JAM"); frame();
memset(live.jam, 0, sizeof live.jam); jam_lock = 0; jam_tr = 0; jam_undo = 0; live.srec = 0;
h[0] = song_hint();
live.srec = 1; h[1] = song_hint();
live.srec = 2; h[2] = song_hint();
live.srec = 0; jam_lock = 1; h[3] = song_hint();
jam_undo = 1; h[4] = song_hint();
jam_undo = 0; jam_lock = 0;
nav_put(SEC_HOME, "TAKE"); frame();
h[5] = song_hint();
ok = h[0] && str_eq(h[0], "PLAY \xB7 KEYS A-D ALL \xB7 OCT+ GO \xB7 OCT- STOP") && str_eq(h[1], "REC: FROM THE NEXT BAR") &&
str_eq(h[2], "RECORDING: CHANGE SEQS \xB7 REC ENDS") && str_eq(h[3], "PLAY OVER IT: YOU \xB7 REC: REDO A TRACK") &&
str_eq(h[4], "OCT- UNDO THE ROUND") && str_eq(h[5], "NO TAKE: REC ONE ON JAM");
for (i = 0; i < 6u; i++) ok &= h[i] && text_w(&AF_X, h[i]) <= 230;
ui_help_off |= 1u;
ok &= !song_hint();
nav_put(SEC_HOME, "JAM"); frame();
ok &= !song_hint();
ui_help_off = ho;
bad += check("song mode hints: JAM stopped / REC armed / recording / LOCK / UNDO, TAKE; they fit; HELP OFF none", ok);
{ /* (V10.8.9) the song mode's hints: gone in V10.8.27 for DRONE CLAY's flash (the owner: the help texts cut) */
go_title("COMP"); frame();
transport_req = 1; ui_input(); steps(1);
}
+24 -24
View File
@@ -5289,8 +5289,8 @@ static int test_rec_combos(void)
/* (0.9.9-snd2) the FX chain: MASTER its last page, after PUNCH (ui_lens.c CE_FX), its module last on BUSES */
bad += check(" FX chain: ... SL PITCH, PUNCH IN, MASTER, its TAPE and EQ last (the BUSES tiles too)",
!strcmp(CE_FX[NELEM(CE_FX) - 1u].t, "EQ") && !strcmp(CE_FX[NELEM(CE_FX) - 2u].t, "TAPE") &&
!strcmp(CE_FX[NELEM(CE_FX) - 3u].t, "MASTER") && !strcmp(CE_FX[NELEM(CE_FX) - 4u].t, "PUNCH LANE") &&
!strcmp(CE_FX[NELEM(CE_FX) - 5u].t, "MACROS") && !strcmp(CE_FX[NELEM(CE_FX) - 6u].t, "PUNCH IN") &&
!strcmp(CE_FX[NELEM(CE_FX) - 3u].t, "MASTER") && /* (V10.8.27: PUNCH LANE's page gone) */
!strcmp(CE_FX[NELEM(CE_FX) - 4u].t, "MACROS") && !strcmp(CE_FX[NELEM(CE_FX) - 5u].t, "PUNCH IN") &&
!strcmp(CG_FX[NELEM(CG_FX) - 1u].nm, "MASTER") && !strcmp(FX_MOD[FX_NMOD - 1u], "MASTER"));
{ /* (0.9.9-snd2) CLEAR AUTOMATION on the punch-in layer itself: FX + G5 (CLR AUTO on the map) empties the lane
* only, stopped or playing (not recording); the tracks' automation stays */
@@ -7731,9 +7731,9 @@ static int test_lente(void)
{
/* (2463a3b, 2026-11-04, FIT / SPAN: SEQ > LENGTH > RHYTHM after LENGTH; 92fc1d7, 2026-11-05: the GENERATE tab at the
* end (LYRIC STEP only on a VOICE track): 14 pages in eight tabs, was 12 in seven) */
static const char *const CH[19] = {"STEP", "LENGTH", "RHYTHM", "TRACK", "EUCLID", "MODES", "PLAYHEADS",
static const char *const CH[16] = {"STEP", "LENGTH", "RHYTHM", "TRACK", "EUCLID", "MODES", "PLAYHEADS",
"STEP FX", "STEP FX 2", "AUTOMATION", "AUTO LIST", "TRACK GEN", "DRONE CLAY",
"CLAY MOD 1", "CLAY MOD 2", "CLAY MOD 3", "CLAY MOD 4", "CLAY DECAY", "CLAY TIME"}; /* (V10.8.21: DRONE CLAY) */ /* (V10.8.20: MUTATE, STRETCH gone) */ /* (V10.7.59: STEP FX,
"CLAY MOD", "CLAY RHYTHM", "CLAY TIME"}; /* (V10.8.27: BYTE's four CLAY pages) */ /* (V10.8.21: DRONE CLAY) */ /* (V10.8.20: MUTATE, STRETCH gone) */ /* (V10.7.59: STEP FX,
* was COMP) (codex/coherence: TRACK
* GEN, was GENERATE) */
static const char *const TP[7] = {"LENGTH", "EUCLID", "PLAYHEADS", "STEP FX", "AUTOMATION", "TRACK GEN", "DRONE CLAY"};
@@ -7743,26 +7743,26 @@ static int test_lente(void)
TSEL->p[P_SLEN] = 64;
open_family(FAM_SEQ); frame();
ok = str_eq(cur_page()->title, "STEP") && lens_level() == LV_BAR && roll_view(cur_page()) && lz_tabs() == 8u &&
lz_tab_lit(0) && lz_crumb_is("SEQ \xB7 STEP \xB7 STEP") && lz_count_is("1/19");
lz_tab_lit(0) && lz_crumb_is("SEQ \xB7 STEP \xB7 STEP") && lz_count_is("1/16");
turn(EN_SELECT, -1); frames(32);
ok &= str_eq(cur_page()->title, "STEP") && lz_count_is("1/19"); /* (the first: no wrap) */
ok &= str_eq(cur_page()->title, "STEP") && lz_count_is("1/16"); /* (the first: no wrap) */
turn(EN_SELECT, 1); frames(32);
ok &= str_eq(cur_page()->title, "PATTERN") && seq_roll_view(cur_page()) && lz_tab_lit(1) && lz_count_is("2/19") &&
ok &= str_eq(cur_page()->title, "PATTERN") && seq_roll_view(cur_page()) && lz_tab_lit(1) && lz_count_is("2/16") &&
lz_crumb_is("SEQ \xB7 PATTERN \xB7 LENGTH"); /* (PATTERN, named LENGTH; codex/coherence:
* its group PATTERN) */
turn(EN_SELECT, 1); frames(32);
ok &= str_eq(cur_page()->title, "RHYTHM") && lz_tab_lit(1) && lz_count_is("3/19");
ok &= str_eq(cur_page()->title, "RHYTHM") && lz_tab_lit(1) && lz_count_is("3/16");
turn(EN_SELECT, 1); frames(32);
ok &= str_eq(cur_page()->title, "TRACK") && lz_tab_lit(1) && lz_count_is("4/19") &&
ok &= str_eq(cur_page()->title, "TRACK") && lz_tab_lit(1) && lz_count_is("4/16") &&
lz_crumb_is("SEQ \xB7 PATTERN \xB7 TRACK"); /* (TRACK under the PAT tab) */
turn(EN_SELECT, 4); frames(32);
ok &= str_eq(cur_page()->title, "COMP") && seq_roll_view(cur_page()) && lz_tab_lit(4) && lz_count_is("8/19") &&
ok &= str_eq(cur_page()->title, "COMP") && seq_roll_view(cur_page()) && lz_tab_lit(4) && lz_count_is("8/16") &&
lz_crumb_is("SEQ \xB7 STEP FX \xB7 STEP FX");
turn(EN_SELECT, 1); frames(32);
ok &= str_eq(cur_page()->title, "COMP 2") && lz_tab_lit(4) && lz_count_is("9/19");
bad += check("seq2 SEQ: enters at STEP (1/19, eight tabs: V10.8.21 DRONE CLAY); LENGTH the roll (seq2b), RHYTHM, TRACK under its tab, COMP the roll, COMP 2 after it", ok);
bad += check("seq2 SEQ: one chain of 19 by SELECT (no wrap); a SEQ tap the next tab's first, round",
chain_walk(B_SEQ, CH, 19, TP, 7));
ok &= str_eq(cur_page()->title, "COMP 2") && lz_tab_lit(4) && lz_count_is("9/16");
bad += check("seq2 SEQ: enters at STEP (1/16, eight tabs: V10.8.21 DRONE CLAY); LENGTH the roll (seq2b), RHYTHM, TRACK under its tab, COMP the roll, COMP 2 after it", ok);
bad += check("seq2 SEQ: one chain of 16 by SELECT (no wrap); a SEQ tap the next tab's first, round",
chain_walk(B_SEQ, CH, 16, TP, 7));
{ /* (0.9.9-seq2b) every page of the chain the same picture: the bars' strip, the roll with its keys */
static const char *const TI[10] = {"STEP", "PATTERN", "TRACK", "EUCLID", "MODES", "PLAYHEADS",
"COMP", "COMP 2", "AUTOMATION", "AUTO LIST"};
@@ -8711,19 +8711,19 @@ static int test_scl_alltr(void)
* the page left. (Was 0.8.5's lens: SELECT TRACK <-> BUSES <-> EFFECT, PRESETS the module, the FX tap the level's next) */
static int test_fx_sections(void)
{
static const char *const CH[20] = {"SENDS", "DIST", "AUTO PAN", "BUSES", "DLY", "DLY 2", "DLY 3", "REVERB", "REVERB 2",
"CHORUS", "SLICER", "SL BUS", "SL BUS 2", "SL PITCH", "PUNCH IN", "MACROS", "LANE", "MASTER",
"TAPE", "EQ"}; /* (V10.7.66: PUNCH LANE) */
static const char *const CH[19] = {"SENDS", "DIST", "AUTO PAN", "BUSES", "DLY", "DLY 2", "DLY 3", "REVERB", "REVERB 2",
"CHORUS", "SLICER", "SL BUS", "SL BUS 2", "SL PITCH", "PUNCH IN", "MACROS", "MASTER",
"TAPE", "EQ"}; /* (V10.7.66: PUNCH LANE; V10.8.27: its page gone) */
static const char *const TP[7] = {"BUSES", "DLY", "REVERB", "CHORUS", "SLICER", "PUNCH IN", "MASTER"}; /* (codex/coherence:
* PUNCH IN, was PUNCH, MASTER's knob's name) */
int bad = 0, ok;
uint32_t pr;
ui_power_on();
bad += check("0.9.2 FX: one chain of 18 (TRK BUS DLY REV CHO SLC PCH MST; snd8: MASTER, TAPE; p9: EQ) by SELECT, no wrap; an FX tap each group's first, round",
chain_walk(B_FX, CH, 20, TP, 7));
chain_walk(B_FX, CH, 19, TP, 7));
ui_power_on(); go_home(); frame(); press(B_FX); frame();
ok = fx_on() && fx_level() == FXL_TRACK && lz_on() && card_y() == LZ_CARD_Y && lz_tabs() == 8u && lz_tab_lit(0) &&
lz_crumb_is("FX \xB7 TRACK \xB7 SENDS") && lz_count_is("1/20");
lz_crumb_is("FX \xB7 TRACK \xB7 SENDS") && lz_count_is("1/19");
turn(EN_SELECT, 3); frame();
ok &= fx_level() == FXL_BUSES && cur_page()->graph == GR_BUSES && lz_tab_lit(1) && lz_crumb_is("FX \xB7 BUSES \xB7 BUSES");
ok &= cur_page()->id[0] == G_DMIX && cur_page()->id[1] == G_RSIZE && cur_page()->id[2] == G_CDEPTH && cur_page()->id[3] == G_SLDEP;
@@ -8731,7 +8731,7 @@ static int test_fx_sections(void)
ok &= song.g[G_RSIZE] > 50;
turn(EN_SELECT, 2); frame();
ok &= fx_level() == FXL_EFFECT && str_eq(cur_page()->title, "DLY 2") && lz_tab_lit(2) &&
lz_crumb_is("FX \xB7 DELAY \xB7 DLY 2") && lz_count_is("6/20") && ui.fxmod == 0u;
lz_crumb_is("FX \xB7 DELAY \xB7 DLY 2") && lz_count_is("6/19") && ui.fxmod == 0u;
{ /* the eight tabs: their short names (the full ones do not fit) */
const char *nm[8], *tab[8];
uint8_t cnt[8];
@@ -8750,7 +8750,7 @@ static int test_fx_sections(void)
ui_load = LOAD_ECO; frame(); /* LOAD ECO: no CHORUS, no SLICER */
turn(EN_SELECT, 1); frame(); ok &= str_eq(cur_page()->title, "REVERB 2");
turn(EN_SELECT, 1); frame(); ok &= str_eq(cur_page()->title, "PUNCH IN"); /* (CHORUS, SLICER skipped) */
ok &= lz_tabs() == 6u && lz_count_is("10/15");
ok &= lz_tabs() == 6u && lz_count_is("10/14"); /* (V10.8.27: PUNCH LANE gone) */
frames(320); press(B_FX); frame(); ok &= str_eq(cur_page()->title, "MASTER");
ui_load = LOAD_FULL; frame();
bad += check("0.9.2 FX: from elsewhere the page left; LOAD ECO: CHORUS and SLICER out of the chain and the tabs", ok);
@@ -12495,8 +12495,7 @@ static int test_toasts(void)
ok = str_eq(cur_page()->title, "EUCLID");
for (n = 0; n < 200u; n++) { frame(); seen |= ui.msg_t && ui.msg[0]; }
go_title("AUTOMATION"); for (n = 0; n < 200u; n++) { frame(); seen |= ui.msg_t && ui.msg[0]; }
go_title("PUNCH LANE"); for (n = 0; n < 200u; n++) { frame(); seen |= ui.msg_t && ui.msg[0]; }
bad += check("V10.8.18 no teaching hint: EUCLID walked past or dwelt on, AUTOMATION, PUNCH LANE say nothing", passed && ok && !seen);
bad += check("V10.8.18 no teaching hint: EUCLID walked past or dwelt on, AUTOMATION say nothing (V10.8.27: PUNCH LANE's page gone)", passed && ok && !seen);
ui_power_on(); /* (0.9.5) no layer hint: SCL or EDIT tapped, dwelt on */
go_home(); frames(160); ui.msg_t = 0;
press(B_SCL);
@@ -12822,7 +12821,8 @@ static int coh_ok(uint32_t sec, const char *a, const char *b)
static const struct { uint8_t sec; const char *a, *b; } OK[] = {
{SEC_GLO, "MIXER", "GLOBAL"}, {SEC_FX, "SENDS", "DIST"},
{SEC_FX, "BUSES", "DLY"}, {SEC_FX, "BUSES", "REVERB"}, {SEC_FX, "BUSES", "CHORUS"}, {SEC_FX, "BUSES", "SLICER"},
{SEC_EDIT, "MORE", FELUCCA_FM4 ? "OP LEVEL" : "-"}}; /* (FELUCCA_FM4's retired DIGITAL: P_TVEL is its OP4 LEVEL) */
{SEC_EDIT, "MORE", FELUCCA_FM4 ? "OP LEVEL" : "-"},
{SEC_SEQ, "CLAY MOD", "CLAY RHYTHM"}}; /* (V10.8.27, BYTE's: their MOD the same selector on both) */ /* (FELUCCA_FM4's retired DIGITAL: P_TVEL is its OP4 LEVEL) */
uint32_t i;
for (i = 0; i < NELEM(OK); i++)
if (OK[i].sec == sec && ((str_eq(OK[i].a, a) && str_eq(OK[i].b, b)) || (str_eq(OK[i].a, b) && str_eq(OK[i].b, a))))
+2241 -2241
View File
File diff suppressed because it is too large. Load diff