From 8d3666cdaa74d4899bea811e7b46f655f6453b25 Mon Sep 17 00:00:00 2001 From: David Gwilliam Date: Wed, 24 Jun 2026 16:24:25 -0700 Subject: [PATCH] fix: replace hsl with loadbang floats for headless Pd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit hsl GUI objects don't initialize in -nogui mode, causing cutoff at 0 Hz and volume at 0 → no audio output. Use loadbang + float for headless-safe initialization. --- pd/synth.pd | 16 ++++++++++------ scripts/gen_synth_pd.py | 17 +++++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/pd/synth.pd b/pd/synth.pd index 98f78a8..6eb662f 100644 --- a/pd/synth.pd +++ b/pd/synth.pd @@ -27,9 +27,11 @@ #X obj 180 460 *~; #X obj 320 460 *~; #X obj 250 530 dac~; -#X obj 350 330 hsl 128 15 100 18000 10000 0 0 0 empty Cutoff -2 -8 0 10 -262144 -1 -1 7200 1; -#X obj 350 430 hsl 128 15 0 100 40 0 0 0 empty Volume -2 -8 0 10 -262144 -1 -1 7200 1; -#X obj 350 460 / 100; +#X obj 350 300 loadbang; +#X obj 350 320 float 10000; +#X obj 350 400 loadbang; +#X obj 350 420 float 80; +#X obj 350 450 / 100; #X connect 0 0 1 0; #X connect 0 1 1 1; #X connect 1 0 2 0; @@ -58,8 +60,10 @@ #X connect 14 0 16 0; #X connect 16 0 24 1; #X connect 24 0 25 0; -#X connect 27 0 23 1; -#X connect 28 0 29 0; -#X connect 29 0 25 1; +#X connect 27 0 28 0; +#X connect 28 0 23 1; +#X connect 29 0 30 0; +#X connect 30 0 31 0; +#X connect 31 0 25 1; #X connect 25 0 26 0; #X connect 25 0 26 1; diff --git a/scripts/gen_synth_pd.py b/scripts/gen_synth_pd.py index d3170af..9d9577e 100644 --- a/scripts/gen_synth_pd.py +++ b/scripts/gen_synth_pd.py @@ -82,12 +82,17 @@ def gen(): connect(c, env, 0, amp, 1) connect(c, amp, 0, panscale, 0) - # ── Controls ── - cutoff = Obj(350, 330, "hsl 128 15 100 18000 10000 0 0 0 empty Cutoff -2 -8 0 10 -262144 -1 -1 7200 1") - volume = Obj(350, 430, "hsl 128 15 0 100 40 0 0 0 empty Volume -2 -8 0 10 -262144 -1 -1 7200 1") - div = Obj(350, 460, "/ 100") - connect(c, cutoff, 0, filt, 1) - connect(c, volume, 0, div, 0) + # ── Controls (headless-safe: loadbang-initialized floats, not hsl) ── + lb_cut = Obj(350, 300, "loadbang") + float_cut = Obj(350, 320, "float 10000") + connect(c, lb_cut, 0, float_cut, 0) + connect(c, float_cut, 0, filt, 1) + + lb_vol = Obj(350, 400, "loadbang") + float_vol = Obj(350, 420, "float 80") + div = Obj(350, 450, "/ 100") + connect(c, lb_vol, 0, float_vol, 0) + connect(c, float_vol, 0, div, 0) connect(c, div, 0, panscale, 1) # ── Output ──