#N canvas 784 197 495 460 10; #X obj 33 7 cnv 15 410 60 empty empty empty 20 12 0 14 -261682 -66577 0; #X floatatom 38 102 5 0 100 1 number1 #0-number1.r #0-number1.s; #X obj 88 42 bng 20 250 50 0 \$0-save.s \$0-save.r save 22 7 0 10 -261234 -1 -1; #X obj 38 42 bng 20 250 50 0 \$0-load.s \$0-load.r load 22 7 0 10 -204786 -1 -1; #X floatatom 38 122 5 0 100 1 number2 #0-number2.r #0-number2.s; #X floatatom 38 142 5 0 100 1 number3 #0-number3.r #0-number3.s; #X obj 38 12 cnv 15 400 20 \$0-preset.name.s \$0-preset.name.r PRESET_FILE:no_preset_loaded 5 10 0 10 -86853 -261682 0; #X obj 148 102 hradio 15 1 0 8 \$0-hradio.s \$0-hradio.r hradio 0 -8 0 10 -262144 -1 -1 4; #X obj 148 154 vsl 15 128 0 127 0 0 \$0-slider.s \$0-slider.r slider 0 -9 0 10 -262144 -1 -1 0 1; #N canvas 727 504 826 406 presets 0; #X obj 50 82 save.param \$0 number1; #X obj 50 102 save.param \$0 number2; #X obj 50 122 save.param \$0 number3; #X obj 50 142 save.param \$0 slider; #X obj 50 162 save.param \$0 hradio; #N canvas 326 770 863 477 read.write 0; #X obj 51 41 r \$0-save.s; #X obj 51 61 savepanel; #X obj 78 104 s \$0-get.values; #X obj 347 41 r \$0-load.s; #X obj 347 61 openpanel; #X obj 347 324 t a a; #X obj 347 304 list prepend \$0; #X obj 347 372 list split 2; #X obj 381 394 send; #N canvas 132 151 450 300 write.preset.name 0; #X msg 234 202 label \$1; #X obj 234 222 s \$0-preset.name.r; #X obj 44 146 loadbang; #X obj 44 166 symbol no_preset_loaded; #X obj 234 182 makefilename PRESET_FILE:%s; #X obj 206 56 list fromsymbol; #X obj 206 132 list split; #X obj 234 152 list tosymbol; #X obj 263 112 + 1; #X obj 206 36 inlet; #N canvas 583 113 293 386 find 0; #X obj 102 46 inlet; #X obj 102 175 list store; #X obj 102 90 until; #X obj 102 112 f; #X obj 132 112 + 1; #X msg 102 153 get \$1 1; #X obj 145 91 0; #X obj 102 68 t b b a; #X obj 102 133 t f f; #X obj 102 196 == 47; #X obj 102 217 sel 1; #X obj 102 238 f; #X obj 159 279 f; #X obj 159 300 outlet; #X connect 0 0 7 0; #X connect 1 0 9 0; #X connect 1 1 2 1; #X connect 1 1 12 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 3 0 8 0; #X connect 4 0 3 1; #X connect 5 0 1 0; #X connect 6 0 3 1; #X connect 7 0 2 0; #X connect 7 1 6 0; #X connect 7 2 1 1; #X connect 8 0 5 0; #X connect 8 1 11 1; #X connect 9 0 10 0; #X connect 10 0 11 0; #X connect 11 0 12 1; #X connect 12 0 13 0; #X restore 263 92 pd find; #X obj 206 76 t a a; #X connect 0 0 1 0; #X connect 2 0 3 0; #X connect 3 0 4 0; #X connect 4 0 0 0; #X connect 5 0 11 0; #X connect 6 1 7 0; #X connect 7 0 4 0; #X connect 8 0 6 1; #X connect 9 0 5 0; #X connect 10 0 8 0; #X connect 11 0 6 0; #X connect 11 1 10 0; #X restore 367 84 pd write.preset.name; #X obj 586 45 r \$0-nrParams; #X obj 586 106 array define \$0-presetValues; #X obj 586 66 array size \$0-presetValues; #X obj 51 227 r \$0-to.array.set; #X obj 51 248 unpack f f; #X obj 51 269 swap; #X obj 51 290 tabwrite \$0-presetValues; #X obj 51 81 t s b; #X obj 51 180 soundfiler; #X obj 347 153 soundfiler; #X obj 404 174 bang; #X msg 404 195 0; #X obj 347 174 until; #X obj 347 220 f 0; #X obj 385 220 + 1; #X obj 347 262 tabread \$0-presetValues; #X obj 347 241 t f f; #X obj 347 282 list prepend; #X text 448 283 index value; #X msg 402 348 symbol \$1-\$2valueIndex; #X msg 347 131 read -resize \$1 \$2-presetValues; #X obj 347 109 list append \$0; #X obj 51 131 list append \$0; #X msg 51 154 write -nextstep -bytes 4 \$1 \$2-presetValues; #X floatatom 543 67 5 0 0 0 - - -; #X connect 0 0 1 0; #X connect 1 0 17 0; #X connect 3 0 4 0; #X connect 4 0 9 0; #X connect 4 0 31 0; #X connect 5 0 7 0; #X connect 5 1 29 0; #X connect 6 0 5 0; #X connect 7 1 8 0; #X connect 10 0 12 0; #X connect 10 0 34 0; #X connect 13 0 14 0; #X connect 14 0 15 0; #X connect 14 1 15 1; #X connect 15 0 16 0; #X connect 15 1 16 1; #X connect 17 0 32 0; #X connect 17 1 2 0; #X connect 19 0 22 0; #X connect 19 1 20 0; #X connect 20 0 21 0; #X connect 21 0 23 1; #X connect 22 0 23 0; #X connect 23 0 24 0; #X connect 23 0 26 0; #X connect 24 0 23 1; #X connect 25 0 27 0; #X connect 26 0 25 0; #X connect 26 1 27 1; #X connect 27 0 6 0; #X connect 29 0 8 1; #X connect 30 0 19 0; #X connect 31 0 30 0; #X connect 32 0 33 0; #X connect 33 0 18 0; #X restore 50 32 pd read.write; #X text 253 171 SEND: \$0-.s; #X text 253 191 RECEIVE: \$0-.r; #X text 253 31 this is the read/write subpatch which should be left as-is., f 82; #X text 253 81 in order for a parameter that is in the parent patch to be saved in the preset file \, here there needs to be a 'save.param' abstraction with the name of that parameter as the second argument (whilst the first argument is always \$0). The send and receive symbols for each parameter must be formated in this way:, f 82; #X text 253 301 With this method it's still required to create a new 'save.param' (or 'save.table') abstraction for every parameter or table to be saved in the presets \, but at least there is no need to patch all the send and receives individually., f 82; #X restore 148 42 pd presets; #X text 54 330 This is a rather simple way to store the values of gui objects to a snd file without any patching required. Each snd file that will be saved represents one set of values for the parameters chosen to be stored (aka a preset). The idea is to copy the top part of this patch into the patch where the parameters you want to save are \, and adjust the 'pd presets' subpatch (inside it is shown how to add the parameters whose values will be stored)., f 63;