#N canvas 332 51 824 646 12;
#X text 587 615 updated for Pd version 0.49.;
#X text 44 509 The abstraction may itself be modified at will without disturbing the saved states of its copies in any calling patches \, as long as the usage of the saved and restored lists is kept compatible., f 49;
#X obj 39 13 savestate;
#N canvas 689 98 622 256 reference 0;
#X obj 18 52 cnv 5 580 5 empty empty INLET: 8 18 0 13 #202020 #000000 0;
#X obj 18 95 cnv 2 580 2 empty empty OUTLETS: 8 12 0 13 #202020 #000000 0;
#X obj 18 191 cnv 2 580 2 empty empty ARGUMENTS: 8 12 0 13 #202020 #000000 0;
#X obj 17 225 cnv 5 580 5 empty empty empty 8 18 0 13 #202020 #000000 0;
#X text 176 198 NONE, f 15;
#X obj 41 16 savestate;
#X text 123 66 list -;
#X obj 17 149 cnv 1 580 1 empty empty 2nd: 8 12 0 13 #7c7c7c #000000 0;
#X obj 17 117 cnv 1 580 1 empty empty 1st: 8 12 0 13 #7c7c7c #000000 0;
#X text 123 122 list -;
#X text 123 156 bang -;
#X text 173 156 when the parent patch is saved.;
#X text 173 122 one or more lists when the parent patch is opened.;
#X text 173 66 one or more lists when the parent patch gets saved.;
#X text 115 16 - mechanism for saving the state of an abstraction., f 61;
#X restore 600 13 pd reference;
#X text 698 14 <= click;
#X obj 7 46 cnv 1 805 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X text 112 12 - mechanism for saving the state of an abstraction;
#X obj 52 342 savestate-ex1;
#A saved 0 125;
#X obj 190 342 savestate-ex1;
#A saved 0 150;
#X text 214 423 Parameters for different copies of the abstraction are saved and restored independently., f 25;
#X obj 87 430 output~;
#X text 27 270 Open the abstractions below (right- or CTRL- click and select "open" in popup menu) to see how the [savestate] object is used from within., f 52;
#X obj 436 165 savestate-ex2;
#A saved amp 1 0.5 0.333;
#A saved freq 200 400 600;
#X obj 623 165 savestate-ex2;
#A saved amp 0.5 1 0.5;
#A saved freq 300 600 900;
#X listbox 436 292 12 0 0 0 - - - 0;
#X listbox 525 263 12 0 0 0 - - - 0;
#X listbox 623 292 12 0 0 0 - - - 0;
#X listbox 690 263 12 0 0 0 - - - 0;
#X text 658 262 amp;
#X text 714 291 freq;
#X text 493 262 amp;
#X text 527 291 freq;
#X text 426 58 The saved messages are output when the object is recreated \, but before connections to the parent patch are made. Check the example below on how to [loadbang] to send messages to objects elsewhere in the owning patch. The example also shows how to store more than one list in a [savestate] object., f 51;
#X text 438 327 Note that abstractions within [clone] objects are not handled! Instead \, you can have a [clone] object inside your abstraction and use [savestate] to send data to the copies of the cloned abstraction. The last example below shows how to use multiple [savestate] objects in an abstraction., f 51;
#X listbox 451 561 12 0 0 0 - - - 0;
#X listbox 540 532 12 0 0 0 - - - 0;
#X listbox 638 561 12 0 0 0 - - - 0;
#X listbox 705 532 12 0 0 0 - - - 0;
#X text 673 531 amp;
#X text 729 560 freq;
#X text 508 531 amp;
#X text 542 560 freq;
#X obj 451 434 savestate-ex3;
#A saved amp 1 1 1;
#A saved freq 100 200 300;
#X obj 638 434 savestate-ex3;
#A saved amp 0.5 0.5 0.5;
#A saved freq 400 500 600;
#X text 27 58 The [savestate] object is used inside abstractions to save their state as they are used in a calling (parent) patch. When the parent patch (such as this one \, which calls the example abstractions) is saved \, the included [savestate] object inside the abstractions sends a 'bang' message out its right outlet \, with which the abstraction may respond by presenting one or more 'list' messages back to the [savestate] object., f 52;
#X text 27 192 These lists are saved as part of the calling patch. If the calling patch is reopened later \, the lists are sent out the left outlet of the [savestate] object. The abstraction can then use them to restore its state., f 52;
#X obj 7 602 cnv 1 805 1 empty empty empty 8 12 0 13 #000000 #000000 0;
#X connect 7 0 10 0;
#X connect 8 0 10 1;
#X connect 12 0 14 0;
#X connect 12 1 15 0;
#X connect 13 0 16 0;
#X connect 13 1 17 0;
#X connect 32 0 24 0;
#X connect 32 1 25 0;
#X connect 33 0 26 0;
#X connect 33 1 27 0;
