fix: final-review findings (median pass tick, R11 secondary metrics, R12 chord duration, render version, dsp resample)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
Lucas Winther
2026-10-30 05:55:04 +01:00
co-authored by Claude Sonnet 5.5
parent 2b7d5ffbeb
commit b631bd2c7e
16 changed files with 199 additions and 48 deletions
+9 -1
View File
@@ -15,11 +15,19 @@ test("drops notes before the first downbeat", () => {
expect(q.map((n) => n.pitch)).toEqual([62]);
});
test("merges chord notes within 35 ms, with one consistent duration", () => {
test("merges chord notes within 35 ms, with one consistent (median) duration", () => {
// snapped durations: 8, 4, 8 steps -> median 8
const q = quantize([t(0.6, 1.6, 60), t(0.625, 1.1, 64), t(0.63, 1.6, 67)], g);
expect(new Set(q.map((n) => n.tick)).size).toBe(1);
expect(new Set(q.map((n) => n.dur)).size).toBe(1);
expect(q).toHaveLength(3);
expect(q[0]!.dur).toBe(8 * 240);
});
test("one 70 ms ghost note does not collapse a long chord (median duration)", () => {
const q = quantize([t(0.5, 2.5, 60), t(0.5, 2.5, 64), t(0.5, 0.57, 67)], g);
expect(q).toHaveLength(3);
for (const n of q) expect(n.dur).toBe(16 * 240);
});
test("collapses exact duplicates, enforces min duration", () => {