V10.16: EUCLID's VARY in turns; SEQ > MUTATE

- VARY (EUCLID melodic KNOB 4, MODES' VARY on a kit): above 0 the pattern is
  four turns of the cycle (as many as fit in 64 steps), each moved anew
  (A A' A'' B: the first a third of VARY, the last half as much again, a kit's
  last turn ending in rolls on the snare and hats). Hits move one to three
  steps; HITS stays exact in each turn. A melody's later turns keep the first
  turn's degrees hit by hit or take new ones, by VARY. VARY 0: one turn.
- SEQ > MUTATE (EUCLID . MODES . MUTATE, ids ID_MU0 0xE4..): EVERY OFF 1 2 4 8
  16 bars, AMOUNT, MODE ORBIT (from the anchor) / DRIFT (from the last) /
  PULSE (a mutation and the anchor by turns), WHAT GROOVE (a new seed) /
  RHYTHM (+ HITS or DENSITY, ROTATE) / FEEL (+ the MODES, VARY) / ALL.
  ui_euclid.c eu_tick (every UI frame): playing, not in a song's chain, the
  bar's last beat (seq.c bar_n, beat_n, beat_pos), the pattern new from the
  next bar; no UNDO point. The anchor (eu_z, the settings vary .. l[]) is
  what is dialled: any EUCLID / MODES knob, OCT+ / OCT- there, EVERY on. On
  MUTATE OCT+ mutates now, OCT- returns to the anchor. A DRUM-X lane picked
  mutates alone. The ring's corner: MUT n, the bars to the next.
- MUTATE's hint: EVERY: MUTATE ON THE BAR / OCT+ MUTATE  OCT- ANCHOR.
- Tests: ui_test test_eumutate (the turns on a kit and a melody, MUTATE on
  the bar, once a bar, none stopped or in a chain, ORBIT / DRIFT / PULSE,
  OCT+ / OCT-); the SEQ chain's tests and the 14 tasks (+1) for the page.

App 567,540 B of 584,336 (16,796 B free); RAM .data+.bss 95,820 B.

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-10-31 21:36:11 +00:00
1 parent d9f63ad05d
commit 3ed85a96d7
8 files changed
+2172 -1953

No files matched your search

+1 -1
View File
@@ -41,7 +41,7 @@
#define FELUCCA_ID "FM-1_900" /* package identity (build.py: the .fwsc marker string) */
#endif
#ifndef FELUCCA_VERSION
#define FELUCCA_VERSION "V10.15" /* (2026-10-31) V10.15: VOICE's English dictionary in the Bluetooth segment (without it: the letter rules). (2026-10-31) V10.14: PROX, a modulation source from the Bluetooth signal (a hand near the antenna), calibrated on MENU > SYSTEM > BLUETOOTH ON + OCT+ (OCT- FAR, OCT+ NEAR). (2026-10-31) V10.13: BLE-MIDI in and out (what a central sends plays as USB-MIDI, MIDI OUT goes to it too); ABOUT's credits in the Bluetooth segment (the app slot had 128 B free). (2026-10-31) V10.12: MENU > SYSTEM > BLUETOOTH OFF / ON: a BLE-MIDI peripheral "JIANT FM-1" (advertising, connectable; MIDI not routed yet), Optimist's stack in the Bluetooth segment at 0xEA000 (written by the update loader from the package's bt.bin), live RF calibration, a boot guard. (2026-10-31) V10.11: the supplies set up as stock V15 does (the DC-DC on, hal/fm1_power.h from Melodee), the radio's prerequisite; 0xEA000..0xFBFFF reserved for the Bluetooth segment. (2026-10-31) V10.10: the radio's calibration kept: the update loader keeps the stock VM sector (0xE8000: RF trims, BT address) but its record's 256 B; VM_READ (editor 80) reads that area for web/btcheck. (2026-10-31) V10.9: MENU > LARGE shows the animations (HOME: the six tracks' creatures in the strip; EDIT: the engine's). (2026-10-31) V10.8: testers' fixes: GEN parts set OFF stay off; GEN keeps its GENRE between visits; SEQ > STEP KNOB 4 VEL (1..127, then ACC SLD A+S); delay 1/4D 1/8D 1/16D; less pitch wobble from the generators (no macro on PITCH, pitched delay seldom, octaves); STOP TO EDIT says SONG PLAYS. (2026-10-31) V10.7: SEQ > EUCLID on a kit: LANE ALL first (DENSITY: a whole usable kit), a lane picked writes that lane alone; EDIT + PRESETS jumps between engines; the kit's SEQ dice plays in every genre; EUCLID's HITS exact (VARY moved them only); REC held alone and let go: UNDO (again: REDO). (2026-10-31) V10.6: SEQ > EUCLID and MODES (a euclidean pattern generator, melodies in the key) in MUTATE's place; MUTATE and SEQ TOOLS' RANDOM COOK BEAT gone. (2026-10-31) V10.5: automation thinned (a recording at the stop, the 64 when full) into holds and RAMPs. (2026-10-31) V10.4: ARRANGE / TIMELINE: OCT- deletes the row picked (DELETE ROW?). (2026-10-31) V10.3: TIMELINE: the lines between lanes soft (the block's colour, darker), the rows' edges stronger. (2026-10-31) V10.2: TIMELINE keeps the black line between lanes (only the rows touch); SAVE composes first: TIMELINE SECTIONS PROJECTS ARRANGE TOOLS USER PRESETS. (2026-10-30) V10.1: TIMELINE blocks fill the lanes (no black gaps between rows or tracks). (2026-10-30) JIANT FM V10: add15-beta6 as the new base (TIMELINE, VAR, ADD, official V16 both ways); the version history before it: the git log of the add15 line (codex/add15-private) */
#define FELUCCA_VERSION "V10.16" /* (2026-10-31) V10.16: SEQ > EUCLID's VARY in four turns (A A' A'' B, each moved anew, the motif answered); SEQ > MUTATE (EVERY 1..16 bars, AMOUNT, MODE ORBIT / DRIFT / PULSE, WHAT GROOVE / RHYTHM / FEEL / ALL; OCT+ a mutation now, OCT- back to the anchor). (2026-10-31) V10.15: VOICE's English dictionary in the Bluetooth segment (without it: the letter rules). (2026-10-31) V10.14: PROX, a modulation source from the Bluetooth signal (a hand near the antenna), calibrated on MENU > SYSTEM > BLUETOOTH ON + OCT+ (OCT- FAR, OCT+ NEAR). (2026-10-31) V10.13: BLE-MIDI in and out (what a central sends plays as USB-MIDI, MIDI OUT goes to it too); ABOUT's credits in the Bluetooth segment (the app slot had 128 B free). (2026-10-31) V10.12: MENU > SYSTEM > BLUETOOTH OFF / ON: a BLE-MIDI peripheral "JIANT FM-1" (advertising, connectable; MIDI not routed yet), Optimist's stack in the Bluetooth segment at 0xEA000 (written by the update loader from the package's bt.bin), live RF calibration, a boot guard. (2026-10-31) V10.11: the supplies set up as stock V15 does (the DC-DC on, hal/fm1_power.h from Melodee), the radio's prerequisite; 0xEA000..0xFBFFF reserved for the Bluetooth segment. (2026-10-31) V10.10: the radio's calibration kept: the update loader keeps the stock VM sector (0xE8000: RF trims, BT address) but its record's 256 B; VM_READ (editor 80) reads that area for web/btcheck. (2026-10-31) V10.9: MENU > LARGE shows the animations (HOME: the six tracks' creatures in the strip; EDIT: the engine's). (2026-10-31) V10.8: testers' fixes: GEN parts set OFF stay off; GEN keeps its GENRE between visits; SEQ > STEP KNOB 4 VEL (1..127, then ACC SLD A+S); delay 1/4D 1/8D 1/16D; less pitch wobble from the generators (no macro on PITCH, pitched delay seldom, octaves); STOP TO EDIT says SONG PLAYS. (2026-10-31) V10.7: SEQ > EUCLID on a kit: LANE ALL first (DENSITY: a whole usable kit), a lane picked writes that lane alone; EDIT + PRESETS jumps between engines; the kit's SEQ dice plays in every genre; EUCLID's HITS exact (VARY moved them only); REC held alone and let go: UNDO (again: REDO). (2026-10-31) V10.6: SEQ > EUCLID and MODES (a euclidean pattern generator, melodies in the key) in MUTATE's place; MUTATE and SEQ TOOLS' RANDOM COOK BEAT gone. (2026-10-31) V10.5: automation thinned (a recording at the stop, the 64 when full) into holds and RAMPs. (2026-10-31) V10.4: ARRANGE / TIMELINE: OCT- deletes the row picked (DELETE ROW?). (2026-10-31) V10.3: TIMELINE: the lines between lanes soft (the block's colour, darker), the rows' edges stronger. (2026-10-31) V10.2: TIMELINE keeps the black line between lanes (only the rows touch); SAVE composes first: TIMELINE SECTIONS PROJECTS ARRANGE TOOLS USER PRESETS. (2026-10-30) V10.1: TIMELINE blocks fill the lanes (no black gaps between rows or tracks). (2026-10-30) JIANT FM V10: add15-beta6 as the new base (TIMELINE, VAR, ADD, official V16 both ways); the version history before it: the git log of the add15 line (codex/add15-private) */
#endif
#if FELUCCA_OTA && !FELUCCA_FLASH
#error "FELUCCA_OTA needs FELUCCA_FLASH"
+5
View File
@@ -250,6 +250,7 @@ static const param_desc_t CLEN_DESC = {"C.LEN", F_ENUM, 0, 64, 0, N_CLEN, 0};
static const param_desc_t DXIMG_DESC = {"IMAGE", F_INT, 0, 127, 0, 0, 0}; /* (0.6.48) P_DXIMG */
/* (V10.6) SEQ > EUCLID / MODES' knobs (ui_euclid.c: ids ID_EU0 + EK_*, the views of the selected track's settings) */
#define ID_EU0 0xF0u
#define ID_MU0 0xE4u /* (V10.16) SEQ > MUTATE's four (EK_U0 + 0..3) */
static const param_desc_t *eu_desc(uint32_t k, int16_t **valp);
static const char *const N_CHRD[] = {"OFF", "TRIAD", "7TH", "ADD9", "SUS2", "SUS4", "MAJ", "MIN", "7", "MAJ7", "MIN7",
"POWER", 0};
@@ -710,6 +711,8 @@ static const page_t PAGES[] = {
{"RIELES", FAM_GLO, SC_GLOBAL, GR_LIVE, {0xFF, 0xFF, 0xFF, 0xFF}}, /* .. the six sequences as rails, four knobs */
{"TIMELINE", FAM_SAVE, SC_GLOBAL, GR_SONG, {0xFF, 0xFF, 0xFF, 0xFF}}, /* (add15) the song as lanes (was ARRANGE 2): a row's tracks, the section each
* plays from (song_chain.c row_src; ui_input.c song_trk_knob) */
{"MUTATE", FAM_SEQ, SC_TRACK, GR_EUCLID, {ID_MU0, ID_MU0 + 1u, ID_MU0 + 2u, ID_MU0 + 3u}}, /* (V10.16) EUCLID's
* mutations on the bar: EVERY AMOUNT MODE WHAT */
};
#define BAR_PAGE(pg) ((pg)->graph == GR_STEPS && (pg)->id[0] == 0xFFu)
#define NPAGES (sizeof(PAGES) / sizeof(PAGES[0]))
@@ -785,6 +788,8 @@ static const param_desc_t *page_desc(const page_t *pg, uint32_t slot, int16_t **
id += ms_ui_step & 15u;
if (id >= ID_EU0 && id < ID_EU0 + 8u) /* (V10.6) EUCLID's and MODES' views (ui_euclid.c eu_put) */
return eu_desc(id - ID_EU0, valp);
if (id >= ID_MU0 && id < ID_MU0 + 4u) /* (V10.16) MUTATE's */
return eu_desc(id - ID_MU0 + 8u, 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;
+151 -49
View File
@@ -13,10 +13,17 @@
* (the seed), OCT- the one before. The settings are the session's (RAM), the pattern is the track's as any other */
#define EU_M 4u
typedef struct { uint8_t h, n, r; } eul_t;
typedef struct { uint8_t on, lane, vary, src, root, ctr; uint16_t mask, seed, prev; uint8_t m[EU_M]; eul_t a, l[NLANE]; } eu_t; /* lane 0 ALL (a: DENSITY, STEPS, ROTATE), 1.. a lane */
typedef struct { uint8_t on, lane, src, root, ctr, vary; uint16_t mask, prev, seed; uint8_t m[EU_M]; eul_t a, l[NLANE];
uint8_t mu[4], bar, flip; } eu_t; /* lane 0 ALL (a: DENSITY, STEPS, ROTATE), 1.. a lane; (V10.16) mu: MUTATE's
* EVERY AMOUNT MODE WHAT, bar: the bar it last mutated on, flip: PULSE's */
#define EU_Z0 __builtin_offsetof(eu_t, vary) /* (V10.16) the settings a mutation changes: vary .. l[], the anchor */
#define EU_ZN (__builtin_offsetof(eu_t, mu) - EU_Z0)
static eu_t eu[NTRK];
static uint8_t eu_z[NTRK][EU_ZN]; /* (V10.16) each track's anchor: what MUTATE orbits, OCT- returns to */
static uint32_t eu_s, eu_ms;
enum { EK_HITS, EK_STEPS, EK_ROT, EK_K4, EK_M0, EK_N = EK_M0 + EU_M };
enum { EK_HITS, EK_STEPS, EK_ROT, EK_K4, EK_M0, EK_U0 = EK_M0 + EU_M, EK_N = EK_U0 + 4 };
static const uint8_t EU_MX[4] = {5, 100, 2, 3}; /* (V10.16) MUTATE's settings' tops */
static void eu_anchor(uint32_t k) { memcpy(eu_z[k % NTRK], (uint8_t *)&eu[k % NTRK] + EU_Z0, EU_ZN); }
static uint32_t eu_rnd(void) { eu_s ^= eu_s << 13; eu_s ^= eu_s >> 17; eu_s ^= eu_s << 5; return eu_s; }
static uint32_t eu_ch(uint32_t pct) { return eu_rnd() % 100u < pct; }
@@ -51,21 +58,23 @@ static eu_t *eu_of(uint32_t k)
eu_kit(e);
if (drum_track(&trk[k])) { e->m[0] = 40; e->m[3] = 30; }
else { e->l[0].h = 5; e->m[0] = 45; e->m[1] = 20; e->m[2] = 10; e->m[3] = 15; }
e->mu[1] = 50;
eu_anchor(k);
}
return e;
}
/* VARY on hits on[] of n steps (v 0..100): hits moved a step, never added or dropped (V10.7: HITS is what
* sounds); len[] (0: none) the steps each note holds */
/* VARY on hits on[] of n steps (v 0..100): hits moved one to three steps, never added or dropped (V10.7: HITS is what
* sounds); len[] (0: none) the steps each note holds. (V10.16) The pattern is VARY's turns of the cycle (eu_turns), each
* moved anew: the first near the grid, the last the most (A A' A'' B) */
static void eu_vary(uint8_t *on, uint8_t *len, uint32_t n, uint32_t v)
{
uint32_t i, g;
for (i = 1; i < n; i++) {
if (on[i] != 1u) continue;
if (eu_ch(v * (i >= n / 2u ? 7u : 4u) / 10u)) { /* a step on (to the offbeat mostly) or back */
uint32_t j = (i & 1u) ? (eu_ch(50) ? i + 1u : i - 1u) : (eu_ch(60) ? i + 1u : i - 1u);
if (j > 0u && j < n && !on[j]) { on[i] = 0; on[j] = 2; }
}
if (on[i] != 1u || !eu_ch(v * (i >= n / 2u ? 10u : 6u) / 10u)) continue;
g = 1u + eu_ch(v / 2u) + eu_ch(v / 4u); /* a step on (to the offbeat mostly) or back, further the more */
g = eu_ch((i & 1u) ? 50 : 60) ? i + g : i - g;
if (g > 0u && g < n && !on[g]) { on[i] = 0; on[g] = 2; }
}
for (i = 0; len && i < n; i++) {
len[i] = 1;
@@ -75,6 +84,14 @@ static void eu_vary(uint8_t *on, uint8_t *len, uint32_t n, uint32_t v)
}
}
/* (V10.16) VARY's turns: as many cycles of n (up to four, 64 steps) as the pattern holds with VARY on; turn c of nc its
* amount: the first a third, the last half as much again */
static uint32_t eu_turns(uint32_t n, uint32_t v) { return !v ? 1u : n * 4u <= 64u ? 4u : n * 2u <= 64u ? 2u : 1u; }
static uint32_t eu_vc(uint32_t v, uint32_t c, uint32_t nc)
{
return nc < 2u ? v : !c ? v / 3u : c + 1u == nc ? (v * 3u / 2u > 100u ? 100u : v * 3u / 2u) : v;
}
/* the key of melodic track k: SCL's, else the one the other tracks' notes fit (src 1 + the track with the most), else
* the seed's (NEW); e->root and e->mask */
static void eu_key(uint32_t k, eu_t *e)
@@ -124,7 +141,7 @@ static int32_t eu_deg(const uint8_t *pc, uint32_t np, int32_t base, int32_t d)
static void eu_drums(track_t *t, eu_t *e, uint32_t only)
{
uint8_t on[64];
uint32_t l, i, n, old = (uint32_t)clamp(t->p[P_SLEN], 1, 64), len = only ? old : 1u;
uint32_t l, i, j, n, old = (uint32_t)clamp(t->p[P_SLEN], 1, 64), len = only ? old : 1u;
for (l = 0; l < NLANE; l++) { /* the pattern: the lanes' least common length, up to 64 */
uint32_t a = len, b = e->l[l].n;
if (!e->l[l].h || (only && l != only - 1u)) continue;
@@ -132,6 +149,7 @@ static void eu_drums(track_t *t, eu_t *e, uint32_t only)
len = len / a * e->l[l].n > 64u ? 64u : len / a * e->l[l].n;
}
if (len < 2u) len = 16;
if (!only) len *= eu_turns(len, e->m[3]); /* (V10.16) VARY's turns */
for (i = 0; i < NSTEP; i++)
if (!only) step_clear(&t->step[i]);
else {
@@ -142,15 +160,21 @@ static void eu_drums(track_t *t, eu_t *e, uint32_t only)
for (l = only ? only - 1u : 0u; l < (only ? only : NLANE); l++) {
const eul_t *L = &e->l[l];
eul_t acc = {(uint8_t)(L->h * e->m[0] / 100u + (e->m[0] && L->h ? 1u : 0u)), L->n, (uint8_t)(L->r + 1u)};
uint32_t c, nc, v = l ? e->m[3] : e->m[3] / 2u, fill = 0;
if (!L->h || !(n = L->n)) continue;
eu_s = e->seed * 2654435761u + l * 97u + 1u;
for (i = 0; i < n; i++) on[i] = (uint8_t)eu_hit(i, L);
eu_vary(on, 0, n, l ? e->m[3] : e->m[3] / 2u);
nc = (len + n - 1u) / n;
for (i = 0; i < len; i++) {
if (!(i % n)) { /* (V10.16) each turn of the cycle moved anew */
c = i / n;
eu_s = e->seed * 2654435761u + l * 97u + c * 7919u + 1u;
for (j = 0; j < n; j++) on[j] = (uint8_t)eu_hit(j, L);
eu_vary(on, 0, n, eu_vc(v, c, nc));
fill = nc > 1u && c + 1u == nc && l ? v / 3u : 0u; /* (the last turn's end: rolls) */
}
if (on[i % n]) {
grid_hit(t, i, l, 1);
if (e->m[0] && eu_hit(i % n, &acc)) grid_acc(t, i, l, 1);
if (eu_ch(e->m[2] / 2u)) grid_hit_set(t, i, l, 1u + (eu_ch(70) ? LM_X2 : LM_X4));
if (eu_ch(e->m[2] / 2u + (i % n >= n * 3u / 4u ? fill : 0u))) grid_hit_set(t, i, l, 1u + (eu_ch(70) ? LM_X2 : LM_X4));
} else if (l && eu_ch(e->m[1] * 35u / 100u)) {
grid_hit_set(t, i, l, 1u + LM_GHOST);
}
@@ -163,7 +187,8 @@ static void eu_drums(track_t *t, eu_t *e, uint32_t only)
static void eu_melody(uint32_t k, track_t *t, eu_t *e)
{
uint8_t on[64], ln[64], pc[12];
uint32_t n = e->l[0].n ? e->l[0].n : 16u, i, c, np = 0, g = 0;
int8_t mem[64] = {0}; /* (V10.16) the first turn's degrees, hit by hit: the motif */
uint32_t n = e->l[0].n ? e->l[0].n : 16u, i, c, np = 0, g = 0, cy, nc = eu_turns(n, e->vary), o, j, vc;
int32_t ctr = 0, base, deg = 0, mo = e->m[0], ha = e->m[1];
for (i = 0; !e->ctr && i < (uint32_t)clamp(t->p[P_SLEN], 1, NSTEP); i++) /* the register: the notes it had at the
* first turn (none: C4), kept */
@@ -176,44 +201,51 @@ static void eu_melody(uint32_t k, track_t *t, eu_t *e)
if (!np) { pc[0] = 0; np = 1; }
base = ctr - ((ctr - e->root + 120) % 12); /* the root at or below the middle */
for (i = 0; i < NSTEP; i++) step_clear(&t->step[i]);
t->p[P_SLEN] = (int16_t)n;
t->p[P_SLEN] = (int16_t)(n * nc);
eu_s = e->seed * 2654435761u + k * 131u + 7u;
for (i = 0; i < n; i++) on[i] = (uint8_t)eu_hit(i, &e->l[0]);
eu_vary(on, ln, n, e->vary);
for (i = 0; i < n; i++) {
step_t *s = &t->step[i];
int32_t note, sh = 0;
if (!on[i]) continue;
if (i) {
int32_t span = mo * 5 / 100, d = span ? (int32_t)(eu_rnd() % (uint32_t)(2 * span + 1)) - span : 0;
if (!(i & 3u) && eu_ch(50)) d = -deg + (eu_ch(50) ? 0 : (np >= 7u ? 4 : 3)); /* home or the fifth */
deg = clamp(deg + d, -3, 9);
}
if (eu_ch(e->m[2] * 6u / 10u)) sh = eu_ch(50) ? 12 : -12;
note = clamp(eu_deg(pc, np, base, deg) + sh, 24, 108);
s->time = ST_NOTE;
s->vel = 100;
s->note[0] = (uint8_t)note;
s->n = 1;
if (!(i & 3u) && eu_ch((uint32_t)ha)) { /* a chord of the scale on a strong beat */
s->note[s->n++] = (uint8_t)clamp(eu_deg(pc, np, base, deg + 2) + sh, 24, 108);
if (ha > 50) s->note[s->n++] = (uint8_t)clamp(eu_deg(pc, np, base, deg + 4) + sh, 24, 108);
}
if (eu_ch(e->m[3] * 7u / 10u)) s->flags |= SF_SLIDE;
for (c = 1; c < ln[i] && i + c < n; c++) { /* held over the gap */
t->step[i + c].time = ST_TIE;
t->step[i + c].n = 0;
for (cy = 0; cy < nc; cy++) { /* (V10.16) VARY's turns: A, then the motif answered */
o = cy * n;
vc = eu_vc(e->vary, cy, nc);
for (i = 0; i < n; i++) on[i] = (uint8_t)eu_hit(i, &e->l[0]);
eu_vary(on, ln, n, vc);
for (i = 0, j = 0; i < n; i++) {
step_t *s = &t->step[o + i];
int32_t note, sh = 0;
if (!on[i]) continue;
if (cy && j < 64u && !eu_ch(vc * 6u / 10u)) deg = mem[j]; /* the motif's note, or a new one */
else if (i) {
int32_t span = mo * 5 / 100, d = span ? (int32_t)(eu_rnd() % (uint32_t)(2 * span + 1)) - span : 0;
if (!(i & 3u) && eu_ch(50)) d = -deg + (eu_ch(50) ? 0 : (np >= 7u ? 4 : 3)); /* home or the fifth */
deg = clamp(deg + d, -3, 9);
} else if (!cy) deg = 0;
if (!cy && j < 64u) mem[j] = (int8_t)deg;
j++;
if (eu_ch(e->m[2] * 6u / 10u)) sh = eu_ch(50) ? 12 : -12;
note = clamp(eu_deg(pc, np, base, deg) + sh, 24, 108);
s->time = ST_NOTE;
s->vel = 100;
s->note[0] = (uint8_t)note;
s->n = 1;
if (!(i & 3u) && eu_ch((uint32_t)ha)) { /* a chord of the scale on a strong beat */
s->note[s->n++] = (uint8_t)clamp(eu_deg(pc, np, base, deg + 2) + sh, 24, 108);
if (ha > 50) s->note[s->n++] = (uint8_t)clamp(eu_deg(pc, np, base, deg + 4) + sh, 24, 108);
}
if (eu_ch(e->m[3] * 7u / 10u)) s->flags |= SF_SLIDE;
for (c = 1; c < ln[i] && i + c < n; c++) { /* held over the gap */
t->step[o + i + c].time = ST_TIE;
t->step[o + i + c].n = 0;
}
}
}
}
/* the pattern of track k written again from its settings */
static void eu_gen(uint32_t k)
static void eu_gen(uint32_t k, uint32_t hand)
{
track_t *t = &trk[k % NTRK];
eu_t *e = eu_of(k);
if (fm1_ms - eu_ms > 2000u) undo_mark(); /* (a new gesture: an UNDO point) */
eu_ms = fm1_ms;
if (hand && fm1_ms - eu_ms > 2000u) undo_mark(); /* (a new gesture: an UNDO point; MUTATE's turns none) */
eu_ms = hand ? fm1_ms : eu_ms;
load_begin(t, LOAD_PAT);
if (drum_track(t)) eu_drums(t, e, e->lane % (NLANE + 1u)); else eu_melody(k, t, e);
load_end(t);
@@ -228,6 +260,9 @@ static const param_desc_t *eu_desc(uint32_t k, int16_t **valp)
{
static const char *const LN[NLANE + 1] = {"ALL", "BD", "SD", "CP", "CH", "OH", "TM", "RS", "CB"};
static const char *const MD[2][EU_M] = {{"MOTION", "HARMONY", "OCTAVE", "SLIDE"}, {"ACCENT", "GHOST", "RATCHET", "VARY"}};
static const char *const MU[3][6] = {{"OFF", "1 BAR", "2 BARS", "4 BARS", "8 BARS", "16 BARS"}, {"ORBIT", "DRIFT", "PULSE"},
{"GROOVE", "RHYTHM", "FEEL", "ALL"}};
static const char *const ML[4] = {"EVERY", "AMOUNT", "MODE", "WHAT"};
eu_t *e = eu_of(song.sel);
uint32_t dr = drum_track(TSEL) != 0;
uint32_t al = dr && !(e->lane % (NLANE + 1u));
@@ -240,7 +275,13 @@ static const param_desc_t *eu_desc(uint32_t k, int16_t **valp)
else if (k == EK_ROT) { eu_d.label = "ROTATE"; eu_d.max = L->n > 1u ? L->n - 1 : 0; eu_v[k] = L->r; }
else if (k == EK_K4 && dr) { eu_d.label = "LANE"; eu_d.fmt = F_ENUM; eu_d.max = NLANE; eu_d.names = LN; eu_v[k] = e->lane; }
else if (k == EK_K4) { eu_d.label = "VARY"; eu_d.max = 100; eu_v[k] = e->vary; }
else { eu_d.label = MD[dr][k - EK_M0]; eu_d.max = 100; eu_v[k] = e->m[k - EK_M0]; }
else if (k < EK_U0) { eu_d.label = MD[dr][k - EK_M0]; eu_d.max = 100; eu_v[k] = e->m[k - EK_M0]; }
else { /* (V10.16) MUTATE */
k -= EK_U0;
eu_d.label = ML[k]; eu_d.max = EU_MX[k]; eu_v[k + EK_U0] = e->mu[k];
if (k != 1u) { eu_d.fmt = F_ENUM; eu_d.names = MU[k ? k - 1u : 0u]; }
k += EK_U0;
}
*valp = &eu_v[k];
return &eu_d;
}
@@ -252,6 +293,12 @@ static void eu_put(uint32_t k, int32_t v)
uint32_t al = dr && !(e->lane % (NLANE + 1u));
eul_t *L = al ? &e->a : &e->l[dr ? (e->lane + NLANE) % (NLANE + 1u) : 0];
if (k == EK_K4 && dr) { e->lane = (uint8_t)clamp(v, 0, NLANE); ui.force = 1; return; }
if (k >= EK_U0) { /* (V10.16) MUTATE: its settings (EVERY on: the anchor now) */
if (k == EK_U0 && !e->mu[0] && v > 0) eu_anchor(song.sel);
e->mu[k - EK_U0] = (uint8_t)clamp(v, 0, EU_MX[k - EK_U0]);
ui.force = 1;
return;
}
if (k == EK_HITS) L->h = (uint8_t)clamp(v, al, al ? 8 : L->n);
else if (k == EK_STEPS) { L->n = (uint8_t)clamp(v, 2, 64); if (!al && L->h > L->n) L->h = L->n; if (L->r >= L->n) L->r = 0; }
else if (k == EK_ROT) L->r = (uint8_t)clamp(v, 0, L->n - 1);
@@ -259,16 +306,65 @@ static void eu_put(uint32_t k, int32_t v)
else e->m[(k - EK_M0) % EU_M] = (uint8_t)clamp(v, 0, 100);
if (al && k < EK_K4) eu_kit(e); /* (ALL: the kit again, of DENSITY, STEPS, ROTATE) */
if (chain_busy()) { ui_message("SONG PLAYS: STOP IT TO EDIT"); return; }
eu_gen(song.sel);
eu_anchor(song.sel); /* (V10.16) what is dialled: MUTATE's anchor */
eu_gen(song.sel, 1);
}
/* OCT+ a new variation, OCT- the one before */
static void eu_oct(int up)
/* (V10.16) MUTATE: track k's settings moved by AMOUNT (from the anchor: ORBIT; from where they are: DRIFT; PULSE: the
* anchor and a mutation by turns): always a new seed (GROOVE: where the hits fall, the notes), RHYTHM HITS (DENSITY)
* and ROTATE, FEEL the four MODES and VARY; a lane picked: that lane's, the others as they are */
static void eu_mutate(uint32_t k, eu_t *e)
{
uint32_t p = e->mu[1], w = e->mu[3], dr = drum_track(&trk[k]) != 0, sl = e->lane % (NLANE + 1u), i, al = dr && !sl;
eul_t *L = al ? &e->a : &e->l[dr ? sl - 1u : 0u];
int32_t d = (int32_t)(1u + p / 40u);
if (e->mu[2] != 1u) memcpy((uint8_t *)e + EU_Z0, eu_z[k], EU_ZN);
if (e->mu[2] == 2u && (e->flip ^= 1u) == 0u) { eu_gen(k, 0); return; } /* (PULSE: the anchor's turn) */
eu_s ^= fm1_ms * 2654435761u + k;
e->seed = (uint16_t)(eu_rnd() | 1u);
if ((w == 1u || w == 3u) && L->n) { /* RHYTHM */
if (eu_ch(p)) L->h = (uint8_t)clamp((int32_t)L->h + (eu_ch(50) ? d : -d), al || !dr ? 1 : 0, al ? 8 : L->n);
if (eu_ch(p)) L->r = (uint8_t)((L->r + eu_rnd() % (1u + p * L->n / 200u)) % L->n);
if (al) eu_kit(e);
}
if (w >= 2u) /* FEEL */
for (i = 0; i <= EU_M; i++) {
uint8_t *m = i < EU_M ? &e->m[i] : &e->vary;
if (eu_ch(p)) *m = (uint8_t)clamp((int32_t)*m + (int32_t)(eu_rnd() % (p + 1u)) - (int32_t)p / 2, 0, 100);
}
eu_gen(k, 0);
}
/* (V10.16) called every UI frame: playing (not a song's chain), each track with EVERY on mutates in the last beat of
* every EVERY bars (the pattern new from the next bar) */
static void eu_tick(void)
{
uint32_t k, b = bar_n;
for (k = 0; !song.playing && k < NTRK; k++) eu[k].bar = 0; /* (stopped: from the top again) */
if (!song.playing || chain_busy() || beat_n != 3u || beat_pos < beat_samples() / 2u) return;
for (k = 0; k < NTRK; k++) {
eu_t *e = &eu[k];
if (!e->on || !e->mu[0] || e->bar == (uint8_t)(b + 1u) || (b + 1u) % (1u << (e->mu[0] - 1u))) continue;
e->bar = (uint8_t)(b + 1u);
eu_mutate(k, e);
if (k == song.sel) ui.force = 1;
}
}
/* OCT+ a new variation, OCT- the one before; (V10.16) on MUTATE: OCT+ a mutation now, OCT- back to the anchor */
static void eu_oct(int up, int mu)
{
eu_t *e = eu_of(song.sel);
if (chain_busy()) { ui_message("SONG PLAYS: STOP IT TO EDIT"); return; }
if (mu) {
if (up) eu_mutate(song.sel, e);
else { memcpy((uint8_t *)e + EU_Z0, eu_z[song.sel], EU_ZN); eu_gen(song.sel, 1); }
ui_message(up ? "MUTATED" : "ANCHOR");
return;
}
if (up) { e->prev = e->seed; e->seed = (uint16_t)(e->seed * 25173u + 13849u); }
else { uint16_t s = e->seed; e->seed = e->prev; e->prev = s; }
eu_gen(song.sel);
eu_anchor(song.sel);
eu_gen(song.sel, 1);
ui_message(up ? "NEW VARIATION" : "VARIATION BEFORE");
}
@@ -285,6 +381,12 @@ static void graph_euclid(const track_t *t)
uint32_t now = song.playing ? t->seq_idx % len : ~0u;
char b[12];
n = dr && sl ? (e->l[lane].n < len ? e->l[lane].n : len) : len;
if (e->mu[0]) { /* (V10.16) MUTATE on: the bars to the next one */
uint32_t ev = 1u << (e->mu[0] - 1u);
str_cpy(b, "MUT ", sizeof b);
fmt_int(b + 4, (int32_t)(song.playing ? ev - bar_n % ev : ev));
cv_text(2, 2, &AF_X, b, T_ACCENT);
}
for (i = 0; i < n; i++) { /* the ring */
uint32_t a = i * 65536u / n + 49152u;
int32_t x = cx + ((rad * og_cos(a)) >> 15), y = cy + ((rad * og_sin(a)) >> 15), r;
+3 -1
View File
@@ -2154,6 +2154,7 @@ static void ui_input_frame(void);
static void ui_input(void)
{
ui_input_frame();
eu_tick(); /* (V10.16) EUCLID's MUTATE, on the bar */
scale_link(); /* (JIANT 0.4) one scale for every melodic track (after the
* frame's edits) */
}
@@ -2585,7 +2586,8 @@ static void ui_input_frame(void)
if (live_page()) /* (p2) LIVE: OCT- RETURN / held BYPASS, OCT+ COMMIT */
break; /* (ui_live.c live_frame) */
if (!ui.home && !ui.menu && !ui.confirm && cur_page()->graph == GR_EUCLID) { /* (V10.6) EUCLID / MODES: */
eu_oct(b == B_OCTUP); /* OCT+ a new variation, OCT- the one before */
eu_oct(b == B_OCTUP, cur_page()->id[0] == ID_MU0); /* OCT+ a new variation, OCT- the one before;
* (V10.16) MUTATE: a mutation now, back to the anchor */
break;
}
if ((fm1_in.buttons & both) == both)
+3 -2
View File
@@ -463,8 +463,9 @@ static void hint_tick(void)
else if (k == HK_PUNCH)
ui_message("REC + PLAY, HOLD FX + A KEY"); /* (0.6.99) the lane's recording */
else { /* (V10.6) HK_EUCLID */
ui_message("TURN A KNOB: A PATTERN");
str_cpy(ui.msg2, "OCT+ NEW OCT- BEFORE", sizeof ui.msg2);
int mu = cur_page()->id[0] == ID_MU0; /* (V10.16) MUTATE's keys */
ui_message(mu ? "EVERY: MUTATE ON THE BAR" : "TURN A KNOB: A PATTERN");
str_cpy(ui.msg2, mu ? "OCT+ MUTATE OCT- ANCHOR" : "OCT+ NEW OCT- BEFORE", sizeof ui.msg2);
}
ui.hint_pg = (uint8_t)at; /* (0.9.0: this page's only) */
}
+1 -1
View File
@@ -64,7 +64,7 @@ enum { LV_PAT, LV_BAR, LV_STEP, LV_N }; /* SEQ's pictures: the b
* PLAYHEADS . STRETCH . COMP (COMP 2 after it, by SELECT as before) . AUTO (AUTOMATION, AUTO LIST). BAR and NOTE stay pages
* (code puts them) but out of the chain, until the step held opens its own (the mock-up's slice 5) */
static const nv_t CE_SEQ[] = {NV("STEP", 0, 0, LV_BAR), NV("PATTERN", "LENGTH", 1, LV_PAT), NV("TRACK", 0, 1, LV_PAT),
NV("EUCLID", 0, 2, LV_PAT), NV("MODES", 0, 2, LV_PAT),
NV("EUCLID", 0, 2, LV_PAT), NV("MODES", 0, 2, LV_PAT), NV("MUTATE", 0, 2, LV_PAT),
NV("PLAYHEADS", 0, 3, LV_PAT), NV("STRETCH", 0, 4, LV_PAT),
NV("COMP", 0, 5, LV_STEP), NV("COMP 2", 0, 5, LV_STEP), NV("AUTOMATION", 0, 6, LV_BAR),
NV("AUTO LIST", 0, 6, LV_BAR)};
+126 -22
View File
@@ -690,6 +690,108 @@ static uint32_t lane_steps(const track_t *t, uint32_t l) /* bit i: lane l stri
return m;
}
static void go_title(const char *title);
/* (V10.16) EUCLID's VARY in turns (A A' A'' B, each cycle moved anew, HITS exact in each) and SEQ > MUTATE (on the bar,
* ORBIT round the anchor, DRIFT on, PULSE by turns; OCT+ a mutation now, OCT- back to the anchor) */
static uint32_t eu_cyc_sig(const track_t *t, uint32_t c, uint32_t n, uint32_t lane)
{
uint32_t i, h = 2166136261u;
for (i = 0; i < n; i++) {
const step_t *s = &t->step[c * n + i];
h = (h ^ (lane < NLANE ? (step_lanes(s) >> lane) & 1u : s->time == ST_NOTE ? s->note[0] : 0u)) * 16777619u;
}
return h;
}
static uint32_t mel_sig(const track_t *t) /* (the notes and times: a TIE keeps its old bytes) */
{
return eu_cyc_sig(t, 0, 16, NLANE) ^ eu_cyc_sig(t, 1, 16, NLANE) * 3u ^ eu_cyc_sig(t, 2, 16, NLANE) * 5u ^
eu_cyc_sig(t, 3, 16, NLANE) * 7u;
}
static int test_eumutate(void)
{
int bad = 0, ok;
uint32_t i, c, n, s0, diff;
track_t *d = &trk[0], *m = &trk[1];
ui_power_on();
set_engine_of(d, ENGI_DRUM); set_engine_of(m, ENGI_ANALOG);
memset(eu, 0, sizeof eu);
song.sel = 0; frame();
go_title("EUCLID"); frame();
eu_put(EK_HITS, 6); frame(); /* a kit, VARY 30 (its default) */
ok = d->p[P_SLEN] == 64;
for (c = diff = 0; c < 4u; c++) {
for (i = n = 0; i < 16u; i++) n += (step_lanes(&d->step[c * 16u + i]) >> DV_KICK) & 1u;
ok &= n == eu[0].l[DV_KICK].h; /* (HITS exact in each turn) */
}
eu_put(EK_M0 + 3u, 90); frame(); /* MODES' VARY up */
s0 = eu_cyc_sig(d, 0, 16, DV_HATC);
for (c = 1, diff = 0; c < 4u; c++) diff += eu_cyc_sig(d, c, 16, DV_HATC) != s0;
ok &= diff >= 2u;
eu_put(EK_M0 + 3u, 0); frame();
ok &= d->p[P_SLEN] == 16; /* (VARY 0: one turn, as before) */
bad += check("V10.16 VARY on a kit: four turns (64 steps), each moved anew (HITS exact in each); VARY 0 one turn", ok);
song.sel = 1; frame();
m->p[P_SCALE] = 2; m->p[P_ROOT] = 0;
go_title("EUCLID"); frame();
eu_put(EK_K4, 80); frame(); /* the melody's VARY */
ok = m->p[P_SLEN] == 64;
s0 = eu_cyc_sig(m, 0, 16, NLANE);
for (c = 1, diff = 0; c < 4u; c++) diff += eu_cyc_sig(m, c, 16, NLANE) != s0;
ok &= diff >= 2u;
for (i = n = c = 0; i < 64u; i++)
if (m->step[i].time == ST_NOTE && m->step[i].n) { n++; c += (SCALE_MASK[2] >> (m->step[i].note[0] % 12u)) & 1u; }
ok &= n == 4u * eu[1].l[0].h && c == n;
bad += check("V10.16 VARY on a melody: four turns, the motif answered (notes in the key, HITS in each turn)", ok);
go_title("MUTATE"); frame();
ok = str_eq(cur_page()->title, "MUTATE") && cur_page()->graph == GR_EUCLID;
{
int16_t *v; const param_desc_t *pd = page_desc(cur_page(), 0, &v);
ok &= pd && str_eq(pd->label, "EVERY") && *v == 0;
pd = page_desc(cur_page(), 2, &v);
ok &= pd && str_eq(pd->label, "MODE") && pd->fmt == F_ENUM && str_eq(pd->names[*v], "ORBIT");
}
{ /* EVERY 1 BAR, playing: the bar's last beat mutates (no UNDO point); stopped nothing */
uint8_t anc[EU_ZN];
uint32_t sig = mel_sig(m);
turn(EN_K1, 1); frame();
ok &= eu[1].mu[0] == 1u;
memcpy(anc, eu_z[1], EU_ZN);
eu_put(EK_U0 + 1u, 100); eu_put(EK_U0 + 3u, 3); /* AMOUNT 100, WHAT ALL */
song.playing = 0; eu_tick();
ok &= mel_sig(m) == sig;
song.playing = 1; bar_n = 0; beat_n = 3; beat_pos = beat_samples() - 1u;
undo_ok = 0; fm1_ms += 5000u;
eu_tick();
ok &= mel_sig(m) != sig && !undo_ok;
sig = mel_sig(m);
eu_tick(); /* (once a bar) */
ok &= mel_sig(m) == sig;
bar_n = 1; eu_tick();
ok &= mel_sig(m) != sig && !memcmp(anc, eu_z[1], EU_ZN); /* (ORBIT: the anchor stays) */
song.playing = 0; beat_n = 0;
press(B_OCTDN); frame(); /* OCT-: back to the anchor */
ok &= !memcmp((uint8_t *)&eu[1] + EU_Z0, anc, EU_ZN) && msg_is("ANCHOR");
sig = mel_sig(m);
press(B_OCTUP); frame(); /* OCT+: a mutation now, stopped too */
ok &= mel_sig(m) != sig && msg_is("MUTATED");
bad += check("V10.16 MUTATE: EVERY on the bar's last beat while playing (none stopped, once a bar, no UNDO point); OCT- the anchor, OCT+ now", ok);
eu_put(EK_U0 + 2u, 2); /* PULSE: the anchor every second time */
press(B_OCTDN); frame();
sig = mel_sig(m);
eu[1].flip = 0;
press(B_OCTUP); frame(); ok = mel_sig(m) != sig;
press(B_OCTUP); frame(); ok &= mel_sig(m) == sig;
eu_put(EK_U0 + 2u, 1); /* DRIFT: from where it is (AMOUNT 100: HITS or ROTATE move) */
press(B_OCTUP); frame(); press(B_OCTUP); frame(); press(B_OCTUP); frame();
ok &= memcmp((uint8_t *)&eu[1] + EU_Z0, anc, EU_ZN) != 0 && !memcmp(anc, eu_z[1], EU_ZN);
bad += check("V10.16 MUTATE's MODE: PULSE the anchor by turns, DRIFT walks on (the anchor kept)", ok);
chain.running = 1; song.playing = 1; bar_n = 3; beat_n = 3;
sig = mel_sig(m); eu_tick(); ok = mel_sig(m) == sig;
chain.running = 0; song.playing = 0; beat_n = 0;
bad += check("V10.16 MUTATE: not while a song's chain plays", ok);
}
memset(eu, 0, sizeof eu);
return bad;
}
static int test_mutate(void)
{ /* (V10.6) SEQ > EUCLID / MODES (ui_euclid.c), MUTATE's place */
int bad = 0, ok;
@@ -699,6 +801,7 @@ static int test_mutate(void)
d = &trk[0]; m = &trk[1];
set_engine_of(d, ENGI_DRUM); set_engine_of(m, ENGI_ANALOG);
memset(eu, 0, sizeof eu);
eu_of(0)->m[3] = 0; eu_of(1)->vary = 0; /* (V10.16: VARY off, one turn: the tests below as they were) */
song.sel = 0; frame();
go_title("EUCLID"); frame();
ok = cur_page()->graph == GR_EUCLID && str_eq(PAGES[ui.page].title, "EUCLID");
@@ -7207,8 +7310,8 @@ static int test_save_lens(void)
* layer and the dice on every page. (Was 0.8.3's LENTE: SELECT PATTERN <-> BAR <-> STEP, PRESETS the bar / step) */
static int test_lente(void)
{
static const char *const CH[11] = {"STEP", "LENGTH", "TRACK", "EUCLID", "MODES", "PLAYHEADS", "STRETCH", "COMP",
"COMP 2", "AUTOMATION", "AUTO LIST"};
static const char *const CH[12] = {"STEP", "LENGTH", "TRACK", "EUCLID", "MODES", "MUTATE", "PLAYHEADS", "STRETCH",
"COMP", "COMP 2", "AUTOMATION", "AUTO LIST"};
static const char *const TP[6] = {"LENGTH", "EUCLID", "PLAYHEADS", "STRETCH", "COMP", "AUTOMATION"};
int bad = 0, ok;
uint32_t q, sig;
@@ -7216,35 +7319,35 @@ 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() == 7u &&
lz_tab_lit(0) && lz_crumb_is("SEQ \xB7 STEP \xB7 STEP") && lz_count_is("1/11");
lz_tab_lit(0) && lz_crumb_is("SEQ \xB7 STEP \xB7 STEP") && lz_count_is("1/12");
turn(EN_SELECT, -1); frames(32);
ok &= str_eq(cur_page()->title, "STEP") && lz_count_is("1/11"); /* (the first: no wrap) */
ok &= str_eq(cur_page()->title, "STEP") && lz_count_is("1/12"); /* (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/11") &&
ok &= str_eq(cur_page()->title, "PATTERN") && seq_roll_view(cur_page()) && lz_tab_lit(1) && lz_count_is("2/12") &&
lz_crumb_is("SEQ \xB7 LENGTH \xB7 LENGTH"); /* (PATTERN, named LENGTH) */
turn(EN_SELECT, 1); frames(32);
ok &= str_eq(cur_page()->title, "TRACK") && lz_tab_lit(1) && lz_count_is("3/11") &&
ok &= str_eq(cur_page()->title, "TRACK") && lz_tab_lit(1) && lz_count_is("3/12") &&
lz_crumb_is("SEQ \xB7 LENGTH \xB7 TRACK"); /* (TRACK under the LEN tab) */
turn(EN_SELECT, 5); frames(32);
ok &= str_eq(cur_page()->title, "COMP") && seq_roll_view(cur_page()) && lz_tab_lit(5) && lz_count_is("8/11") &&
turn(EN_SELECT, 6); frames(32);
ok &= str_eq(cur_page()->title, "COMP") && seq_roll_view(cur_page()) && lz_tab_lit(5) && lz_count_is("9/12") &&
lz_crumb_is("SEQ \xB7 COMP \xB7 COMP");
turn(EN_SELECT, 1); frames(32);
ok &= str_eq(cur_page()->title, "COMP 2") && lz_tab_lit(5) && lz_count_is("9/11");
bad += check("seq2 SEQ: enters at STEP (1/11, seven tabs); LENGTH the roll (seq2b), TRACK under its tab, COMP the roll, COMP 2 after it", ok);
bad += check("seq2 SEQ: one chain of 11 by SELECT (no wrap); a SEQ tap the next tab's first, round",
chain_walk(B_SEQ, CH, 11, TP, 6));
ok &= str_eq(cur_page()->title, "COMP 2") && lz_tab_lit(5) && lz_count_is("10/12");
bad += check("seq2 SEQ: enters at STEP (1/12, seven tabs); LENGTH the roll (seq2b), TRACK under its tab, COMP the roll, COMP 2 after it", ok);
bad += check("seq2 SEQ: one chain of 12 by SELECT (no wrap); a SEQ tap the next tab's first, round",
chain_walk(B_SEQ, CH, 12, TP, 6));
{ /* (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[11] = {"STEP", "PATTERN", "TRACK", "EUCLID", "MODES", "PLAYHEADS", "STRETCH", "COMP",
"COMP 2", "AUTOMATION", "AUTO LIST"};
static const char *const TI[12] = {"STEP", "PATTERN", "TRACK", "EUCLID", "MODES", "MUTATE", "PLAYHEADS", "STRETCH",
"COMP", "COMP 2", "AUTOMATION", "AUTO LIST"};
ui_power_on(); TSEL->p[P_SLEN] = 64;
open_family(FAM_SEQ); frame();
ok = 1;
for (q = 0; q < 11u; q++) {
for (q = 0; q < 12u; q++) {
go_title(TI[q]); frame();
memset(host_screen, 0, sizeof host_screen); ui.force = 1; ui_draw();
ok &= str_eq(cur_page()->title, TI[q]) && seq_roll_view(cur_page()) && lens_strip() &&
key_px(PR_ROWS / 2, 6) != T_SURF && key_px(PR_ROWS / 2, 6) != 0u ||
(cur_page()->graph == GR_EUCLID && !seq_roll_view(cur_page())); /* (V10.6: EUCLID / MODES their ring) */
(cur_page()->graph == GR_EUCLID && !seq_roll_view(cur_page())); /* (V10.6: EUCLID / MODES / MUTATE their ring) */
}
bad += check("seq2b SEQ: every page of the chain draws the roll, its keys and the bars' strip (its knobs its own)", ok);
}
@@ -7337,7 +7440,7 @@ static int test_lente(void)
go_title("BAR"); frames(32);
turn(EN_K1, 1);
ok &= ui.bank == 1u;
turn(EN_SELECT, 6); frames(32); /* (from BAR, LENGTH's place: COMP) */
turn(EN_SELECT, 7); frames(32); /* (from BAR, LENGTH's place: COMP; V10.16: past MUTATE) */
ok &= seq_roll_view(cur_page()) && lens_level() == LV_STEP;
bad += check(" DRUM: STEP is the grid (its keys); LENGTH the grid (seq2b), BAR (by code) KNOB 1 the bar; COMP the grid", ok);
return bad;
@@ -11933,14 +12036,14 @@ static int test_toasts(void)
bad += check(" NOTICE blacks out no more than its box (its tabs, its card, its breadcrumb): the page round it, back whole", ok);
/* hints: walking SEQ's chain with SELECT (TRACK > EUCLID > PLAYHEADS) says nothing; dwelt on, MUTATE's; at most HINT_MAX */
ui_power_on(); go_title("TRACK"); frames(400);
for (seen = passed = 0, k = 0; k < 3u; k++) {
for (seen = passed = 0, k = 0; k < 4u; k++) {
turn(EN_SELECT, 1); passed |= str_eq(cur_page()->title, "EUCLID");
for (n = 0; n < 12u; n++) { frame(); seen |= msg_is("TURN A KNOB: A PATTERN") || msg_is("OCT+ NEW OCT- BEFORE"); }
}
for (n = 0; n < 200u; n++) { frame(); seen |= ui.msg_t && ui.msg[0]; }
bad += check("0.9.5 a page's hint: none while SELECT walks past it (TRACK > EUCLID > PLAYHEADS), nor carried onto the next",
passed && str_eq(cur_page()->title, "PLAYHEADS") && !seen);
turn(EN_SELECT, -2); /* back to EUCLID (past MODES): stay */
turn(EN_SELECT, -3); /* back to EUCLID (past MUTATE, MODES): stay */
ok = str_eq(cur_page()->title, "EUCLID");
frames(HINT_DWELL_MS - 160u);
ok &= !ui.msg_t;
@@ -12404,7 +12507,7 @@ static void tk_start(uint32_t from) /* 0 home, 1 seq, 2 fxdl
}
static int test_nav_tasks(void)
{
static const uint8_t WANT[14] = {4, 3, 5, 6, 34, 10, 9, 2, 3, 1, 3, 8, 17, 4}; /* (V10.1: SAVE composes first, 106 -> 108) */ /* (seq2: task 5 by STEP's KNOB 1, no BAR;
static const uint8_t WANT[14] = {4, 3, 5, 6, 34, 10, 9, 2, 3, 1, 3, 8, 18, 4}; /* (V10.1: SAVE composes first, 106 -> 108) */ /* (seq2: task 5 by STEP's KNOB 1, no BAR;
* task 11 TRACK under LEN's tab; task 13 eight detents (seq2c:
* MUTATE 2); was 73) */
uint32_t got[14], t, tot = 0;
@@ -12475,7 +12578,7 @@ static int test_nav_tasks(void)
ok = song.sel == 3u && str_eq(cur_page()->title, "SOUND 2") && c == 1u && dv[DXP_DECAY] != d0; }
break;
case 12: /* COMP 2 of step 9 */
tk_start(1); tk_go(EN_K1, 8); tk_go(EN_SELECT, 8); tk_val(EN_K1, 1); /* (seq2c: eight detents to COMP 2;
tk_start(1); tk_go(EN_K1, 8); tk_go(EN_SELECT, 9); tk_val(EN_K1, 1); /* (seq2c: eight detents to COMP 2, V10.16 nine;
* seq2d: the step picked on STEP, KNOB 1 its ACTION) */
ok = str_eq(cur_page()->title, "COMP 2") && ui.cursor == 8u && TSEL->step[8].comp2 != 0u;
break;
@@ -12493,7 +12596,7 @@ static int test_nav_tasks(void)
}
printf("ui: the race: %u %u %u %u %u %u %u %u %u %u %u %u %u %u = %u actions (0.9.1: 75)\n", got[0], got[1], got[2], got[3],
got[4], got[5], got[6], got[7], got[8], got[9], got[10], got[11], got[12], got[13], tot);
bad += check("0.9.2 the mock-up's 14 tasks on the panel: each goal reached in its PROPOSED actions (seq2c: 106, was 73)", okall && tot == 109u); /* (V10.8: an accent past VEL 127: +1) */
bad += check("0.9.2 the mock-up's 14 tasks on the panel: each goal reached in its PROPOSED actions (seq2c: 106, was 73)", okall && tot == 110u); /* (V10.8: an accent past VEL 127: +1; V10.16 MUTATE in SEQ's chain: +1) */
ui_power_on();
return bad;
}
@@ -12856,6 +12959,7 @@ int main(void)
bad += test_init_system();
bad += test_transitions();
bad += test_mutate();
bad += test_eumutate();
bad += test_morph();
bad += test_morph_click();
bad += test_lfo_sync();
+1882 -1877
View File
File diff suppressed because it is too large. Load diff