From e4b5cf688762cd0722e4940ad4876abf419543ce Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Wed, 24 Jun 2026 16:22:50 +0200 Subject: [PATCH] Rename serializeFm to serializeModulation --- static/exporter.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/static/exporter.js b/static/exporter.js index 9940bd5..734d6b8 100644 --- a/static/exporter.js +++ b/static/exporter.js @@ -23,7 +23,7 @@ function serializeShape(shape) { // ── FM / AM modulation ───────────────────────────────────────────────────── // RFC §3.2.1.1.6-7: FM = FREQUENCY ["f"/"F"] ["@" OSC] ["[" SHAPE "]"] ";" MOD ":" BASE -function serializeFm(fm) { +function serializeModulation(fm) { let s = String(fm.frequency ?? ''); if (fm.factor) s += fm.factor; if (fm.osc) s += `@${fm.osc}`; @@ -46,8 +46,8 @@ function basicPropLines(bp) { if (s) lines.push(`S: "${s}"`); const r = serializeShape(bp.R); if (r) lines.push(`R: "${r}"`); - for (const fm of (bp.fmModulations ?? [])) lines.push(`FM: "${serializeFm(fm)}"`); - for (const am of (bp.amModulations ?? [])) lines.push(`AM: "${serializeFm(am)}"`); + for (const fm of (bp.fmModulations ?? [])) lines.push(`FM: "${serializeModulation(fm)}"`); + for (const am of (bp.amModulations ?? [])) lines.push(`AM: "${serializeModulation(am)}"`); return lines; } @@ -76,8 +76,8 @@ function variationLines(v) { if (vol) lines.push(`VOLUMES: "${vol}"`); const timbre = serializeShape(v.timbre); if (timbre) lines.push(`TIMBRE: "${timbre}"`); - for (const fm of (v.fmModulations ?? [])) lines.push(`FM: "${serializeFm(fm)}"`); - for (const am of (v.amModulations ?? [])) lines.push(`AM: "${serializeFm(am)}"`); + for (const fm of (v.fmModulations ?? [])) lines.push(`FM: "${serializeModulation(fm)}"`); + for (const am of (v.amModulations ?? [])) lines.push(`AM: "${serializeModulation(am)}"`); for (const sv of (v.subvariations ?? [])) lines.push(...variationLines(sv)); return lines; }