Add BetterDSPControl: web UI, desktop app and Pi writer for t.racks DSP 204/408

- Python stdlib server with SSE live updates, PIN login, remote access
- Vanilla JS web UI (English/German): mixer, channel, routing, links, limiter calculator
- Preset file export/import with undo, settings backup, lock for the desktop app
- Network (TCP 9761) and USB HID transport (Windows, macOS, Linux)
- Desktop app via pywebview, Raspberry Pi SD card writer, simulator and protocol tests
- README with import guide for Claude Code, CLAUDE.md, protocol documentation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-01 20:24:33 +01:00
1 parent ce02ae65a9
commit fe13f261f7
31 files changed
+6445

No files matched your search

+63
View File
@@ -0,0 +1,63 @@
"""Builds the desktop programs into dist/:
python -m pip install pyinstaller pywebview pillow
python packaging/build.py
Windows:
dist/DSP Control.exe desktop app (own window, no PIN; optional remote access with PIN)
dist/DSP Control Pi Writer.exe SD card writer for a Raspberry Pi running the WebUI
macOS:
dist/DSP Control.app the same desktop app
dist/DSP Control.dmg disk image with the app and a link to /Applications
"""
import shutil
import subprocess
import sys
import tempfile
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
SEP = ";" if sys.platform == "win32" else ":"
def pyinstaller(*args, onefile=True):
cmd = [sys.executable, "-m", "PyInstaller", "--noconfirm", "--onefile" if onefile else "--onedir", "--windowed",
"--distpath", str(ROOT / "dist"), "--workpath", str(ROOT / "build"), "--specpath", str(ROOT / "build"), *args]
print(">", " ".join(cmd))
subprocess.run(cmd, cwd=ROOT, check=True)
def data(src, dest="."):
return ["--add-data", f"{ROOT / src}{SEP}{dest}"]
def build_mac():
app = ROOT / "dist" / "DSP Control.app"
pyinstaller("--name", "DSP Control", "--icon", str(ROOT / "packaging" / "dsp-control.icns"),
"--osx-bundle-identifier", "at.thiemoo.dspcontrol", *data("static", "static"),
str(ROOT / "desktop.py"), onefile=False) # a .app bundle is always a folder
shutil.rmtree(ROOT / "dist" / "DSP Control", ignore_errors=True) # the loose onedir copy next to the .app
dmg = ROOT / "dist" / "DSP Control.dmg"
dmg.unlink(missing_ok=True)
with tempfile.TemporaryDirectory() as tmp:
shutil.copytree(app, Path(tmp) / app.name, symlinks=True)
(Path(tmp) / "Applications").symlink_to("/Applications")
subprocess.run(["hdiutil", "create", "-volname", "DSP Control", "-srcfolder", tmp, "-ov",
"-format", "UDZO", str(dmg)], check=True)
print("\nDone:", app.name, dmg.name, sep="\n ")
subprocess.run([sys.executable, str(ROOT / "packaging" / "make_icons.py")], check=True)
if sys.platform == "darwin":
build_mac()
sys.exit()
pyinstaller("--name", "DSP Control", "--icon", str(ROOT / "packaging" / "dsp-control.ico"),
*data("static", "static"), str(ROOT / "desktop.py"))
pyinstaller("--name", "DSP Control Pi Writer", "--icon", str(ROOT / "packaging" / "pi-writer.ico"), "--uac-admin",
*data("server.py"), *data("dsp", "dsp"), *data("static", "static"), str(ROOT / "pi_writer.py"))
print("\nDone:", *(p.name for p in (ROOT / "dist").glob("*.exe")), sep="\n ")
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

+53
View File
@@ -0,0 +1,53 @@
"""Draws the two app icons (.ico, .icns) with Pillow: python packaging/make_icons.py"""
import sys
from pathlib import Path
from PIL import Image, ImageDraw
HERE = Path(__file__).resolve().parent
S = 256
def base(bg="#161a20"):
im = Image.new("RGBA", (S, S), (0, 0, 0, 0))
d = ImageDraw.Draw(im)
d.rounded_rectangle((8, 8, S - 8, S - 8), radius=52, fill=bg)
return im, d
def bars(d, x0, y0, scale, color="#38bdf8"):
# the WebUI logo: four level bars
for x, top in ((7, 10), (13, 6), (19, 14), (25, 9)):
d.line(((x0 + x * scale, y0 + 22 * scale), (x0 + x * scale, y0 + top * scale)), fill=color, width=int(3 * scale))
d.ellipse((x0 + x * scale - 1.5 * scale, y0 + top * scale - 1.5 * scale,
x0 + x * scale + 1.5 * scale, y0 + top * scale + 1.5 * scale), fill=color)
d.ellipse((x0 + x * scale - 1.5 * scale, y0 + 22 * scale - 1.5 * scale,
x0 + x * scale + 1.5 * scale, y0 + 22 * scale + 1.5 * scale), fill=color)
def app_icon():
im, d = base()
bars(d, 0, 12, 8)
return im
def writer_icon():
im, d = base()
# SD card outline with cut corner
d.polygon([(70, 40), (160, 40), (190, 70), (190, 216), (70, 216)], fill="#e8edf3")
for i in range(5):
d.rectangle((86 + i * 19, 52, 96 + i * 19, 82), fill="#c0841a")
bars(d, 74, 98, 3.6, color="#0284c7")
# Raspberry-red write arrow
d.polygon([(196, 150), (232, 150), (214, 182)], fill="#e11d48")
d.rectangle((207, 112, 221, 152), fill="#e11d48")
return im
for name, im in (("dsp-control.ico", app_icon()), ("pi-writer.ico", writer_icon())):
im.save(HERE / name, sizes=[(16, 16), (24, 24), (32, 32), (48, 48), (64, 64), (128, 128), (256, 256)])
im.save(HERE / name.replace(".ico", ".png"))
if sys.platform == "darwin": # the macOS app icon, only needed (and built) there
im.resize((1024, 1024), Image.LANCZOS).save(HERE / name.replace(".ico", ".icns"))
print("wrote", name)
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB