Split kit and keys; KEYS GEN with MOTIF, 303, TURING, ARP
Some checks failed
check / check (push) Has been cancelled

- genome(seed, salts) now has three parts with their own RNG streams:
  shared (steps, form, swing, arc, layback, fill odds, phase offset),
  kit (density, frame, accent cycle, free snare) and keys (scale/root,
  progression, motif, hocket, bass tone, note lengths, range). ROLL KEYS
  now renews the harmony too; ROLL KIT leaves the keys alone.
- Keys generators share one signature and can fix note lengths:
  MOTIF (the old line), 303 (acid bass, answers in the rests, drone or
  silent pad), TURING (8/16-bit shift register, DRIFT flips bits, 16-bar
  window), ARP (triad/7th arpeggio, roots on kicks).
- Pages: KIT GEN, KEYS GEN; ROLL shows KIT / KEYS; slots keep both gens.
- Flash record v3 (old settings ignored). Bring-up golden checksums updated.
- C port matches; host test and ASan/UBSan pass.

Intended music change: every seed sounds different (genome split, new
generators). Vectors regenerated with npm run vectors; the case grid now
crosses all kit and keys generators, with TURING runs past its window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 21:50:41 +03:00
parent c2c8a55642
commit 346c820b10
26 changed files with 64270 additions and 42622 deletions

View File

@@ -52,7 +52,11 @@ static void check_primitives(const char *dir){
sb_genome g;
int bad = 0, k;
n++;
sb_genome_make(seed, &g);
{
sb_state gs; jval *sl = json_get(v, "salts");
gs.seed = seed; gs.salts[0] = sl ? (uint32_t)num(sl->items[0]) : 0; gs.salts[1] = sl ? (uint32_t)num(sl->items[1]) : 0;
sb_genome_make(&gs, &g);
}
for(k = 0; k < gj->n; k++){
jval *f = gj->items[k];
const char *key = f->key;
@@ -86,7 +90,7 @@ static void check_case(const jval *c){
n++;
st.seed = hex(json_get(c, "seed"));
st.salts[0] = (uint32_t)num(salts->items[0]); st.salts[1] = (uint32_t)num(salts->items[1]);
p.gen = (int)num(json_get(c, "gen")); p.energy = (int)num(json_get(c, "energy")); p.drift = (int)num(json_get(c, "drift"));
p.gen = (int)num(json_get(c, "gen")); p.keys = (int)num(json_get(c, "keys")); p.energy = (int)num(json_get(c, "energy")); p.drift = (int)num(json_get(c, "drift"));
p.scale = (int)num(json_get(c, "scale")); p.root = (int)num(json_get(c, "root"));
for(b = 0; b < bars->n; b++){
jval *jb = bars->items[b], *ev = json_get(jb, "events");