Point to 'Ref SF2…' when no reference SoundFont is available
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 changed file+1−1
src/app/main.tsmodified+1−1View file
@@ -489,7 +489,7 @@ async function analyse() {
489489 if (!last || (ui.tab !== "sound" && ui.tab !== "spectro" && ui.tab !== "partials")) return;
490490 const fs = last.fs, x = simAudio();
491491 let ref: Float32Array | null = null;
492- try { ref = await refAudio(last.note, last.velocity); } catch { ref = null; }
492+ try { ref = await refAudio(last.note, last.velocity); } catch { ref = null; if (!refData) status("Rendered. For the A/B comparison, choose a reference SoundFont with 'Ref SF2…' (e.g. GeneralUser GS)."); }
493493 const sim = cssv(C_SIM), refc = cssv(C_REF);
494494 const onset = (a: Float32Array) => { let pk = 0; for (const v of a) pk = Math.max(pk, Math.abs(v)); let s = 0; while (s < a.length && Math.abs(a[s]) < 0.02 * pk) s++; return a.subarray(Math.max(0, s - 88)); };
495495 const xs = onset(x), rs = ref ? onset(ref) : null;