GEN's bass archetypes (barch_t) in 2 B, was 4: the first step in 13 bits, the bars in 3 (tools/gen_drum_maps.py checks they fit): -124 B; the sound's code 0..2 B earlier

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-12 21:50:58 +00:00
1 parent 31feaa1ff8
commit 2a751f3d2d
3 files changed
+1487 -1485

No files matched your search

+1 -1
View File
@@ -200,7 +200,7 @@ enum { BA_OFFBEAT, BA_OFFOCT, BA_BOUNCE, BA_DEEPWALK, BA_ROLL16, BA_OCTBNC, BA_S
* basses never one; gen.c gen_riff) */
/* (0.9.7, flash) the archetypes below are the text tools/gen_drum_maps.py reads (not compiled): build/gen/gen_bass.h holds
* them a byte a step (BA_STEP: the note's code | the flag's << 4; gen.c ba_note, ba_flag), each its first step and bars */
typedef struct { uint16_t at; uint8_t bars; } barch_t;
typedef struct { uint16_t at : 13, bars : 3; } barch_t; /* (V10.7.21: 2 B, was 4; tools/gen_drum_maps.py checks they fit) */
#ifdef GEN_DRUM_MAPS_TEXT
static const barch_t BASS_ARCH[BA_NALL] = {
[BA_OFFBEAT] = {"..R...R...R...R.", 0, 1},
+1483 -1483
View File
File diff suppressed because it is too large. Load diff
+3 -1
View File
@@ -145,12 +145,14 @@ def main(src, dice, out, dout, bout):
L += zblob("BA_STEP_Z", bytes(steps))
L += ["_Static_assert(BA_STEP_N <= GZ_MAX, \"gz.h: BA_STEP fits the buffer\");",
"#define BA_STEP gz_get(BA_STEP_Z, BA_STEP_N)"]
L += ["_Static_assert(BA_STEP_N <= 8192u, \"gen_tables.c barch_t: at in 13 bits\");"]
L += [f"static const barch_t BASS_ARCH[{asz}] = {{"]
for name, at, bars in rows3:
assert at < 8192 and 0 < bars < 8, (name, at, bars) # (barch_t: at 13 bits, bars 3)
L.append(f" [{name}] = {{{at}, {bars}}},")
L.append("};")
Path(bout).write_text("\n".join(L) + "\n")
size3 = len(steps) + 4 * len(rows3)
size3 = len(steps) + 2 * len(rows3)
print(f"drum maps: {len(table)} maps, {len(ptab)} pools, {len(lanes) - 1} distinct lanes, {size} B; DICE's bars: "
f"{len(btab)}, {len(bl) - 1} distinct lanes, {size2} B; bass archetypes {len(rows3)}, {size3} B -> {out}, {dout}, {bout}")
return 0