Files
david fe6f2bfe76 Browser patch editor for Pure Data (closes #1)
Open a .pd file, drag boxes and pull cords, save it back as a file Pd
will load. Dragging is Dragology: `d.vary` moves a box, and a cord drag
is `d.closest(...).whenFar(vary)` over every inlet in the patch, so the
plug snaps to an inlet and cancels on empty space.

The parser is a byte-exact round trip. Two Pd format details that matter:
`#X connect` indices count comments, and `;;` (an empty record) is not the
same as a blank line. Anything unmodelled — arrays, `#X declare`,
subpatches — is preserved verbatim.

Tests run real Pd: patches round trip, an edited patch loads in
`pd -nogui` without new complaints, and the bridge carries a message into
a running Pd and back.

The bridge writes to server/patches/ and runs `pd -nogui` itself, so
saving and hearing the patch is one button.
2026-11-04 19:19:53 -08:00

91 lines
2.3 KiB
Plaintext

#N canvas 0 0 900 500 10;
#X obj 5 5 loadbang;
#X msg 5 25 pd dsp 1;
#X connect 0 0 1 0;
#X text 20 10 -- NOTE BUTTONS (click to play) --;
#X text 22 50 C3;
#X obj 20 70 bng 15 15 0 1 0 0 empty empty -2 -8 0 10 -262144 -1 -1;
#X msg 20 100 48 100;
#X obj 20 130 noteout;
#X connect 4 0 5 0;
#X connect 5 0 6 0;
#X text 62 50 D3;
#X obj 60 70 bng 15 15 0 1 0 0 empty empty -2 -8 0 10 -262144 -1 -1;
#X msg 60 100 50 100;
#X obj 60 130 noteout;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X text 102 50 E3;
#X obj 100 70 bng 15 15 0 1 0 0 empty empty -2 -8 0 10 -262144 -1 -1;
#X msg 100 100 52 100;
#X obj 100 130 noteout;
#X connect 12 0 13 0;
#X connect 13 0 14 0;
#X text 142 50 F3;
#X obj 140 70 bng 15 15 0 1 0 0 empty empty -2 -8 0 10 -262144 -1 -1;
#X msg 140 100 53 100;
#X obj 140 130 noteout;
#X connect 16 0 17 0;
#X connect 17 0 18 0;
#X text 182 50 G3;
#X obj 180 70 bng 15 15 0 1 0 0 empty empty -2 -8 0 10 -262144 -1 -1;
#X msg 180 100 55 100;
#X obj 180 130 noteout;
#X connect 20 0 21 0;
#X connect 21 0 22 0;
#X text 222 50 A3;
#X obj 220 70 bng 15 15 0 1 0 0 empty empty -2 -8 0 10 -262144 -1 -1;
#X msg 220 100 57 100;
#X obj 220 130 noteout;
#X connect 24 0 25 0;
#X connect 25 0 26 0;
#X text 262 50 B3;
#X obj 260 70 bng 15 15 0 1 0 0 empty empty -2 -8 0 10 -262144 -1 -1;
#X msg 260 100 59 100;
#X obj 260 130 noteout;
#X connect 28 0 29 0;
#X connect 29 0 30 0;
#X text 302 50 C4;
#X obj 300 70 bng 15 15 0 1 0 0 empty empty -2 -8 0 10 -262144 -1 -1;
#X msg 300 100 60 100;
#X obj 300 130 noteout;
#X connect 32 0 33 0;
#X connect 33 0 34 0;
#X text 20 180 -- MPK MINI PASSTHROUGH (forward all incoming to board) --;
#X obj 30 200 notein;
#X obj 30 230 pack f f;
#X obj 30 260 noteout;
#X obj 130 200 ctlin;
#X obj 130 230 ctlout;
#X connect 36 0 37 0;
#X connect 36 1 37 1;
#X connect 37 0 38 0;
#X connect 39 0 40 0;
#X text 20 280 -- CONTROLS --;
#X obj 30 300 hsl 128 15 0 127 64 0 0 0 empty Filter-CC -2 -8 0 10 -262144 -1 -1 7200 1;
#X obj 30 340 ctlout 74;
#X connect 42 0 43 0;
#X text 20 380 -- AUDIO MONITOR --;
#X obj 30 400 adc~ 1;
#X obj 30 440 *~;
#X obj 30 480 dac~ 1 2;
#X obj 140 400 hsl 128 15 0 100 50 0 0 0 empty Monitor-Volume -2 -8 0 10 -262144 -1 -1 7200 1;
#X obj 140 440 / 100;
#X connect 45 0 46 0;
#X connect 46 0 47 0;
#X connect 46 0 47 1;
#X connect 48 0 49 0;
#X connect 49 0 46 1;