Skip to content

Art and animation, written as code. Illustrations, loops, interactive web art, launch-videos and scored films in dozens of styles, identical on every render.

Strengthen measured accompaniment carving and its regression proof

Alex Greenshpun83319b612dc5
diff --git a/skills/anidoodle/engine/src/canvas-core/music/mixProfiles.ts b/skills/anidoodle/engine/src/canvas-core/music/mixProfiles.ts
index 3517326..c634e3c 100644
--- a/skills/anidoodle/engine/src/canvas-core/music/mixProfiles.ts
+++ b/skills/anidoodle/engine/src/canvas-core/music/mixProfiles.ts
@@ -138,7 +138,7 @@ export const recordedEq = (e: StemEq, role: Role, excessDb: number, fractionDb:
if (role !== "bass" && role !== "accomp") return e;
// A reference can itself be bright. Also limit absolute band occupancy toward 6% (-12 dB).
// One broad bell spans the guard's 500 Hz-4 kHz band; the existing makeup stage holds level.
- const depth = Math.min(role === "bass" ? 12 : 6, Math.max(0, excessDb, fractionDb + 12) * (role === "bass" ? 0.8 : 0.6));
+ const depth = Math.min(role === "bass" ? 12 : 6, Math.max(0, excessDb, fractionDb + 12) * 0.8);
return depth > 0 ? { ...e, bells: [...(e.bells ?? []), [1400, 0.45, -depth]] } : e;
};
/** A one-line summary for tools/music.mjs vocab. */
diff --git a/skills/anidoodle/engine/test/recordedMix.test.ts b/skills/anidoodle/engine/test/recordedMix.test.ts
index aa03cff..eb06294 100644
--- a/skills/anidoodle/engine/test/recordedMix.test.ts
+++ b/skills/anidoodle/engine/test/recordedMix.test.ts
@@ -42,6 +42,9 @@ export const run = (ok: (cond: boolean, label: string) => void) => {
ok(lead.every((v, i) => v === unchanged[i]), 'recorded melody keeps every sample when support EQ measurements change');
ok(fraction(bass) < fraction(bassBefore) - 2 && fraction(accomp) < fraction(accompBefore) - 1, 'load-measured recorded bass and accompaniment lose masking-band energy');
ok(Math.abs(20 * Math.log10(rms(bass) / rms(bassBefore))) < 2.5 && Math.abs(20 * Math.log10(rms(accomp) / rms(accompBefore))) < 2.5, 'support EQ retains broadband balance through the existing makeup stage');
+ // Keep this fixture below the EQ cap so a wrong role-only selection is audible.
+ registerBank('marimba', { ...calibrated, trim: calibrated.trim!.map(t => ({ ...t,
+ bandExcessDb: 0, bandFractionDb: t.midi === 48 ? -10 : -6 })) });
const p = piece('accomp', true);
// Include one melody note so the guard has a melody role; keep the complete accompaniment context.
p.parts[0].notes[2].role = 'melody';
diff --git a/work/S7a/film-proof.mjs b/work/S7a/film-proof.mjs
index 1a1abb7..1d32c45 100644
--- a/work/S7a/film-proof.mjs
+++ b/work/S7a/film-proof.mjs
@@ -14,7 +14,7 @@ const fixture = { name: 'S7a-proof-fixture', setup(b) { b.onResolve({ filter: /\
const plugins = [fixture, overlay], md5 = b => createHash('md5').update(b).digest('hex');
const prefix = 'skills/anidoodle/engine/';
const baselineRevision = 'b0be4f708b2dc7f59dc8704f515c16885ae4e5fb';
-const original = new Map(execFileSync('git', ['diff', baselineRevision, '--name-only'], { encoding: 'utf8' }).trim().split('\n').filter(p => p.startsWith(prefix + 'src/') && p.endsWith('.ts')).map(p => [root + p.slice(prefix.length), execFileSync('git', ['show', `${baselineRevision}:${p}`], { encoding: 'utf8' })]));
+const original = new Map(execFileSync('git', ['diff', baselineRevision, '--name-only', '--diff-filter=M'], { encoding: 'utf8' }).trim().split('\n').filter(p => p.startsWith(prefix + 'src/') && p.endsWith('.ts')).map(p => [root + p.slice(prefix.length), execFileSync('git', ['show', `${baselineRevision}:${p}`], { encoding: 'utf8' })]));
const beforeSources = { name: 'S7a-original-sources', setup(b) { b.onLoad({ filter: /\.ts$/ }, a => original.has(a.path) ? { contents: original.get(a.path), loader: 'ts' } : undefined); } };
const env = detect();
assert(env.chosen, 'offline browser must be available');