From a7ee66d76198fadc8627fc039d322424418bba85 Mon Sep 17 00:00:00 2001 From: Givou Date: Sun, 1 Nov 2026 22:38:49 +0100 Subject: [PATCH] Add SoundField room planner, copy channel settings and global mute SoundField (new tab, static/soundfield.js): - top view of the room with stage, speakers placed by dragging and aimed with a handle, type presets, height, coverage, max SPL and DSP output assignment - level map (tops by energy), sub map with phase at a chosen frequency, timing map for delay/fill speakers, audience statistics - suggestions with one-click apply: aiming, main height, delay line, sub centre cluster (power alley), front fills, quick start layout - delays from the speed of sound and temperature, written to the assigned DSP outputs - plan stored by the server (shared, part of the settings backup) Copy channel settings: level/filters/EQ/dynamics/routing to any channels of all connected DSPs. Mute all: mutes every channel of every connected DSP and unmutes only what was open before, also on DSPs that reconnect later; works while the app window is locked. Co-Authored-By: Claude Opus 5.5 --- CLAUDE.md | 9 + README.md | 11 +- server.py | 166 +++++++++++- static/app.js | 78 +++++- static/i18n.js | 86 +++++++ static/index.html | 3 + static/soundfield.js | 602 +++++++++++++++++++++++++++++++++++++++++++ static/style.css | 55 ++++ 8 files changed, 998 insertions(+), 12 deletions(-) create mode 100644 static/soundfield.js diff --git a/CLAUDE.md b/CLAUDE.md index 40fdd98..7d551cd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -36,6 +36,15 @@ pi_writer.py → pi_image.py (cloud-init SD card, installs server.py as a system lowers every output to −50 dB, flushes the queue and only then starts the generator (`0x39`); leaving switches the generator off first, then restores the gains. While `Device.test_active` the server only accepts the test controls (generator, test fader, output mutes) and the UI stays locked in the audio test tab. The state field is `state["test"] = {source, freq}`. +* **SoundField** (`static/soundfield.js`, plan stored by the server as `soundfield` in `config.json`, API + `/api/soundfield`) – room plan in metres (x across, y from the stage wall, aim 0° = into the room). Free-field model: + −6 dB per distance doubling, directivity from the coverage angle (−6 dB at its edges), tops summed by energy, subs + with phase at the chosen frequency. Delays: mains/subs aligned at the reference point, delay/fill speakers at their + target point plus the precedence offset. The canvas is only redrawn while dragging (never rebuilt), the side panels + are rebuilt after a change; the local plan object stays the one being edited (a save does not replace it). +* **Copy settings / mute all** – `App.copy_settings` (`POST /api/copy`, groups level/filters/eq/dynamics/routing) and + `App.set_mute_all` (`POST /api/muteall`; remembers per device which channels were open, persisted in `config.json` + as `mute_all`, released devices that were offline are unmuted when they reconnect; allowed while the app is locked). * **`dsp/preset.py`** – preset files (`dsp-control-preset` JSON with state + raw image), validation, and the minimal command sequence for an import. Undo backups go to `backups/` next to `config.json` (last 20 per device). * **`dsp/usbhid.py`** – HID via ctypes only: Windows `hid.dll`/SetupAPI, macOS IOKit, Linux `/dev/hidraw*`. diff --git a/README.md b/README.md index 70fe056..e4567cd 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,14 @@ Control both devices at the same time from your phone, tablet or computer – ov * **Limiter calculator** – enter your amplifiers' datasheet values (power at 8/4/2 Ω, sensitivity or gain), assign outputs, and see the resulting power when the limiter engages, the clipping headroom and the speaker load. "Limit to … W" calculates the threshold. Attack/release presets per band (infra, sub, kick, mid, high) -* **Settings backup** – devices, amplifier data, PIN and remote access in one file +* **SoundField** – top view of the room: place mains, subs, delays and fills by dragging, see a level map, a sub + map at a chosen frequency (phase-correct, shows cancellation lanes) and a timing map for delay speakers. It + suggests aiming, height, delay lines, sub placement and front fills (one click to apply), calculates the delays + from the speed of sound and writes them to the assigned DSP outputs +* **Copy channel settings** – level/delay/polarity, filters, EQ, dynamics and routing from one channel to any number + of channels on all connected DSPs +* **Mute all** – one button mutes every channel of every connected DSP; releasing it unmutes only what was open before +* **Settings backup** – devices, amplifier data, SoundField plan, PIN and remote access in one file * **Device lock** – DSPs locked with their 4-character code (e.g. `A1BA`) are detected on connect and the app asks for the code; optionally it remembers the code and unlocks automatically. A new code can be set under ⚙ * **Audio test** – switch the DSP's test generator (pink noise, white noise, sine 20 Hz–20 kHz) on and off. All @@ -160,7 +167,7 @@ python tests/test_protocol.py | `sim.py` | Simulated DSP 204/408 | | `desktop.py` | Desktop app (Windows/macOS): server + own window (pywebview) | | `pi_writer.py`, `pi_image.py`, `win_disk.py` | Raspberry Pi SD card writer: GUI, OS image + cloud-init, raw disk writes | -| `static/` | Web UI (`app.js`, `style.css`, `index.html`), translations in `static/i18n.js` | +| `static/` | Web UI (`app.js`, `style.css`, `index.html`), SoundField in `static/soundfield.js`, translations in `static/i18n.js` | | `packaging/` | Build script and icons | | `tests/` | Protocol tests | | `PROTOCOL.md` | Protocol documentation | diff --git a/server.py b/server.py index 7f4e876..928204d 100644 --- a/server.py +++ b/server.py @@ -7,6 +7,7 @@ Then open http://:8080 on your phone. import argparse import asyncio import base64 +import copy import errno import hashlib import json @@ -89,6 +90,42 @@ def clean_limiter(data: dict) -> dict: return {"amps": amps, "assign": assign, "ref": ref} +SF_ROLES = ("main", "sub", "delay", "fill") + + +def clean_soundfield(data) -> dict: + """SoundField room plan: room, stage, reference position and speakers (positions in metres).""" + data = data if isinstance(data, dict) else {} + room = data.get("room") if isinstance(data.get("room"), dict) else {} + w, d = _num(room.get("w"), 4, 200, 20), _num(room.get("d"), 4, 300, 30) + stage = data.get("stage") if isinstance(data.get("stage"), dict) else {} + ref = data.get("ref") if isinstance(data.get("ref"), dict) else {} + speakers = [] + for s in (data.get("speakers") or [])[:48]: + if not isinstance(s, dict): + continue + sid = re.sub(r"[^\w-]", "", str(s.get("id") or ""))[:16] or uuid.uuid4().hex[:8] + speakers.append({ + "id": sid, "name": str(s.get("name") or "Speaker")[:24], + "role": s.get("role") if s.get("role") in SF_ROLES else "main", + "type": re.sub(r"[^\w-]", "", str(s.get("type") or "custom"))[:16], + "x": _num(s.get("x"), 0, w, w / 2), "y": _num(s.get("y"), 0, d, 1), "h": _num(s.get("h"), 0, 30, 2), + "aim": _num(s.get("aim"), -180, 180, 0), "cov": _num(s.get("cov"), 20, 360, 90), + "spl": _num(s.get("spl"), 80, 160, 128), + "tx": _num(s.get("tx"), 0, w, w / 2), "ty": _num(s.get("ty"), 0, d, d / 2), + "outs": [o for o in (s.get("outs") or [])[:8] if re.fullmatch(r"[\w-]+:\d{1,2}", str(o))], + }) + return { + "room": {"w": w, "d": d}, + "stage": {"w": _num(stage.get("w"), 0, w, min(8, w)), "d": _num(stage.get("d"), 0, d / 2, 4)}, + "temp": _num(data.get("temp"), -10, 45, 20), + "precedence": _num(data.get("precedence"), 0, 30, 5), + "ear": _num(data.get("ear"), 0.5, 3, 1.7), + "ref": {"x": _num(ref.get("x"), 0, w, w / 2), "y": _num(ref.get("y"), 0, d, d * 0.6)}, + "speakers": speakers, + } + + def clean_gains(v) -> list[int] | None: """Saved output gains of an interrupted audio test (from config.json).""" if not isinstance(v, list) or not v or len(v) > 8: @@ -114,6 +151,7 @@ class App: self.sessions: dict[str, float] = {} # token hash -> expiry self.failures: dict[str, tuple[int, float]] = {} # ip -> (failed attempts, locked until) self.limiter: dict = clean_limiter({}) + self.soundfield: dict = clean_soundfield({}) # desktop app: its own window logs in with a one-time token, other devices need the PIN self.app_token: str | None = None self.app_sessions: set[str] = set() @@ -127,6 +165,8 @@ class App: self.demo = {"enabled": False, "model": "408"} self.demo_server: asyncio.Server | None = None self.demo_resume: set[str] = set() # real devices to reconnect when the demo ends + # global mute: per device the channels that were open before, unmuted again on release + self.mute_all = {"active": False, "restore": {}} # ------------------------------------------------------------ config @@ -142,6 +182,10 @@ class App: self.sessions = {k: v for k, v in cfg.get("sessions", {}).items() if v > now} self.locked = bool(cfg.get("locked")) self.lang = cfg.get("lang") if cfg.get("lang") in ("en", "de") else "" + m = cfg.get("mute_all") or {} + self.mute_all = {"active": bool(m.get("active")), "restore": { + str(k): [[c[0], int(c[1])] for c in v if isinstance(c, list) and len(c) == 2 and c[0] in ("in", "out")] + for k, v in (m.get("restore") or {}).items() if isinstance(v, list)}} self.apply_config(cfg) def apply_config(self, cfg: dict): @@ -152,6 +196,8 @@ class App: elif not self.auth: # first start (a backup without PIN keeps the current one) self.set_pin(DEFAULT_PIN, save=False) self.limiter = clean_limiter(cfg.get("limiter") or {}) + if "soundfield" in cfg: + self.soundfield = clean_soundfield(cfg.get("soundfield")) r = cfg.get("remote") or {} self.remote = {"enabled": bool(r.get("enabled")), "port": int(_num(r.get("port"), 1, 65535, 8080))} for d in cfg.get("devices", [])[:20]: @@ -165,7 +211,7 @@ class App: """App backup: devices, PIN (hashed), amplifiers/limiter data, remote access - no logins.""" return {"format": CONFIG_FORMAT, "version": 1, "exported": time.strftime("%Y-%m-%dT%H:%M:%S"), "devices": [d.config() for d in self.real_devices()], "auth": self.auth, - "limiter": self.limiter, "remote": self.remote} + "limiter": self.limiter, "remote": self.remote, "soundfield": self.soundfield} async def restore_config(self, doc: dict, session: str): if not isinstance(doc, dict) or doc.get("format") != CONFIG_FORMAT: @@ -182,6 +228,7 @@ class App: for dev in self.devices.values(): self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()}) self.broadcast({"type": "limiter", "data": self.limiter}) + self.broadcast({"type": "soundfield", "data": self.soundfield}) if self.app_token: # desktop app: (re)start or stop the LAN listener as restored await self.start_remote() @@ -220,7 +267,10 @@ class App: def save(self): sessions = {k: v for k, v in self.sessions.items() if k not in self.app_sessions} cfg = {"devices": [d.config() for d in self.real_devices()], "auth": self.auth, - "sessions": sessions, "limiter": self.limiter, "remote": self.remote, "locked": self.locked} + "sessions": sessions, "limiter": self.limiter, "remote": self.remote, "locked": self.locked, + "soundfield": self.soundfield, + "mute_all": {"active": self.mute_all["active"], + "restore": {k: v for k, v in self.mute_all["restore"].items() if k != "demo"}}} if self.lang: cfg["lang"] = self.lang self.config_path.write_text(json.dumps(cfg, indent=2), encoding="utf-8") @@ -234,7 +284,7 @@ class App: transport="usb" if usb else "tcp", usb=str(d.get("usb") or ""), lock_code=str(d.get("lock_code") or ""), auto_unlock=bool(d.get("auto_unlock")), test_saved=clean_gains(d.get("test_saved"))) - dev.on_online = self.check_audio_test + dev.on_online = self.device_online self.devices[dev_id] = dev if dev.autoconnect: if self.demo["enabled"]: @@ -280,6 +330,97 @@ class App: self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()}) return {"ok": True} + async def device_online(self, dev: Device): + await self.check_audio_test(dev) + if not self.mute_all["active"] and self.mute_all["restore"].get(dev.id): + self.unmute_device(dev) # released while this DSP was offline + self.save() + + # ------------------------------------------------------------ global mute + + def mute_all_info(self) -> dict: + return {"active": self.mute_all["active"]} + + def unmute_device(self, dev: Device): + for kind, i in self.mute_all["restore"].pop(dev.id, []): + chans = dev.state["inputs" if kind == "in" else "outputs"] + if i < len(chans) and chans[i]["mute"]: + dev.set_param(kind, i, "mute", False) + + def set_mute_all(self, mute: bool) -> dict: + """Mute every channel of every connected DSP; releasing unmutes only what was open before.""" + online = [d for d in self.devices.values() if d.status == "online" and d.state] + if mute and not self.mute_all["active"]: + self.mute_all["restore"] = {} + for dev in online: + opened = [[kind, i] for kind, key in (("in", "inputs"), ("out", "outputs")) + for i, ch in enumerate(dev.state[key]) if not ch["mute"]] + for kind, i in opened: + dev.set_param(kind, i, "mute", True) + self.mute_all["restore"][dev.id] = opened + self.mute_all["active"] = True + elif not mute and self.mute_all["active"]: + self.mute_all["active"] = False + for dev in online: + self.unmute_device(dev) # offline ones follow when they connect again + self.save() + self.broadcast({"type": "muteall", "data": self.mute_all_info()}) + return self.mute_all_info() + + # ------------------------------------------------------------ copy channel settings + + def copy_settings(self, body: dict) -> dict: + """Copy groups of settings from one channel to channels of the same kind (any connected DSP).""" + src = self.devices.get(str(body.get("device"))) + kind = "in" if body.get("kind") == "in" else "out" + key = "inputs" if kind == "in" else "outputs" + if not src or not src.state: + raise RuntimeError("DSP is not connected") + sch = src.state[key][int(body.get("idx", 0))] + groups = set(body.get("groups") or []) + changed = 0 + for t in body.get("targets") or []: + dev = self.devices.get(str(t.get("device"))) + if not dev or dev.status != "online" or not dev.state: + continue + if dev.test_active: + raise RuntimeError("Audio test is on – switch it off first") + idx = int(t.get("idx", -1)) + if not 0 <= idx < len(dev.state[key]) or (dev is src and idx == int(body.get("idx", 0))): + continue + tch = dev.state[key][idx] + params = [] + if "level" in groups: + params += ["gain", "delay", "polarity"] + if "filters" in groups: + params += ["hp", "lp"] + if "eq" in groups: + params += ["peq_bypass"] + [f"peq.{b}" for b in range(min(len(sch["peq"]), len(tch["peq"])))] + if kind == "in": + params += ["geq_bypass"] + [f"geq.{b}" for b in range(31)] + if "dynamics" in groups: + params += ["gate"] if kind == "in" else ["comp", "limit"] + if "routing" in groups and kind == "out": + params += [f"mix.{k}" for k in range(min(len(sch["mix"]), len(tch["mix"])))] + for p in params: + v = copy.deepcopy(self._get(sch, p)) + if self._get(tch, p) != v: + dev.set_param(kind, idx, p, v) + changed += 1 + if "routing" in groups and kind == "out": + m = sch["matrix"] & ((1 << len(tch["mix"])) - 1) + if tch["matrix"] != m: + dev.set_param(kind, idx, "matrix", m) + changed += 1 + return {"ok": True, "changed": changed} + + @staticmethod + def _get(ch: dict, path: str): + node = ch + for k in path.split("."): + node = node[int(k)] if isinstance(node, list) else node[k] + return node + async def check_audio_test(self, dev: Device): """On connect: a DSP still playing a test signal goes straight into the audio test (outputs lowered); one back on its analog inputs gets the faders saved by an interrupted test back.""" @@ -331,7 +472,7 @@ class App: port = self.demo_server.sockets[0].getsockname()[1] dev = Device("demo", f"Demo DSP {model}", "127.0.0.1", port, model, autoconnect=False, on_event=self.broadcast) dev.demo = True - dev.on_online = self.check_audio_test + dev.on_online = self.device_online self.devices[dev.id] = dev self.demo["enabled"] = True self.broadcast({"type": "device", "device": dev.id, "data": dev.snapshot()}) @@ -436,7 +577,7 @@ class App: @staticmethod def allowed_while_locked(method: str, path: str) -> bool: """What the locked app window may still do: look at everything, export presets.""" - if path in ("/api/unlock", "/api/events", "/api/lang"): + if path in ("/api/unlock", "/api/events", "/api/lang", "/api/muteall"): return True if method == "GET": return path != "/api/backup" # holds the PIN hash @@ -505,6 +646,19 @@ class App: return [d.snapshot() for d in self.devices.values()] if path == "/api/devices" and method == "POST": return self.add_device(body).snapshot() + if path == "/api/soundfield" and method == "PUT": + self.soundfield = clean_soundfield(body) + self.save() + self.broadcast({"type": "soundfield", "data": self.soundfield}) + return self.soundfield + if path == "/api/soundfield": + return self.soundfield + if path == "/api/muteall" and method == "POST": + return self.set_mute_all(bool(body.get("mute"))) + if path == "/api/muteall": + return self.mute_all_info() + if path == "/api/copy" and method == "POST": + return self.copy_settings(body) if path == "/api/demo": return await self.set_demo(body) if method == "PUT" else self.demo_info() if path == "/api/usb" and method == "GET": @@ -773,7 +927,7 @@ class App: self.clients.add(q) try: hello = {"type": "hello", "devices": [d.snapshot() for d in self.devices.values()], "limiter": self.limiter, - "demo": self.demo_info()} + "demo": self.demo_info(), "muteall": self.mute_all_info(), "soundfield": self.soundfield} writer.write(f"data: {json.dumps(hello)}\n\n".encode()) await writer.drain() while True: diff --git a/static/app.js b/static/app.js index a19cbf8..7140f51 100644 --- a/static/app.js +++ b/static/app.js @@ -61,6 +61,7 @@ const S = { routeOpen: null, es: null, linkSel: { in: [], out: [] }, lim: { amps: [], assign: {}, ref: {} }, demo: { enabled: false, model: "408" }, + muteAll: false, }; const $ = sel => document.querySelector(sel); const main = $("#main"); @@ -85,6 +86,7 @@ const ICON = { back: '', lock: '', unlock: '', + muteall: '', link: '', }; @@ -1107,7 +1109,8 @@ function viewChannel(d) { const redrawPeq = () => { const c = main.querySelector("canvas.curve"); c && drawCurve(c, chans(dev(), k)[i], S.band); }; const li = linkInfo(d, k, i); - const basics = h("div", { class: "card" }, h("h3", {}, t("Channel")), + const basics = h("div", { class: "card" }, h("h3", {}, h("span", { class: "grow" }, t("Channel")), + h("button", { class: "small", onclick: () => copyDialog(d, k, i) }, t("Copy to…"))), li ? h("p", { class: "info linknote", style: `--lc:${li.color}` }, svgIcon(ICON.link), " " + t(k === "out" ? "Linked with {list} – changes apply to all of them (except name, routing and mix levels)." : "Linked with {list} – changes apply to all of them (except the name).", { list: li.group.filter(j => j !== i).map(j => chLabel(k, j)).join(", ") })) : null, @@ -1532,6 +1535,64 @@ function viewLimiter(d) { ]; } +// ------------------------------------------------------------------ copy channel settings + +const COPY_GROUPS = kind => [["level", t("Gain, delay, polarity")], ["filters", t("High / low pass")], + ["eq", kind === "in" ? t("PEQ + GEQ") : "PEQ"], ["dynamics", kind === "in" ? "Noise gate" : t("Compressor + limiter")], + ...(kind === "out" ? [["routing", t("Routing + mix levels")]] : [])]; + +async function copyDialog(d, kind, idx) { + const groups = new Set(store.get("dsp.copygroups." + kind)?.split(",").filter(Boolean) || ["eq", "filters", "dynamics"]); + const targets = new Set(); + const groupBoxes = COPY_GROUPS(kind).map(([g, label]) => { + const cb = h("input", { type: "checkbox", checked: groups.has(g), onchange: () => cb.checked ? groups.add(g) : groups.delete(g) }); + return h("label", { class: "chk" }, cb, label); + }); + const devs = S.order.map(id => S.devices[id]).filter(x => x.status === "online" && x.state); + const targetRows = devs.map(x => { + const chips = chans(x, kind).map((_, j) => { + if (x.id === d.id && j === idx) return null; + const key = `${x.id}|${j}`; + const b = h("button", { class: "chip", "aria-pressed": "false", + onclick: () => { const on = !targets.has(key); on ? targets.add(key) : targets.delete(key); b.classList.toggle("on", on); b.setAttribute("aria-pressed", String(on)); } }, + chLabel(kind, j) + (chans(x, kind)[j].name ? " · " + chans(x, kind)[j].name : "")); + return b; + }).filter(Boolean); + return h("div", { class: "copydev" }, devs.length > 1 ? h("div", { class: "sub" }, x.name) : null, h("div", { class: "chips" }, chips)); + }); + const res = await modal({ + title: t("Copy {ch} to…", { ch: chTitle(d, kind, idx) }), + body: h("div", { class: "copydlg" }, h("div", { class: "sub" }, t("What")), h("div", { class: "copygroups" }, groupBoxes), + h("div", { class: "sub" }, t("To")), targetRows, + h("p", { class: "info" }, t("The name stays. Linked target channels take the values for their whole group."))), + actions: [{ label: t("Cancel") }, { label: t("Copy"), primary: true, value: () => (groups.size && targets.size ? true : undefined) }], + }); + if (!res) return; + store.set("dsp.copygroups." + kind, [...groups].join(",")); + try { + const r = await api("POST", "/api/copy", { device: d.id, kind, idx, groups: [...groups], + targets: [...targets].map(k => { const [device, j] = k.split("|"); return { device, idx: +j }; }) }); + toast(r.changed ? t("{n} values copied", { n: r.changed }) : t("Nothing to change – the settings are already the same")); + } catch (e) { toast(t("Error: ") + trMsg(e.message)); } +} + +// ------------------------------------------------------------------ global mute (all channels of all connected DSPs) + +function showMuteAll() { + const b = $("#btn-muteall"); + b.classList.toggle("on", !!S.muteAll); + b.title = S.muteAll ? t("All muted – click to unmute what was open before") : t("Mute all channels of all connected DSPs"); + b.setAttribute("aria-label", b.title); + b.replaceChildren(...[svgIcon(ICON.muteall), S.muteAll ? h("span", {}, t("MUTED")) : null].filter(Boolean)); +} +$("#btn-muteall").addEventListener("click", async () => { + try { + const r = await api("POST", "/api/muteall", { mute: !S.muteAll }); + S.muteAll = r.active; showMuteAll(); + toast(r.active ? t("All channels muted") : t("Unmuted – channels that were muted before stay muted")); + } catch (e) { toast(t("Error: ") + trMsg(e.message)); } +}); + // ------------------------------------------------------------------ audio test (test generator of the DSP) const testOn = d => !!(d && d.state && d.state.test && d.state.test.source); @@ -1807,8 +1868,10 @@ function render() { live.clear(); let content; const d = dev(); - document.body.dataset.view = S.settings || !d ? "settings" : S.view; - if (S.settings || !d) content = viewSettings(); + const field = !S.settings && S.view === "soundfield"; // the room plan works without a connected DSP + document.body.dataset.view = field ? "soundfield" : S.settings || !d ? "settings" : S.view; + if (field) content = viewSoundField(); + else if (S.settings || !d) content = viewSettings(); else if (d.status !== "online" || !d.state) content = h("div", { class: "empty" }, h("div", { class: "spinner" + (["loading", "connecting"].includes(d.status) ? "" : " off") }), d.status === "loading" ? t("Loading the configuration from the DSP…") @@ -1875,7 +1938,7 @@ $("#btn-lock").addEventListener("click", async () => { }); // While locked, everything that would change a value is swallowed; navigating and looking still works. -const VIEW_OK = ".chsel, .nav, .strip-head, .xout, .band, [data-view-ok]"; +const VIEW_OK = ".chsel, .nav, .strip-head, .xout, .band, #btn-muteall, [data-view-ok]"; for (const type of ["pointerdown", "mousedown", "click", "dblclick", "keydown", "wheel"]) { document.addEventListener(type, e => { if (!S.locked || !(e.target instanceof Element)) return; @@ -1906,6 +1969,8 @@ function connectEvents() { setDevices(ev.devices); if (ev.limiter) S.lim = ev.limiter; if (ev.demo) S.demo = ev.demo; + if (ev.muteall) { S.muteAll = ev.muteall.active; showMuteAll(); } + if (ev.soundfield) S.sf = ev.soundfield; if (S.demo.enabled && S.devices.demo && !S.devices[S.cur]?.demo) S.cur = "demo"; S.order.forEach(id => maybeAskUnlock(S.devices[id])); if (!S.order.length) S.settings = true; @@ -1933,6 +1998,10 @@ function connectEvents() { maybeAskUnlock(d); break; } + case "soundfield": + sfOnRemote(ev.data); break; + case "muteall": + S.muteAll = ev.data.active; showMuteAll(); break; case "demo": S.demo = ev.data; if (!S.demo.enabled && S.cur === "demo") S.cur = S.order.find(id => id !== "demo") || null; @@ -2042,6 +2111,7 @@ async function startApp() { } S.locked = !!a.locked; showLock(); + showMuteAll(); if (S.isApp) S.remote = await api("GET", "/api/remote"); } catch { /* plain web UI */ } connectEvents(); diff --git a/static/i18n.js b/static/i18n.js index 39dfa31..9afc6f1 100644 --- a/static/i18n.js +++ b/static/i18n.js @@ -345,6 +345,92 @@ const DE = { "Phase": "Phase", "The rest of the app is locked until the analog input is selected again.": "Der Rest der App ist gesperrt, bis wieder der Analog-Eingang gewählt ist.", "Phase inverted": "Phase invertiert", + // copy settings, global mute + "Copy to…": "Kopieren nach…", + "Gain, delay, polarity": "Gain, Delay, Phase", + "High / low pass": "Hoch- / Tiefpass", + "PEQ + GEQ": "PEQ + GEQ", + "Compressor + limiter": "Kompressor + Limiter", + "Routing + mix levels": "Routing + Mix-Pegel", + "Copy {ch} to…": "{ch} kopieren nach…", + "What": "Was", + "To": "Wohin", + "Copy": "Kopieren", + "The name stays. Linked target channels take the values for their whole group.": "Der Name bleibt. Verknüpfte Zielkanäle übernehmen die Werte für ihre ganze Gruppe.", + "{n} values copied": "{n} Werte kopiert", + "Nothing to change – the settings are already the same": "Nichts zu ändern – die Einstellungen sind schon gleich", + "All muted – click to unmute what was open before": "Alles stumm – klicken gibt frei, was vorher offen war", + "Mute all channels of all connected DSPs": "Alle Kanäle aller verbundenen DSPs stummschalten", + "MUTED": "STUMM", + "All channels muted": "Alle Kanäle stumm", + "Unmuted – channels that were muted before stay muted": "Freigegeben – vorher stumme Kanäle bleiben stumm", + // SoundField + ">30 ms echo": ">30 ms Echo", + "A planning aid: free field without reflections, coverage from the nominal angle. Check the result by ear or measurement.": "Eine Planungshilfe: Freifeld ohne Reflexionen, Abdeckung aus dem Nennwinkel. Das Ergebnis mit dem Ohr oder einer Messung prüfen.", + "Add delay line": "Delay-Linie hinzufügen", + "Add front fills": "Front-Fills hinzufügen", + "Add speakers to calculate delays.": "Lautsprecher hinzufügen, um Delays zu berechnen.", + "Aim": "Ausrichten", + "Aim (°)": "Ausrichtung (°)", + "Aim the mains at ⅔ of the room depth on the centre line ({list}).": "Die Mains auf ⅔ der Raumtiefe in der Mitte ausrichten ({list}).", + "Apply all": "Alle übernehmen", + "Centre cluster": "Mittig bündeln", + "Column": "Säule", + "Coverage (°)": "Abstrahlwinkel (°)", + "Custom": "Eigener", + "DSP outputs": "DSP-Ausgänge", + "Delay": "Delay", + "Delays": "Delays", + "Depth (m)": "Tiefe (m)", + "Distance": "Abstand", + "Ear height (m)": "Ohrhöhe (m)", + "Fill 8″": "Fill 8″", + "Height (m)": "Höhe (m)", + "Its delay is aligned at the dashed target point (drag it to the middle of the area this speaker covers).": "Sein Delay wird am gestrichelten Zielpunkt ausgerichtet (in die Mitte des Bereichs ziehen, den dieser Lautsprecher beschallt).", + "Level in the audience area: {spread} dB spread, {pct} % within ±3 dB of the median.": "Pegel im Publikumsbereich: {spread} dB Streuung, {pct} % innerhalb ±3 dB vom Mittelwert.", + "Main": "Main", + "Main L": "Main L", + "Main R": "Main R", + "Mains and subs are aligned at the reference position, delay and fill speakers at their target point plus {ms} ms so the mains are heard first.": "Mains und Subs werden an der Referenzposition ausgerichtet, Delay- und Fill-Lautsprecher an ihrem Zielpunkt plus {ms} ms, damit man die Mains zuerst hört.", + "Max SPL @1 m (dB)": "Max. SPL @1 m (dB)", + "No DSP in the device list yet.": "Noch kein DSP in der Geräteliste.", + "Nothing to improve with the current layout.": "Mit dem aktuellen Aufbau gibt es nichts zu verbessern.", + "Now on DSP": "Jetzt im DSP", + "Offset (ms)": "Versatz (ms)", + "Quick start": "Schnellstart", + "REF": "REF", + "Raise": "Anheben", + "Raise the mains to {h} m: front-to-back difference {a} dB → {b} dB.": "Mains auf {h} m anheben: Unterschied vorne/hinten {a} dB → {b} dB.", + "Role": "Rolle", + "Room": "Raum", + "Room plan": "Raumplan", + "STAGE": "BÜHNE", + "Select a speaker in the plan, or add one above. Drag to move, use the white handle to aim, drag the reference cross to your listening / mixing position.": "Einen Lautsprecher im Plan wählen oder oben hinzufügen. Ziehen zum Verschieben, mit dem weißen Griff ausrichten, das Referenzkreuz an deine Hör- bzw. Mischposition ziehen.", + "Speaker": "Lautsprecher", + "Speed of sound at {t} °C: {c} m/s.": "Schallgeschwindigkeit bei {t} °C: {c} m/s.", + "Stage depth (m)": "Bühnentiefe (m)", + "Stage width (m)": "Bühnenbreite (m)", + "Start with a stereo pair at the front edge of the stage and a sub in the centre.": "Mit einem Stereo-Paar an der Bühnenkante und einem Sub in der Mitte beginnen.", + "Sub 18″": "Sub 18″", + "Sub 2×18″": "Sub 2×18″", + "Sub frequency": "Sub-Frequenz", + "Suggestions": "Vorschläge", + "Temperature (°C)": "Temperatur (°C)", + "The back of the room is {db} dB quieter than the front third. A delay line with {n} speaker(s) at about {y} m keeps it even.": "Hinten ist es {db} dB leiser als im vorderen Drittel. Eine Delay-Linie mit {n} Lautsprecher(n) bei etwa {y} m gleicht das aus.", + "The first rows in the centre get {db} dB less than the middle of the room – front fills at the stage edge help.": "Die ersten Reihen in der Mitte bekommen {db} dB weniger als die Raummitte – Front-Fills an der Bühnenkante helfen.", + "The subs are {m} m apart – at 80 Hz that causes cancellation lanes through the room (power alley). A centre cluster sounds even everywhere.": "Die Subs stehen {m} m auseinander – bei 80 Hz entstehen dadurch Auslöschungs-Gassen durch den Raum (Power Alley). Mittig gebündelt klingt es überall gleichmäßig.", + "Timing": "Timing", + "Timing: in {a} % of the area a delay/fill arrives before the mains, in {b} % more than 30 ms late. Check positions and apply the calculated delays.": "Timing: In {a} % der Fläche kommt ein Delay/Fill vor den Mains an, in {b} % mehr als 30 ms zu spät. Positionen prüfen und die berechneten Delays übernehmen.", + "Top 12″": "Top 12″", + "Top 15″": "Top 15″", + "Width (m)": "Breite (m)", + "audience: {spread} dB spread · {pct} % within ±3 dB": "Publikum: {spread} dB Streuung · {pct} % innerhalb ±3 dB", + "delay too early": "Delay zu früh", + "median": "Median", + "no output": "kein Ausgang", + "{m} m to the nearest main": "{m} m zum nächsten Main", + "{n} output delay(s) set": "{n} Ausgangs-Delay(s) gesetzt", + "{n} output(s) not connected": "{n} Ausgang/Ausgänge nicht verbunden", }; const DE_PATTERNS = [ diff --git a/static/index.html b/static/index.html index 00411ec..1d4d77e 100644 --- a/static/index.html +++ b/static/index.html @@ -25,8 +25,10 @@ + +