#N canvas 214 51 553 653 10;
#X obj 109 282 cnv 15 60 37 empty empty empty 20 12 0 14 -261234 -66577
0;
#X obj 183 294 cnv 15 44 27 empty empty empty 20 12 0 14 -204280 -66577
0;
#X obj 0 1458 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0
14 -228856 -66577 0;
#X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header preset_hub 3 12
0 18 -204280 -1 0;
#X obj 0 349 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13
-228856 -1 0;
#N canvas 418 235 482 332 META 0;
#X text 12 125 HELP_PATCH_AUTHORS Jonathan Wilkes revised the patch
to conform to the PDDP template for Pd version 0.42.;
#X text 12 5 KEYWORDS control storage;
#X text 12 25 LICENSE;
#X text 12 45 DESCRIPTION universal preset system for Pd-l2ork;
#X text 12 85 OUTLET_0 anything;
#X text 12 105 AUTHOR Ivica Ico Bukvic (c) 2012 <ico@vt.edu>;
#X text 12 65 INLET_0 clear purge recall reset store;
#X restore 500 1460 pd META;
#X obj 0 687 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0
13 -228856 -1 0;
#X obj 0 822 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12
0 13 -228856 -1 0;
#X obj 0 992 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12
0 13 -228856 -1 0;
#X obj 78 357 cnv 17 3 305 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856
-162280 0;
#N canvas 102 481 428 97 Related_objects 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X obj 22 36 preset_node;
#X text 7 1 [preset_hub] Related Objects;
#X obj 98 36 preset_node_array;
#X restore 101 1460 pd Related_objects;
#X obj 78 696 cnv 17 3 120 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856
-162280 0;
#X obj 4 1460 pddp/pddplink all_about_help_patches.pd -text Usage Guide
;
#X text 11 20 universal preset system for pd-l2ork;
#X obj 20 202 preset_hub test %hidden% %node% 2 31 1 %preset% 1 problems
%preset% 2 skidoo %preset% 3 nights %preset% 0 stooges %node% 1 33
%preset% 0 aaa 32 1 %preset% 1 2.24 nlah 1 %preset% 2 1 2 3 4 %preset%
3 1 2 3 4 %node% 2 39 0 %preset% 0 1 %preset% 1 5 %preset% 2 9 %preset%
3 1337 %node% 1 61 %preset% 0 22.1 %preset% 1 0.5 %preset% 2 3.14 %node%
1 58 %preset% 0 999 %preset% 1 777 %preset% 2 555 %preset% 3 333;
#X msg 80 125 store \$1;
#X msg 80 74 recall \$1;
#X msg 30 73 purge;
#X msg 20 51 reset;
#X msg 80 174 clear \$1;
#X obj 20 231 print hub_test_says;
#X obj 376 50 cnv 15 159 290 empty empty empty 20 12 0 14 -228856 -66577
0;
#X msg 447 139 store \$1;
#X msg 455 80 recall \$1;
#X floatatom 447 115 5 0 0 0 - - -, f 5;
#X msg 395 79 purge;
#X msg 386 57 reset;
#X msg 447 190 clear \$1;
#X floatatom 447 166 5 0 0 0 - - -, f 5;
#X obj 386 217 preset_hub another %hidden% %node% 1 32 %preset% 0 99
%preset% 1 65 %preset% 2 123 %preset% 3 0 %node% 2 39 2 %preset% 0
19 %preset% 1 0.23 %preset% 2 999 %preset% 3 0.01;
#X obj 386 244 print hub_another_says;
#X obj 20 268 hub_node_abs;
#X obj 386 270 preset_node another;
#X obj 188 51 preset_node test;
#X obj 188 135 list;
#X msg 226 71 aaa 32 1;
#X msg 236 91 2.24 nlah 1;
#X obj 188 157 print ----result----;
#X msg 241 111 list 1 2 3 4;
#N canvas 778 51 404 229 sub 0;
#X obj 237 69 preset_node test;
#X floatatom 237 92 5 0 0 0 - - -, f 5;
#X obj 113 69 preset_node another;
#X floatatom 113 91 5 0 0 0 - - -, f 5;
#X text 111 41 a preset in a subpatch;
#X connect 0 0 1 0;
#X connect 2 0 3 0;
#X restore 119 292 pd sub;
#X text 98 416 reset;
#X text 99 696 anything;
#X text 98 376 purge;
#X text 98 396 recall;
#X text 98 436 store;
#X obj 381 305 cnv 15 44 27 empty empty empty 20 12 0 14 -204280 -66577
0;
#X floatatom 386 310 5 0 0 0 - - -, f 5;
#X obj 80 52 hradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1
-1 0;
#X floatatom 80 102 5 0 0 0 - - -, f 5;
#X floatatom 80 151 5 0 0 0 - - -, f 5;
#X obj 455 58 hradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1
-1 0;
#X obj 98 1057 pddp/pddplink preset_node-help.pd;
#X text 168 436 - store the current state at index n;
#X text 98 1029 Scope- [preset_hub foo] is local to its patch and all
of that patch's children (i.e. \, subpatches and abstractions).;
#X text 168 376 - purge all orphaned/unused nodes;
#X text 98 356 clear;
#X text 168 356 - clears preset n for all nodes;
#X obj 483 4 preset_hub %hidden% %node% 2 10 1 %node% 2 90 37 %node%
3 10 3 37 %node% 3 10 3 36;
#X obj 189 271 preset_node test;
#X floatatom 189 299 5 0 0 0 - - -, f 5;
#X msg 198 211 purge;
#X msg 189 189 reset;
#X msg 249 210 clearall \$1;
#X floatatom 249 189 5 0 0 0 - - -, f 5;
#X msg 232 244 set another;
#X msg 311 244 set test;
#X text 171 839 - OPTIONAL scope for this preset (defaults to null
or "");
#X text 168 416 - reset all preset node data (wipes hub clean);
#X text 98 561 read;
#X text 81 859 2) symbol file;
#X text 81 949 3) float;
#X text 171 859 - OPTIONAL literal "file" argument instructs hub not
to embed its preset data into the patch but rather assumes that the
user will save this data into an external file (see read \, write \,
readpreset \, and writepreset message above)--this also means that
changes to the preset will not trigger "patch dirty" message;
#X text 171 949 - OPTIONAL argument used exclusively in the K12 mode
that renders preset_hub invisible to GUI operations;
#X text 98 581 write;
#X text 98 601 readpreset;
#X text 168 601 - read one preset (optional 3rd argumemnt \, otherwise
preset 0) from a file named in the second argument;
#X text 98 631 writepreset;
#X text 168 631 - write one preset (optional 3rd argumemnt \, otherwise
preset 0) to a file named in the second argument;
#N canvas 186 348 428 292 More_info 0;
#X obj 30 165 cnv 15 349 98 empty \$0-pddp.cnv.subheading empty 3 12
0 14 -191407 -1 0;
#X obj 31 166 cnv 15 347 96 empty \$0-pddp.cnv.subheading empty 3 12
0 14 -262130 -1 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 7 1 [preset_hub] More info on scope;
#X text 19 37 To get a better idea of how [preset_hub] scope works
\, open another copy of this help patch \, and notice that recalling
values in one copy doesn't affect the other one.;
#X text 19 97 Similarly \, if you have [preset_hub foo] inside abstraction
[bar] \, it is guaranteed to apply only to that abstraction instance
(and its children)-- even if you put another [preset_hub foo] on the
same canvas as the abstraction:;
#X text 40 231 [bar] <-- [preset_hub foo] inside here;
#X text 168 187 it has its own [preset_hub foo];
#X text 168 205 inside it.;
#X text 40 171 [preset_hub foo] <-- this won't apply to [bar] because
;
#X restore 461 1027 pd More_info;
#N canvas 512 381 640 292 More_info 0;
#X obj -9 -1 cnv 15 639 20 empty \$0-pddp.cnv.subheading empty 3 12
0 14 -204280 -1 0;
#X text -3 -1 [preset_hub] More info on reading/writing operations
;
#X obj 9 192 preset_hub another file %hidden%;
#X obj 19 139 hradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1
-1 0;
#X msg 19 159 recall \$1;
#X obj 85 139 hradio 15 1 0 4 empty empty empty 0 -8 0 10 -262144 -1
-1 0;
#X msg 85 159 store \$1;
#X obj 10 238 preset_node another;
#X floatatom 10 260 5 0 0 0 - - -, f 5;
#X obj 135 238 preset_node another;
#X symbolatom 135 260 10 0 0 0 - - -, f 10;
#X text 263 24 First \, click on read to read all presets stored in
a separate file. Try recalling presets 0 and 1 Note how storing a new
preset does not make the patch dirty due to use of the "file" flag.
;
#X msg 151 165 reset;
#X text 263 82 Now reset the hub by clicking on the "reset" message.
The hub should be now clear of any presets. Now read a single preset
by clicking on readpreset message on the left. Notice how only preset
1 has any data (in this case identical to that found in all presets
file we loaded using the read call above.;
#X text 263 166 Loading a preset into a hub that already has data will
automatically result in a merge. As you experiment with mixing and
merging various presets \, notice how nodes in a preset that do not
have the right match in the current patch will be silently discarded
to minimize clutter among presets.;
#X msg 9 28 read preset_hub_all.preset;
#X msg 9 83 readpreset preset_hub_one.preset;
#X msg 9 104 writepreset /tmp/preset_hub_one.preset 1;
#X msg 9 49 write /tmp/preset_hub_all.preset;
#X obj 9 213 print preset_hub_another_says;
#X text 263 250 NB: check for write permissions before trying to save
files into specific folders.;
#X connect 2 0 19 0;
#X connect 3 0 4 0;
#X connect 4 0 2 0;
#X connect 5 0 6 0;
#X connect 6 0 2 0;
#X connect 7 0 8 0;
#X connect 9 0 10 0;
#X connect 12 0 2 0;
#X connect 15 0 2 0;
#X connect 16 0 2 0;
#X connect 17 0 2 0;
#X connect 18 0 2 0;
#X restore 461 1174 pd More_info;
#X text 98 1174 Writing to and reading from a file- preset_hub can
also write to an external file and read from it. More so \, the optional
2nd creation argument (literal symbol "file") prevents preset_hub from
trying to save itself into the patch. Hub can read/write all preset
states (read/write) or a select preset (readpreset/writepreset). Resetting
of hub's previously stored data must be done manually by the user.
Otherwise \, loaded data will be merged with the data already found
in the hub. Only valid nodes will be imported. Node data that does
not have a valid node in the existing patch will be silently dropped.
Reading a single preset will automatically recall it as soon as the
preset has been loaded.;
#X text 98 1392 Presets with Arrays- arrays cannot be accessed directly
as they have no direct inlets and outlets. For this reason we use preset_node_array
abstraction to read/write to/from arrays. For additional info see;
#X obj 290 1431 pddp/pddplink preset_node_array-help.pd;
#X text 81 839 1) symbol/float;
#X text 98 1075 Modular Scope- arguments starting with $ (e.g. \$1
or \$2blah) allow modular creation of preset_hub and node's scopes
inside embedded abstractions. As long as both hub and node share the
same scope \, they will see each other regardless of what scope is
given them at creation time \, including no scope at all (as is the
case with the rest of pd-l2ork \, \$1 with no argument given reverts
to 0).;
#N canvas 186 348 429 332 More_info 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 7 1 [preset_hub] More info on modular scope;
#X obj 39 98 preset_hub \$1 %hidden% %node% 1 7 %preset% 0 555 %preset%
1 444 %preset% 2 333 %preset% 3 222 %preset% 4 111 %preset% 5 0;
#X msg 39 63 store \$1;
#X msg 106 63 recall \$1;
#X floatatom 39 42 5 0 0 0 - - -, f 5;
#X floatatom 106 41 5 0 0 0 - - -, f 5;
#X obj 38 135 preset_node \$1;
#X floatatom 38 157 5 0 0 0 - - -, f 5;
#X text 142 39 <-- recall presets 0-5;
#X text 73 155 <-- note how the value changes with each recall;
#X text 34 191 Notice how the hub and node are paired even though no
optional argument has been given to this patch?Note that in this
case [preset_hub \$1] is different from [preset_hub] as latter actually
is defined as null symbol or "" while former is equal to float 0 (if
no argument is given). This hub-node pairing is also independent from
anything found in parent patch since node has found its match in this
patcher before looking one level up.;
#X connect 3 0 2 0;
#X connect 4 0 2 0;
#X connect 5 0 3 0;
#X connect 6 0 4 0;
#X connect 7 0 8 0;
#X restore 461 1074 pd More_info;
#X text 168 396 - recall the values stored at index n (n must be >=
0);
#X text 98 1348 Default values- depending on the expected data format
messages when supplied no argument default to null (empty string) or
0;
#X text 98 998 Preset names- only values 0 or greater are valid. No
negative preset numbers are possible.;
#X text 98 456 sort;
#X text 168 456 - sort all presets chronologically and assign them
new preset numbers one after another starting with a value n or 0 if
no value provided;
#X text 168 561 - reads all presets from a file named in the first
argument;
#X text 168 581 - write all presets to a file named in the first argument
;
#X text 98 502 status;
#X text 168 502 - outputs status via outlet whether any of hub's nodes
have been altered since the last time a preset was stored (0=no \,
1=yes) \, effectively reporting if the current hub's state is saved
or not (also referred to as dirty);
#X text 169 696 - print message in response to input followed by 1
for successful and 0 for failed operation. Some messages provide value
pairs (e.g. store and recall) where first value reflects requested
preset number and second value reflects whether this action was successful
or not (1 or 0). For example \, hub outputs status message whenever
either hub receives a status message \, or is requested status from
one of its nodes. This allows for implementing visual cues for reminding
user that hub's latest state has not been saved.;
#X msg 403 101 status;
#X connect 14 0 20 0;
#X connect 15 0 14 0;
#X connect 16 0 14 0;
#X connect 17 0 14 0;
#X connect 18 0 14 0;
#X connect 19 0 14 0;
#X connect 22 0 29 0;
#X connect 23 0 29 0;
#X connect 24 0 22 0;
#X connect 25 0 29 0;
#X connect 26 0 29 0;
#X connect 27 0 29 0;
#X connect 28 0 27 0;
#X connect 29 0 30 0;
#X connect 32 0 46 0;
#X connect 33 0 34 0;
#X connect 34 0 37 0;
#X connect 35 0 34 0;
#X connect 36 0 34 0;
#X connect 38 0 34 0;
#X connect 47 0 16 0;
#X connect 48 0 15 0;
#X connect 49 0 19 0;
#X connect 50 0 23 0;
#X connect 58 0 59 0;
#X connect 60 0 58 0;
#X connect 61 0 58 0;
#X connect 62 0 58 0;
#X connect 63 0 62 0;
#X connect 64 0 58 0;
#X connect 65 0 58 0;
#X connect 96 0 29 0;
