2026-03-04 21:47:06 +01:00
|
|
|
|
#!/usr/bin/env bash
|
feat(playground): add C15 synth mode with NISPS-controlled parameters and arpeggiator
Adds a secondary Synth mode (toggled via collapsible left side panel)
where the NISPS ML engine's 20 outputs control curated C15 synthesizer
parameters (oscillator PM, shapers, filters, reverb, echo, flanger,
output mixer) through a WASM AudioWorklet bridge.
Includes a chord progression arpeggiator with controls for tempo (BPM),
octave range, octave offset, and 4 selectable progressions. The C15
engine runs in an AudioWorklet with lock-free SharedArrayBuffer ring
buffer communication.
New files: c15/ (WASM assets), js/synth/ (bridge, arpeggiator, param map),
serve-coop.py (COOP/COEP headers for SharedArrayBuffer support).
2026-03-21 21:26:37 +01:00
|
|
|
|
# Serve the NISPS playground with COOP/COEP headers (required for SharedArrayBuffer/synth mode).
|
2026-03-04 21:47:06 +01:00
|
|
|
|
|
|
|
|
|
|
PORT="${1:-8000}"
|
|
|
|
|
|
MAX_ATTEMPTS=20
|
|
|
|
|
|
DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
|
|
|
|
|
|
|
|
for ((i = 0; i < MAX_ATTEMPTS; i++)); do
|
|
|
|
|
|
candidate=$((PORT + i))
|
|
|
|
|
|
if ! ss -tlnp 2>/dev/null | grep -q ":${candidate} "; then
|
feat(playground): add C15 synth mode with NISPS-controlled parameters and arpeggiator
Adds a secondary Synth mode (toggled via collapsible left side panel)
where the NISPS ML engine's 20 outputs control curated C15 synthesizer
parameters (oscillator PM, shapers, filters, reverb, echo, flanger,
output mixer) through a WASM AudioWorklet bridge.
Includes a chord progression arpeggiator with controls for tempo (BPM),
octave range, octave offset, and 4 selectable progressions. The C15
engine runs in an AudioWorklet with lock-free SharedArrayBuffer ring
buffer communication.
New files: c15/ (WASM assets), js/synth/ (bridge, arpeggiator, param map),
serve-coop.py (COOP/COEP headers for SharedArrayBuffer support).
2026-03-21 21:26:37 +01:00
|
|
|
|
echo "Serving playground at http://localhost:${candidate} (COOP/COEP enabled)"
|
|
|
|
|
|
exec python3 "$DIR/serve-coop.py" "$candidate"
|
2026-03-04 21:47:06 +01:00
|
|
|
|
fi
|
|
|
|
|
|
echo "Port ${candidate} in use, trying next..."
|
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
|
|
echo "No open port found in range ${PORT}–$((PORT + MAX_ATTEMPTS - 1))" >&2
|
|
|
|
|
|
exit 1
|