From 924acb222e574ed0ed141e13ffbeb3f115fad001 Mon Sep 17 00:00:00 2001 From: Georg Holzmann Date: Fri, 5 Jan 2007 16:56:29 +0000 Subject: new helpfile standard svn path=/trunk/externals/grh/; revision=7218 --- GApop/pd/GApop-help.pd | 173 ++++++++++ GApop/pd/help-GApop.pd | 173 ---------- PDContainer/help/h_deque-help.pd | 460 ++++++++++++++++++++++++++ PDContainer/help/h_list-help.pd | 526 ++++++++++++++++++++++++++++++ PDContainer/help/h_map-help.pd | 438 +++++++++++++++++++++++++ PDContainer/help/h_multimap-help.pd | 430 ++++++++++++++++++++++++ PDContainer/help/h_multiset-help.pd | 411 +++++++++++++++++++++++ PDContainer/help/h_priority_queue-help.pd | 377 +++++++++++++++++++++ PDContainer/help/h_queue-help.pd | 363 +++++++++++++++++++++ PDContainer/help/h_set-help.pd | 412 +++++++++++++++++++++++ PDContainer/help/h_stack-help.pd | 367 +++++++++++++++++++++ PDContainer/help/h_vector-help.pd | 448 +++++++++++++++++++++++++ pix_recNN/help-pix_recNN.pd | 146 --------- pix_recNN/pix_recNN-help.pd | 146 +++++++++ threadlib/doc/help-detach.pd | 105 ------ threadlib/doc/help-join.pd | 106 ------ threadlib/doc/help-sleep.pd | 88 ----- 17 files changed, 4551 insertions(+), 618 deletions(-) create mode 100755 GApop/pd/GApop-help.pd delete mode 100755 GApop/pd/help-GApop.pd create mode 100755 PDContainer/help/h_deque-help.pd create mode 100755 PDContainer/help/h_list-help.pd create mode 100755 PDContainer/help/h_map-help.pd create mode 100755 PDContainer/help/h_multimap-help.pd create mode 100755 PDContainer/help/h_multiset-help.pd create mode 100755 PDContainer/help/h_priority_queue-help.pd create mode 100755 PDContainer/help/h_queue-help.pd create mode 100755 PDContainer/help/h_set-help.pd create mode 100755 PDContainer/help/h_stack-help.pd create mode 100755 PDContainer/help/h_vector-help.pd delete mode 100755 pix_recNN/help-pix_recNN.pd create mode 100755 pix_recNN/pix_recNN-help.pd delete mode 100755 threadlib/doc/help-detach.pd delete mode 100755 threadlib/doc/help-join.pd delete mode 100755 threadlib/doc/help-sleep.pd diff --git a/GApop/pd/GApop-help.pd b/GApop/pd/GApop-help.pd new file mode 100755 index 0000000..b1266b2 --- /dev/null +++ b/GApop/pd/GApop-help.pd @@ -0,0 +1,173 @@ +#N canvas 319 0 1050 843 10; +#N canvas 0 0 450 300 graph1 0; +#X array pop1 100 float 1; +#A 0 0.7173 0.4191 0.3337 0.5792 0.615 0.233 0.5085 0.2329 0.2695 0.4994 +0.4409 0.4816 0.2609 0.6508 0.6687 0.4443 0.6549 0.6947 0.2325 0.7254 +0.6687 0.4331 0.6746 0.3324 0.463 0.3028 0.3377 0.2766 0.3946 0.4865 +0.4048 0.3509 0.4751 0.4503 0.6866 0.6687 0.2866 0.3899 0.397 0.6973 +0.3522 0.5653 0.3529 0.3067 0.0877 0.296 0.5321 0.5064 0.408 0.2631 +0.6214 0.349 0.3362 0.2524 0.4922 0.1996 0.2766 0.5568 0.8308 0.6892 +0.2074 0.2048 0.6521 0.5131 0.5122 0.3661 0.1928 0.3226 0.2943 0.446 +0.6965 0.6668 0.5907 0.3637 0.6658 0.6942 0.191 0.4147 0.445 0.5536 +0.6667 0.2692 0.5879 0.5852 0.4976 0.7099 0.7257 0.6857 0.8582 0.419 +0.2759 0.624 0.6144 0.2375 0.2493 0.6749 0.6655 0.8358 0.7917 0.521 +; +#X coords 0 1 99 0 200 140 1; +#X restore 70 159 graph; +#N canvas 0 0 450 300 graph1 0; +#X array fit1 101 float 1; +#A 0 0.0480164 0.0551593 0.0623023 0.0623023 0.0694452 0.0908741 0.0980171 +0.112303 0.119446 0.133732 0.140875 0.148018 0.155161 0.162304 0.183732 +0.183732 0.190875 0.198018 0.205161 0.212304 0.219447 0.233733 0.233733 +0.233733 0.240876 0.240876 0.255162 0.262305 0.283734 0.290877 0.305163 +0.319448 0.319448 0.333734 0.340877 0.34802 0.355163 0.376592 0.390878 +0.398021 0.405164 0.41945 0.426593 0.440879 0.455165 0.469451 0.476593 +0.483736 0.498022 0.505165 0.512308 0.526594 0.533737 0.54088 0.548023 +0.562309 0.569452 0.590881 0.598024 0.605167 0.626596 0.626596 0.633739 +0.648024 0.66231 0.66231 0.683739 0.683739 0.698025 0.705168 0.712311 +0.719454 0.740883 0.740883 0.740883 0.755169 0.755169 0.762312 0.762312 +0.776598 0.776598 0.783741 0.783741 0.798027 0.80517 0.812313 0.826599 +0.826599 0.833741 0.848027 0.848027 0.869456 0.869456 0.890885 0.898028 +0.905171 0.919457 0.9266 0.940886 0.948029 0.990887; +#X coords 0 1 100 0 200 140 1; +#X restore 427 223 graph; +#X msg 600 772 getattributes; +#X obj 958 754 print; +#X msg 182 672 getmutrange; +#X msg 301 647 mutprop 0.3; +#X msg 300 672 getmutprop; +#X msg 90 646 pairs 5; +#X msg 89 671 getpairs; +#X obj 883 727 GApop pop1; +#X msg 598 647 cross; +#X floatatom 883 769 5 0 0 0 - - -; +#X floatatom 883 665 5 0 0 0 - - -; +#X msg 680 285 getfitbuf; +#X msg 61 380 getpopbuf; +#X msg 600 746 help; +#X msg 658 648 update; +#X obj 898 699 r GAmessages; +#X obj 679 311 s GAmessages; +#X obj 18 13 cnv 15 130 30 empty empty GApop: 7 15 0 16 -217163 -262144 +0; +#X obj 61 405 s GAmessages; +#X obj 22 103 cnv 15 30 30 empty empty 1 10 14 0 14 -233017 -1 0; +#X text 60 105 you have to give in a population:; +#X text 102 132 - values between 0 and 1; +#X text 183 326 <- set population; +#X msg 61 326 set pop1; +#X msg 61 353 popbuf pop1; +#X text 184 352 <- set population; +#X text 183 381 <- get population; +#X text 425 129 - values between 0 and 1; +#X text 386 107 give in a fitness function:; +#N canvas 627 403 307 135 init 0; +#X msg 46 57 \; pop1 ylabel 107 0 0.5 1 \; fit1 ylabel 108 0 0.5 1 +; +#X obj 46 27 loadbang; +#X connect 1 0 0 0; +#X restore 18 48 pd init; +#X text 429 369 0; +#X text 621 371 1; +#X text 515 370 0.5; +#X msg 680 258 fitbuf fit1; +#X text 425 147 - size must be 101 \, because in this array you can +draw the fitness of the values from pop1 \, for example if a value +in pop1 is 0.34 \, than the fitness of this value is fit1(0.34*100) += fit1(34); +#X text 784 257 <- set fitfunction; +#X text 783 285 <- get fitfunction; +#X text 57 465 set the other parameters:; +#X text 90 487 - pairs: specifies have much new parameters are generated +at crossover \, for example if pairs=2 that means that 2 pairs of parents +(the fittest) generate 4 children and replace the worst fit parameters +; +#X obj 89 716 s GAmessages; +#X msg 183 647 mutrange 0.2; +#X text 88 550 - mutprop: after crossover mutation occurs. mutprop +is the probability \, with wich one parameter will mutate; +#X text 593 488 - cross: with this message you can make the crossover +and mutation; +#X text 595 527 - number in inlet0: gives out the parameters: for example +if you give in 0 \, GApop puts out the value of the fittest parameters +\, if you give in 1 \, the value of the next fit parameter \, ...; +#X obj 598 680 s GAmessages; +#X text 758 665 give in numbers:; +#X obj 600 799 s GAmessages; +#X text 619 719 Help:; +#X text 755 768 get parameters:; +#N canvas 250 214 851 496 demo 0; +#X obj 36 40 inlet; +#X text 32 17 toggle; +#X obj 36 66 select 1; +#X obj 36 240 s GAmessages; +#X msg 37 117 popbuf pop1; +#X msg 38 140 fitbuf fit1; +#X msg 35 212 mutprop 0.3; +#X msg 38 163 pairs 5; +#X msg 423 177 cross; +#X msg 423 233 update; +#X obj 423 207 t b; +#X msg 394 120 1; +#X obj 422 151 metro 1000; +#X obj 394 97 delay 100; +#X msg 449 124 0; +#X obj 383 273 s GAmessages; +#X msg 37 188 mutrange 0.2; +#X msg 185 168 \; pop1 const 0.07 \;; +#X connect 0 0 2 0; +#X connect 2 0 4 0; +#X connect 2 0 5 0; +#X connect 2 0 7 0; +#X connect 2 0 16 0; +#X connect 2 0 6 0; +#X connect 2 0 13 0; +#X connect 2 0 17 0; +#X connect 2 1 14 0; +#X connect 4 0 3 0; +#X connect 5 0 3 0; +#X connect 6 0 3 0; +#X connect 7 0 3 0; +#X connect 8 0 10 0; +#X connect 8 0 15 0; +#X connect 9 0 15 0; +#X connect 10 0 9 0; +#X connect 11 0 12 0; +#X connect 12 0 8 0; +#X connect 13 0 11 0; +#X connect 14 0 12 0; +#X connect 16 0 3 0; +#X restore 547 48 pd demo; +#X obj 547 15 tgl 30 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 1 +; +#X text 424 23 demonstration ->; +#X text 154 29 Vers 0.1 \, Feb 2004; +#X obj 348 99 cnv 15 30 30 empty empty 2 10 14 0 14 -233017 -1 0; +#X obj 18 457 cnv 15 30 30 empty empty 3 10 14 0 14 -233017 -1 0; +#X text 85 592 - mutrange: the parameters will be changed randomly +in this range (+/- mutrange) if it mutates; +#X obj 526 450 cnv 15 30 30 empty empty 4 10 14 0 14 -233017 -1 0; +#X text 566 457 get the data:; +#X text 152 15 Georg Holzmann ; +#X text 595 591 - update: updates the graphic of the pop1 array (only +to see the changes); +#X connect 2 0 48 0; +#X connect 4 0 41 0; +#X connect 5 0 41 0; +#X connect 6 0 41 0; +#X connect 7 0 41 0; +#X connect 8 0 41 0; +#X connect 9 0 11 0; +#X connect 9 1 3 0; +#X connect 10 0 46 0; +#X connect 12 0 9 0; +#X connect 13 0 18 0; +#X connect 14 0 20 0; +#X connect 15 0 48 0; +#X connect 16 0 46 0; +#X connect 17 0 9 0; +#X connect 25 0 20 0; +#X connect 26 0 20 0; +#X connect 35 0 18 0; +#X connect 42 0 41 0; +#X connect 52 0 51 0; diff --git a/GApop/pd/help-GApop.pd b/GApop/pd/help-GApop.pd deleted file mode 100755 index b1266b2..0000000 --- a/GApop/pd/help-GApop.pd +++ /dev/null @@ -1,173 +0,0 @@ -#N canvas 319 0 1050 843 10; -#N canvas 0 0 450 300 graph1 0; -#X array pop1 100 float 1; -#A 0 0.7173 0.4191 0.3337 0.5792 0.615 0.233 0.5085 0.2329 0.2695 0.4994 -0.4409 0.4816 0.2609 0.6508 0.6687 0.4443 0.6549 0.6947 0.2325 0.7254 -0.6687 0.4331 0.6746 0.3324 0.463 0.3028 0.3377 0.2766 0.3946 0.4865 -0.4048 0.3509 0.4751 0.4503 0.6866 0.6687 0.2866 0.3899 0.397 0.6973 -0.3522 0.5653 0.3529 0.3067 0.0877 0.296 0.5321 0.5064 0.408 0.2631 -0.6214 0.349 0.3362 0.2524 0.4922 0.1996 0.2766 0.5568 0.8308 0.6892 -0.2074 0.2048 0.6521 0.5131 0.5122 0.3661 0.1928 0.3226 0.2943 0.446 -0.6965 0.6668 0.5907 0.3637 0.6658 0.6942 0.191 0.4147 0.445 0.5536 -0.6667 0.2692 0.5879 0.5852 0.4976 0.7099 0.7257 0.6857 0.8582 0.419 -0.2759 0.624 0.6144 0.2375 0.2493 0.6749 0.6655 0.8358 0.7917 0.521 -; -#X coords 0 1 99 0 200 140 1; -#X restore 70 159 graph; -#N canvas 0 0 450 300 graph1 0; -#X array fit1 101 float 1; -#A 0 0.0480164 0.0551593 0.0623023 0.0623023 0.0694452 0.0908741 0.0980171 -0.112303 0.119446 0.133732 0.140875 0.148018 0.155161 0.162304 0.183732 -0.183732 0.190875 0.198018 0.205161 0.212304 0.219447 0.233733 0.233733 -0.233733 0.240876 0.240876 0.255162 0.262305 0.283734 0.290877 0.305163 -0.319448 0.319448 0.333734 0.340877 0.34802 0.355163 0.376592 0.390878 -0.398021 0.405164 0.41945 0.426593 0.440879 0.455165 0.469451 0.476593 -0.483736 0.498022 0.505165 0.512308 0.526594 0.533737 0.54088 0.548023 -0.562309 0.569452 0.590881 0.598024 0.605167 0.626596 0.626596 0.633739 -0.648024 0.66231 0.66231 0.683739 0.683739 0.698025 0.705168 0.712311 -0.719454 0.740883 0.740883 0.740883 0.755169 0.755169 0.762312 0.762312 -0.776598 0.776598 0.783741 0.783741 0.798027 0.80517 0.812313 0.826599 -0.826599 0.833741 0.848027 0.848027 0.869456 0.869456 0.890885 0.898028 -0.905171 0.919457 0.9266 0.940886 0.948029 0.990887; -#X coords 0 1 100 0 200 140 1; -#X restore 427 223 graph; -#X msg 600 772 getattributes; -#X obj 958 754 print; -#X msg 182 672 getmutrange; -#X msg 301 647 mutprop 0.3; -#X msg 300 672 getmutprop; -#X msg 90 646 pairs 5; -#X msg 89 671 getpairs; -#X obj 883 727 GApop pop1; -#X msg 598 647 cross; -#X floatatom 883 769 5 0 0 0 - - -; -#X floatatom 883 665 5 0 0 0 - - -; -#X msg 680 285 getfitbuf; -#X msg 61 380 getpopbuf; -#X msg 600 746 help; -#X msg 658 648 update; -#X obj 898 699 r GAmessages; -#X obj 679 311 s GAmessages; -#X obj 18 13 cnv 15 130 30 empty empty GApop: 7 15 0 16 -217163 -262144 -0; -#X obj 61 405 s GAmessages; -#X obj 22 103 cnv 15 30 30 empty empty 1 10 14 0 14 -233017 -1 0; -#X text 60 105 you have to give in a population:; -#X text 102 132 - values between 0 and 1; -#X text 183 326 <- set population; -#X msg 61 326 set pop1; -#X msg 61 353 popbuf pop1; -#X text 184 352 <- set population; -#X text 183 381 <- get population; -#X text 425 129 - values between 0 and 1; -#X text 386 107 give in a fitness function:; -#N canvas 627 403 307 135 init 0; -#X msg 46 57 \; pop1 ylabel 107 0 0.5 1 \; fit1 ylabel 108 0 0.5 1 -; -#X obj 46 27 loadbang; -#X connect 1 0 0 0; -#X restore 18 48 pd init; -#X text 429 369 0; -#X text 621 371 1; -#X text 515 370 0.5; -#X msg 680 258 fitbuf fit1; -#X text 425 147 - size must be 101 \, because in this array you can -draw the fitness of the values from pop1 \, for example if a value -in pop1 is 0.34 \, than the fitness of this value is fit1(0.34*100) -= fit1(34); -#X text 784 257 <- set fitfunction; -#X text 783 285 <- get fitfunction; -#X text 57 465 set the other parameters:; -#X text 90 487 - pairs: specifies have much new parameters are generated -at crossover \, for example if pairs=2 that means that 2 pairs of parents -(the fittest) generate 4 children and replace the worst fit parameters -; -#X obj 89 716 s GAmessages; -#X msg 183 647 mutrange 0.2; -#X text 88 550 - mutprop: after crossover mutation occurs. mutprop -is the probability \, with wich one parameter will mutate; -#X text 593 488 - cross: with this message you can make the crossover -and mutation; -#X text 595 527 - number in inlet0: gives out the parameters: for example -if you give in 0 \, GApop puts out the value of the fittest parameters -\, if you give in 1 \, the value of the next fit parameter \, ...; -#X obj 598 680 s GAmessages; -#X text 758 665 give in numbers:; -#X obj 600 799 s GAmessages; -#X text 619 719 Help:; -#X text 755 768 get parameters:; -#N canvas 250 214 851 496 demo 0; -#X obj 36 40 inlet; -#X text 32 17 toggle; -#X obj 36 66 select 1; -#X obj 36 240 s GAmessages; -#X msg 37 117 popbuf pop1; -#X msg 38 140 fitbuf fit1; -#X msg 35 212 mutprop 0.3; -#X msg 38 163 pairs 5; -#X msg 423 177 cross; -#X msg 423 233 update; -#X obj 423 207 t b; -#X msg 394 120 1; -#X obj 422 151 metro 1000; -#X obj 394 97 delay 100; -#X msg 449 124 0; -#X obj 383 273 s GAmessages; -#X msg 37 188 mutrange 0.2; -#X msg 185 168 \; pop1 const 0.07 \;; -#X connect 0 0 2 0; -#X connect 2 0 4 0; -#X connect 2 0 5 0; -#X connect 2 0 7 0; -#X connect 2 0 16 0; -#X connect 2 0 6 0; -#X connect 2 0 13 0; -#X connect 2 0 17 0; -#X connect 2 1 14 0; -#X connect 4 0 3 0; -#X connect 5 0 3 0; -#X connect 6 0 3 0; -#X connect 7 0 3 0; -#X connect 8 0 10 0; -#X connect 8 0 15 0; -#X connect 9 0 15 0; -#X connect 10 0 9 0; -#X connect 11 0 12 0; -#X connect 12 0 8 0; -#X connect 13 0 11 0; -#X connect 14 0 12 0; -#X connect 16 0 3 0; -#X restore 547 48 pd demo; -#X obj 547 15 tgl 30 0 empty empty empty 0 -6 0 8 -260818 -1 -1 0 1 -; -#X text 424 23 demonstration ->; -#X text 154 29 Vers 0.1 \, Feb 2004; -#X obj 348 99 cnv 15 30 30 empty empty 2 10 14 0 14 -233017 -1 0; -#X obj 18 457 cnv 15 30 30 empty empty 3 10 14 0 14 -233017 -1 0; -#X text 85 592 - mutrange: the parameters will be changed randomly -in this range (+/- mutrange) if it mutates; -#X obj 526 450 cnv 15 30 30 empty empty 4 10 14 0 14 -233017 -1 0; -#X text 566 457 get the data:; -#X text 152 15 Georg Holzmann ; -#X text 595 591 - update: updates the graphic of the pop1 array (only -to see the changes); -#X connect 2 0 48 0; -#X connect 4 0 41 0; -#X connect 5 0 41 0; -#X connect 6 0 41 0; -#X connect 7 0 41 0; -#X connect 8 0 41 0; -#X connect 9 0 11 0; -#X connect 9 1 3 0; -#X connect 10 0 46 0; -#X connect 12 0 9 0; -#X connect 13 0 18 0; -#X connect 14 0 20 0; -#X connect 15 0 48 0; -#X connect 16 0 46 0; -#X connect 17 0 9 0; -#X connect 25 0 20 0; -#X connect 26 0 20 0; -#X connect 35 0 18 0; -#X connect 42 0 41 0; -#X connect 52 0 51 0; diff --git a/PDContainer/help/h_deque-help.pd b/PDContainer/help/h_deque-help.pd new file mode 100755 index 0000000..c28052e --- /dev/null +++ b/PDContainer/help/h_deque-help.pd @@ -0,0 +1,460 @@ +#N canvas 344 22 799 883 10; +#X obj 147 379 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 498 23 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 500 25 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 534 61 pd General_Concept; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 295 36 help file of; +#X text 36 98 init arg: namespace; +#X msg 480 293 print; +#X msg 480 379 clear; +#X msg 480 664 help; +#X obj 559 715 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 480 234 getnamespace; +#X msg 480 417 clearall; +#X obj 480 763 print BBB; +#X obj 68 380 print AAA; +#X text 591 259 <- change namespace; +#X msg 480 258 namespace grix; +#X text 527 294 <- print all the data of the; +#X text 546 309 current namespace; +#X text 528 379 <- clear all the data of the; +#X text 549 394 current namespace; +#X text 548 419 <- clear all the data in all; +#X text 569 434 same containers (maybe; +#X text 571 449 you shouldn't use this); +#X text 580 236 <- get current namespace; +#X text 512 193 general operations:; +#X msg 294 341 list damm 4345 it; +#X floatatom 294 247 5 0 0 0 - - -; +#X symbolatom 294 265 10 0 0 0 - - -; +#X msg 294 317 hacka 45; +#X msg 294 294 3 4 krschi; +#X text 304 216 value:; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 516 89 pd Container_Explanation; +#X msg 480 601 resize \$1; +#X msg 480 635 getsize; +#X floatatom 488 573 5 0 0 0 - - -; +#X floatatom 519 734 5 0 0 0 - - -; +#X text 545 634 <- get the size (at 2nd; +#X text 567 648 outlet); +#X msg 68 290 get \$1; +#X floatatom 74 269 5 0 0 0 - - -; +#X floatatom 74 226 5 0 0 0 - - -; +#X msg 68 247 set \$1; +#X msg 71 706 insert \$1; +#X floatatom 80 687 5 0 0 0 - - -; +#X floatatom 79 731 5 0 0 0 - - -; +#X msg 70 752 remove \$1; +#X text 124 246 <- changes the value; +#X text 145 260 at that index; +#X text 142 304 at that index; +#X text 121 290 <- get the value; +#X text 167 379 <- bang if not found; +#X msg 69 519 popback; +#X floatatom 79 429 5 0 0 0 - - -; +#X msg 69 449 pushback \$1; +#X text 209 456 <- inserts the data at the; +#X msg 178 776 some data; +#X text 152 679 remove and insert at index:; +#X text 188 716 If you need this very often you; +#X text 188 730 should better use a list or a map; +#X text 188 743 (or something else) !; +#X symbolatom 124 429 10 0 0 0 - - -; +#X text 283 54 ::: h_deque :::; +#X text 37 126 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X obj 68 358 h_deque havi; +#X obj 70 776 h_deque havi; +#X obj 69 619 h_deque havi; +#X obj 480 691 h_deque havi; +#X text 560 735 <- size of deque; +#X text 556 602 <- resizes the deque; +#X text 187 702 Thats not very fast with a deque!; +#X msg 69 489 pushfront \$1; +#X floatatom 79 470 5 0 0 0 - - -; +#X symbolatom 122 470 10 0 0 0 - - -; +#X msg 69 542 popfront; +#X msg 69 572 back; +#X msg 69 594 front; +#X text 229 471 front/back of the deque; +#X text 208 485 (so the size will increase); +#X text 143 521 <- removes the element from the; +#X text 143 539 back/front (so the size will decrease); +#X text 124 571 <- gives out the element from the; +#X text 146 586 back/front; +#X obj 69 641 print CCC; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 548 115 pd Fileformats; +#N canvas 174 18 646 402 read_save_possibilities 0; +#X obj 44 336 outlet; +#X msg 44 208 save data.dat; +#X msg 44 244 read data.dat; +#X msg 44 288 readat data.dat 0; +#X text 149 208 <- save all the data of the current namespace as textfile +; +#X text 143 244 <- read this textfile to the current namespace and +insert it at the back (so the size will increase); +#X text 177 287 <- read the textfile and insert it at the given index +(so the size won't increase !); +#X text 166 94 <- read this XML-file to the current namespace and insert +it at the back (so the size will increase); +#X text 169 61 <- save all the data of the current namespace as XML-file +; +#X text 196 139 <- read the XML-file and insert it at the given index +(so the size won't increase !); +#X msg 44 61 saveXML data.xml; +#X msg 44 93 readXML data.xml; +#X msg 44 139 readatXML data.xml 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 10 0 0 0; +#X connect 11 0 0 0; +#X connect 12 0 0 0; +#X restore 480 491 pd read_save_possibilities; +#X text 520 515 different possiblities to read; +#X text 520 529 and write from and to files; +#X text 519 544 (XML and textfiles); +#X text 216 844 htttp://grh.mur.at/software/pdcontainer.html; +#X text 180 827 =%)!(%= PDContainer \, by Georg Holzmann +\, 2005; +#X msg 480 334 getall; +#X text 535 335 <- dumps out all data sequentially; +#X text 556 349 at the first outlet; +#X connect 8 0 68 0; +#X connect 9 0 68 0; +#X connect 10 0 68 0; +#X connect 12 0 68 0; +#X connect 13 0 68 0; +#X connect 17 0 68 0; +#X connect 27 0 65 1; +#X connect 28 0 65 1; +#X connect 29 0 65 1; +#X connect 30 0 65 1; +#X connect 31 0 65 1; +#X connect 34 0 68 0; +#X connect 35 0 68 0; +#X connect 36 0 34 0; +#X connect 40 0 65 0; +#X connect 41 0 40 0; +#X connect 42 0 43 0; +#X connect 43 0 65 0; +#X connect 44 0 66 0; +#X connect 45 0 44 0; +#X connect 46 0 47 0; +#X connect 47 0 66 0; +#X connect 53 0 67 0; +#X connect 54 0 55 0; +#X connect 55 0 67 0; +#X connect 57 0 66 1; +#X connect 62 0 55 0; +#X connect 65 0 15 0; +#X connect 65 2 0 0; +#X connect 67 0 84 0; +#X connect 68 0 14 0; +#X connect 68 1 37 0; +#X connect 68 2 11 0; +#X connect 72 0 67 0; +#X connect 73 0 72 0; +#X connect 74 0 72 0; +#X connect 75 0 67 0; +#X connect 76 0 67 0; +#X connect 77 0 67 0; +#X connect 86 0 68 0; +#X connect 92 0 14 0; diff --git a/PDContainer/help/h_list-help.pd b/PDContainer/help/h_list-help.pd new file mode 100755 index 0000000..9e0f6ab --- /dev/null +++ b/PDContainer/help/h_list-help.pd @@ -0,0 +1,526 @@ +#N canvas 535 40 834 856 10; +#X obj 36 29 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 38 31 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 298 41 help file of; +#X text 39 103 init arg: namespace; +#X msg 483 298 print; +#X msg 483 372 clear; +#X msg 483 643 help; +#X obj 604 702 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 483 239 getnamespace; +#X msg 483 410 clearall; +#X obj 483 759 print BBB; +#X text 594 264 <- change namespace; +#X msg 483 263 namespace grix; +#X text 530 299 <- print all the data of the; +#X text 549 314 current namespace; +#X text 531 372 <- clear all the data of the; +#X text 552 387 current namespace; +#X text 551 412 <- clear all the data in all; +#X text 572 427 same containers (maybe; +#X text 574 442 you shouldn't use this); +#X text 583 241 <- get current namespace; +#X text 514 198 general operations:; +#X msg 483 568 getsize; +#X floatatom 523 739 5 0 0 0 - - -; +#X text 570 581 outlet); +#X text 290 58 ::: h_list :::; +#X text 40 133 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 483 681 h_list simonatbase; +#X text 604 720 <- size of the list; +#X obj 192 721 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 71 700 h_list simonatbase; +#X obj 71 674 r \$0-list; +#X obj 71 739 print AAA; +#N canvas 523 246 495 416 pusch_pop_back_front 0; +#X msg 66 229 popback; +#X floatatom 76 120 5 0 0 0 - - -; +#X msg 66 140 pushback \$1; +#X text 180 140 <- inserts the data at the; +#X symbolatom 121 120 10 0 0 0 - - -; +#X msg 66 180 pushfront \$1; +#X floatatom 76 161 5 0 0 0 - - -; +#X symbolatom 119 161 10 0 0 0 - - -; +#X msg 66 252 popfront; +#X msg 66 302 back; +#X msg 66 324 front; +#X obj 66 367 s \$0-list; +#X text 200 155 front/back of the list; +#X text 152 244 the back/front; +#X text 130 231 <- removes the element from; +#X text 143 316 the back/front; +#X text 121 301 <- gives out the element from; +#X text 27 28 insert/remove/get data at the back/front of the list. +; +#X text 27 44 These methods won't change the current iterator position +!!!; +#X connect 0 0 11 0; +#X connect 1 0 2 0; +#X connect 2 0 11 0; +#X connect 4 0 2 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 7 0 5 0; +#X connect 8 0 11 0; +#X connect 9 0 11 0; +#X connect 10 0 11 0; +#X restore 136 494 pd pusch_pop_back_front; +#X text 40 452 insert/remove/get data at the back/front of the list +\,; +#X text 43 247 You can use so called "iterators" to navigate through +; +#X text 40 468 _without_ changing the current iterator position:; +#N canvas 843 44 493 562 iterator_navigation 0; +#X text 39 73 Iterators are a generalization of pointers: they are +objects that point to other objects. Via an iterator you can navigate +through the container. You can ask a list for an iterator that points +to the first element with the message begin. You can get a past-the-end +iterator with the message end.; +#X text 182 35 ::: ITERATORS :::; +#X msg 43 216 begin; +#X msg 43 321 next; +#X text 40 179 iterator navigation:; +#X obj 43 505 s \$0-list; +#X text 91 217 <- points to the first element fo the h_list; +#X text 87 244 <- points _after_ the last element of the h_list; +#X text 94 259 (so that you can insert data there for example \,; +#X text 99 274 but attention: you can't remove an element at; +#X text 98 289 that position !!!); +#X text 85 321 <- increment the iterator - so it will point to; +#X text 107 335 the next element of h_list; +#X msg 43 244 end; +#X msg 43 357 last; +#X text 84 358 <- decrement the iterator - so it will point to; +#X text 106 372 the previous element of h_list; +#X msg 43 400 getiter; +#X text 113 401 <- puts out the current iterator position; +#X text 134 416 at second outlet; +#X msg 57 467 setiter \$1; +#X floatatom 57 448 5 0 0 0 - - -; +#X text 147 467 <- set specific iterator position; +#X connect 2 0 5 0; +#X connect 3 0 5 0; +#X connect 13 0 5 0; +#X connect 14 0 5 0; +#X connect 17 0 5 0; +#X connect 20 0 5 0; +#X connect 21 0 20 0; +#X restore 137 303 pd iterator_navigation; +#X text 43 261 the h_list. Here is a short explanation of iterators +; +#X text 43 275 and how you can use it in with h_list:; +#X text 45 364 operations at a specific iterator position:; +#N canvas 0 469 468 430 iterator_operations 0; +#X obj 54 389 s \$0-list; +#X msg 54 283 delete; +#X msg 54 113 insert \$1; +#X floatatom 54 92 5 0 0 0 - - -; +#X msg 54 338 get; +#X symbolatom 100 92 10 0 0 0 - - -; +#X text 48 33 Operations at a specific iterator position :; +#X msg 54 137 insert bla sdflj 34 fd; +#X text 235 126 current iterator position; +#X text 212 111 <- inserts the data at the; +#X text 139 299 current iterator position; +#X text 116 284 <- deletes the data at the; +#X text 138 355 current iterator position; +#X text 115 340 <- get the data at the; +#X msg 54 230 modify hallo da du; +#X floatatom 68 171 5 0 0 0 - - -; +#X symbolatom 68 189 10 0 0 0 - - -; +#X msg 54 208 modify \$1; +#X text 211 188 <- modifies the data at the; +#X text 232 203 current iterator position; +#X text 231 219 (it overrides the data); +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 2 0; +#X connect 4 0 0 0; +#X connect 5 0 2 0; +#X connect 7 0 0 0; +#X connect 14 0 0 0; +#X connect 15 0 17 0; +#X connect 16 0 17 0; +#X connect 17 0 0 0; +#X restore 138 388 pd iterator_operations; +#X text 39 550 special operations with h_list:; +#N canvas 705 269 550 449 special_operations 0; +#X msg 54 289 unique; +#X msg 54 237 reverse; +#X msg 54 189 sort; +#X obj 54 369 s \$0-list; +#X text 30 28 special operations with h_list:; +#X floatatom 54 92 5 0 0 0 - - -; +#X symbolatom 100 92 10 0 0 0 - - -; +#X msg 54 113 remove \$1; +#X msg 54 137 remove bla sdflj 34 fd; +#X text 212 111 <- removes the element with; +#X text 235 126 the given data; +#X text 124 237 <- reverses the h_list; +#X text 102 190 <- sorts the h_list; +#X text 113 289 <- Removes all but the first element in every consecutive +group of equal elements. The relative order of elements that are not +removed is unchanged.; +#X connect 0 0 3 0; +#X connect 1 0 3 0; +#X connect 2 0 3 0; +#X connect 5 0 7 0; +#X connect 6 0 7 0; +#X connect 7 0 3 0; +#X connect 8 0 3 0; +#X restore 134 578 pd special_operations; +#X text 217 720 <- bang if not found; +#X floatatom 563 720 5 0 0 0 - - -; +#X text 565 740 <- current iterator position; +#X floatatom 151 721 5 0 0 0 - - -; +#X floatatom 111 721 5 0 0 0 - - -; +#X msg 483 600 getiter; +#X text 548 567 <- get the size (at 3nd; +#X text 574 616 (2nd outlet); +#X text 553 601 <- get current iterator pos; +#X obj 500 28 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 502 30 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 536 66 pd General_Concept; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 518 94 pd Container_Explanation; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 550 120 pd Fileformats; +#N canvas 174 18 646 317 read_save_possibilities 0; +#X obj 50 258 outlet; +#X msg 50 158 save data.dat; +#X msg 50 194 read data.dat; +#X text 155 158 <- save all the data of the current namespace as textfile +; +#X text 149 194 <- read this textfile to the current namespace and +insert it at the back (so the size will increase); +#X text 173 83 <- read this XML-file to the current namespace and insert +it at the back (so the size will increase); +#X text 176 50 <- save all the data of the current namespace as XML-file +; +#X msg 51 50 saveXML data.xml; +#X msg 51 82 readXML data.xml; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 7 0 0 0; +#X connect 8 0 0 0; +#X restore 483 477 pd read_save_possibilities; +#X text 523 501 different possiblities to read; +#X text 523 515 and write from and to files; +#X text 522 530 (XML and textfiles); +#X text 229 822 htttp://grh.mur.at/software/pdcontainer.html; +#X text 189 806 =%)!(%= PDContainer \, by Georg Holzmann +\, 2004; +#X msg 483 335 getall; +#X text 535 335 <- dumps out all data sequentially; +#X text 556 349 at the first outlet; +#X connect 4 0 27 0; +#X connect 5 0 27 0; +#X connect 6 0 27 0; +#X connect 8 0 27 0; +#X connect 9 0 27 0; +#X connect 12 0 27 0; +#X connect 22 0 27 0; +#X connect 27 0 10 0; +#X connect 27 1 23 0; +#X connect 27 2 45 0; +#X connect 27 3 7 0; +#X connect 30 0 32 0; +#X connect 30 1 48 0; +#X connect 30 2 47 0; +#X connect 30 3 29 0; +#X connect 31 0 30 0; +#X connect 49 0 27 0; +#X connect 58 0 27 0; +#X connect 64 0 27 0; diff --git a/PDContainer/help/h_map-help.pd b/PDContainer/help/h_map-help.pd new file mode 100755 index 0000000..8789b08 --- /dev/null +++ b/PDContainer/help/h_map-help.pd @@ -0,0 +1,438 @@ +#N canvas 551 0 818 885 10; +#X msg 82 392 add ge; +#X obj 175 479 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 295 36 help file of; +#X text 292 53 ::: h_map :::; +#X text 40 98 init arg: namespace; +#X msg 474 364 print; +#X msg 474 478 clear; +#X msg 474 698 help; +#X obj 567 750 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 474 305 getnamespace; +#X msg 474 516 clearall; +#X obj 474 727 h_map druschka; +#X obj 474 803 print BBB; +#X obj 82 480 print AAA; +#X text 585 330 <- change namespace; +#X msg 474 329 namespace grix; +#X text 521 365 <- print all the data of the; +#X text 540 380 current namespace; +#X text 522 478 <- clear all the data of the; +#X text 543 493 current namespace; +#X text 542 518 <- clear all the data in all; +#X text 563 533 same containers (maybe; +#X text 565 548 you shouldn't use this); +#X text 574 307 <- get current namespace; +#X text 473 253 general operations:; +#X msg 82 366 add bla bal tuff; +#X msg 82 416 add 4 f 3; +#X msg 82 341 add \$1; +#X floatatom 82 303 5 0 0 0 - - -; +#X symbolatom 129 305 10 0 0 0 - - -; +#X obj 82 457 h_map druschka; +#X msg 244 418 list damm 4345 it; +#X floatatom 244 324 5 0 0 0 - - -; +#X symbolatom 244 342 10 0 0 0 - - -; +#X msg 244 394 hacka 45; +#X msg 244 371 3 4 krschi; +#X text 37 130 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X text 110 278 key:; +#X text 254 293 value:; +#X text 127 254 add data to the map:; +#X obj 172 733 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 79 734 print AAA; +#X floatatom 79 557 5 0 0 0 - - -; +#X symbolatom 126 559 10 0 0 0 - - -; +#X obj 79 711 h_map druschka; +#X text 136 526 get \, remove data:; +#X msg 79 595 get \$1; +#X msg 79 620 get bla bal tuff; +#X msg 79 646 get ge; +#X msg 79 670 get 4 f 3; +#X floatatom 222 561 5 0 0 0 - - -; +#X symbolatom 269 563 10 0 0 0 - - -; +#X msg 222 599 remove \$1; +#X msg 222 624 remove bla bal tuff; +#X msg 222 650 remove ge; +#X msg 222 674 remove 4 f 3; +#X text 195 733 <- bang if the key isn't found; +#X msg 474 664 getsize; +#X text 539 663 <- get the size (at 2nd; +#X text 561 677 outlet); +#X obj 520 776 print size; +#X obj 504 26 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 506 28 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 540 64 pd General_Concept; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 522 92 pd Container_Explanation; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 554 118 pd Fileformats; +#N canvas 174 18 646 317 read_save_possibilities 0; +#X obj 50 258 outlet; +#X msg 50 158 save data.dat; +#X msg 50 194 read data.dat; +#X text 155 158 <- save all the data of the current namespace as textfile +; +#X text 149 194 <- read this textfile to the current namespace and +insert it at the back (so the size will increase); +#X text 173 83 <- read this XML-file to the current namespace and insert +it at the back (so the size will increase); +#X text 176 50 <- save all the data of the current namespace as XML-file +; +#X msg 51 50 saveXML data.xml; +#X msg 51 82 readXML data.xml; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 7 0 0 0; +#X connect 8 0 0 0; +#X restore 474 577 pd read_save_possibilities; +#X text 512 598 different possiblities to read; +#X text 512 612 and write from and to files; +#X text 511 626 (XML and textfiles); +#X text 242 857 htttp://grh.mur.at/software/pdcontainer.html; +#X text 202 841 =%)!(%= PDContainer \, by Georg Holzmann +\, 2004; +#X text 535 415 at the first outlet; +#X msg 474 401 keys; +#X text 514 401 <- dumps out all keys sequentially; +#X text 549 451 at the first outlet; +#X msg 474 437 values; +#X text 528 437 <- dumps out all values sequentially; +#X connect 0 0 32 0; +#X connect 7 0 13 0; +#X connect 8 0 13 0; +#X connect 9 0 13 0; +#X connect 11 0 13 0; +#X connect 12 0 13 0; +#X connect 13 0 14 0; +#X connect 13 1 62 0; +#X connect 13 2 10 0; +#X connect 17 0 13 0; +#X connect 27 0 32 0; +#X connect 28 0 32 0; +#X connect 29 0 32 0; +#X connect 30 0 29 0; +#X connect 31 0 29 0; +#X connect 32 0 15 0; +#X connect 32 2 1 0; +#X connect 33 0 32 1; +#X connect 34 0 32 1; +#X connect 35 0 32 1; +#X connect 36 0 32 1; +#X connect 37 0 32 1; +#X connect 44 0 48 0; +#X connect 45 0 48 0; +#X connect 46 0 43 0; +#X connect 46 2 42 0; +#X connect 48 0 46 0; +#X connect 49 0 46 0; +#X connect 50 0 46 0; +#X connect 51 0 46 0; +#X connect 52 0 54 0; +#X connect 53 0 54 0; +#X connect 54 0 46 0; +#X connect 55 0 46 0; +#X connect 56 0 46 0; +#X connect 57 0 46 0; +#X connect 59 0 13 0; +#X connect 68 0 13 0; +#X connect 75 0 13 0; +#X connect 78 0 13 0; diff --git a/PDContainer/help/h_multimap-help.pd b/PDContainer/help/h_multimap-help.pd new file mode 100755 index 0000000..fecfff3 --- /dev/null +++ b/PDContainer/help/h_multimap-help.pd @@ -0,0 +1,430 @@ +#N canvas 556 0 813 845 10; +#X msg 82 375 add ge; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 295 36 help file of; +#X text 40 98 init arg: namespace; +#X msg 479 341 print; +#X msg 479 455 clear; +#X msg 479 693 help; +#X msg 479 282 getnamespace; +#X msg 479 493 clearall; +#X obj 479 747 print BBB; +#X obj 82 463 print AAA; +#X text 590 307 <- change namespace; +#X msg 479 306 namespace grix; +#X text 526 342 <- print all the data of the; +#X text 545 357 current namespace; +#X text 527 455 <- clear all the data of the; +#X text 548 470 current namespace; +#X text 547 495 <- clear all the data in all; +#X text 568 510 same containers (maybe; +#X text 570 525 you shouldn't use this); +#X text 579 284 <- get current namespace; +#X text 478 230 general operations:; +#X msg 82 349 add bla bal tuff; +#X msg 82 399 add 4 f 3; +#X msg 82 324 add \$1; +#X floatatom 82 286 5 0 0 0 - - -; +#X symbolatom 129 288 10 0 0 0 - - -; +#X msg 232 397 list damm 4345 it; +#X floatatom 232 303 5 0 0 0 - - -; +#X symbolatom 232 321 10 0 0 0 - - -; +#X msg 232 373 hacka 45; +#X msg 232 350 3 4 krschi; +#X text 110 261 key:; +#X text 242 272 value:; +#X obj 79 717 print AAA; +#X floatatom 79 540 5 0 0 0 - - -; +#X symbolatom 126 542 10 0 0 0 - - -; +#X text 136 509 get \, remove data:; +#X msg 79 578 get \$1; +#X msg 79 603 get bla bal tuff; +#X msg 79 629 get ge; +#X msg 79 653 get 4 f 3; +#X floatatom 222 544 5 0 0 0 - - -; +#X symbolatom 269 546 10 0 0 0 - - -; +#X msg 222 582 remove \$1; +#X msg 222 607 remove bla bal tuff; +#X msg 222 633 remove ge; +#X msg 222 657 remove 4 f 3; +#X text 40 131 Multimaps are just like maps except that a key can be +associated with several values. Multimap is a Sorted Associative Container +and also a Multiple Associative Container \, meaning that there is +no limit on the number of elements with the same key. (see also Map) +; +#X text 275 53 ::: h_multimap :::; +#X obj 82 440 h_multimap dampta; +#X obj 79 694 h_multimap dampta; +#X obj 479 724 h_multimap dampta; +#X floatatom 136 750 5 0 0 0 - - -; +#X text 111 231 add data to the multimap:; +#X text 180 751 <- nr of values at the specific key; +#X msg 479 638 getsize; +#X text 566 651 outlet); +#X text 544 637 <- get the size (at 3rd; +#X obj 593 747 print size; +#X obj 500 24 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 502 26 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 536 62 pd General_Concept; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 518 90 pd Container_Explanation; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 550 116 pd Fileformats; +#N canvas 174 18 646 317 read_save_possibilities 0; +#X obj 50 258 outlet; +#X msg 50 158 save data.dat; +#X msg 50 194 read data.dat; +#X text 155 158 <- save all the data of the current namespace as textfile +; +#X text 149 194 <- read this textfile to the current namespace and +insert it at the back (so the size will increase); +#X text 173 83 <- read this XML-file to the current namespace and insert +it at the back (so the size will increase); +#X text 176 50 <- save all the data of the current namespace as XML-file +; +#X msg 51 50 saveXML data.xml; +#X msg 51 82 readXML data.xml; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 7 0 0 0; +#X connect 8 0 0 0; +#X restore 479 553 pd read_save_possibilities; +#X text 517 574 different possiblities to read; +#X text 517 588 and write from and to files; +#X text 516 602 (XML and textfiles); +#X text 241 815 htttp://grh.mur.at/software/pdcontainer.html; +#X text 201 799 =%)!(%= PDContainer \, by Georg Holzmann +\, 2004; +#X text 540 392 at the first outlet; +#X msg 479 378 keys; +#X text 519 378 <- dumps out all keys sequentially; +#X text 554 428 at the first outlet; +#X msg 479 414 values; +#X text 533 414 <- dumps out all values sequentially; +#X connect 0 0 51 0; +#X connect 5 0 53 0; +#X connect 6 0 53 0; +#X connect 7 0 53 0; +#X connect 8 0 53 0; +#X connect 9 0 53 0; +#X connect 13 0 53 0; +#X connect 23 0 51 0; +#X connect 24 0 51 0; +#X connect 25 0 51 0; +#X connect 26 0 25 0; +#X connect 27 0 25 0; +#X connect 28 0 51 1; +#X connect 29 0 51 1; +#X connect 30 0 51 1; +#X connect 31 0 51 1; +#X connect 32 0 51 1; +#X connect 36 0 39 0; +#X connect 37 0 39 0; +#X connect 39 0 52 0; +#X connect 40 0 52 0; +#X connect 41 0 52 0; +#X connect 42 0 52 0; +#X connect 43 0 45 0; +#X connect 44 0 45 0; +#X connect 45 0 52 0; +#X connect 46 0 52 0; +#X connect 47 0 52 0; +#X connect 48 0 52 0; +#X connect 51 0 11 0; +#X connect 52 0 35 0; +#X connect 52 1 54 0; +#X connect 53 0 10 0; +#X connect 53 2 60 0; +#X connect 57 0 53 0; +#X connect 66 0 53 0; +#X connect 73 0 53 0; +#X connect 76 0 53 0; diff --git a/PDContainer/help/h_multiset-help.pd b/PDContainer/help/h_multiset-help.pd new file mode 100755 index 0000000..7ad90a7 --- /dev/null +++ b/PDContainer/help/h_multiset-help.pd @@ -0,0 +1,411 @@ +#N canvas 0 0 817 875 10; +#X msg 154 388 add ge; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 295 36 help file of; +#X text 37 100 init arg: namespace; +#X msg 470 377 print; +#X msg 470 456 clear; +#X msg 470 677 help; +#X msg 470 318 getnamespace; +#X msg 470 494 clearall; +#X text 581 343 <- change namespace; +#X msg 470 342 namespace grix; +#X text 517 378 <- print all the data of the; +#X text 536 393 current namespace; +#X text 518 456 <- clear all the data of the; +#X text 539 471 current namespace; +#X text 538 496 <- clear all the data in all; +#X text 559 511 same containers (maybe; +#X text 561 526 you shouldn't use this); +#X text 570 320 <- get current namespace; +#X text 469 266 general operations:; +#X msg 154 362 add bla bal tuff; +#X msg 154 412 add 4 f 3; +#X msg 154 337 add \$1; +#X floatatom 154 299 5 0 0 0 - - -; +#X symbolatom 201 301 10 0 0 0 - - -; +#X floatatom 84 578 5 0 0 0 - - -; +#X symbolatom 131 580 10 0 0 0 - - -; +#X text 139 544 get \, remove data:; +#X msg 84 616 get \$1; +#X msg 84 641 get bla bal tuff; +#X msg 84 667 get ge; +#X msg 84 691 get 4 f 3; +#X floatatom 227 582 5 0 0 0 - - -; +#X symbolatom 274 584 10 0 0 0 - - -; +#X msg 227 620 remove \$1; +#X msg 227 645 remove bla bal tuff; +#X msg 227 671 remove ge; +#X msg 227 695 remove 4 f 3; +#X floatatom 84 757 5 0 0 0 - - -; +#X floatatom 470 731 5 0 0 0 - - -; +#X floatatom 154 477 5 0 0 0 - - -; +#X text 275 52 ::: h_multiset :::; +#X obj 154 453 h_multiset \$0-pscht; +#X obj 84 731 h_multiset \$0-pscht; +#X obj 470 708 h_multiset \$0-pscht; +#X text 131 757 <- the number how often the data is set; +#X text 37 137 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X text 140 268 add data to the multiset:; +#X msg 470 640 getsize; +#X text 535 639 <- get the size (at 2nd; +#X text 557 653 outlet); +#X obj 598 730 print size; +#X obj 500 24 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 502 26 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 536 62 pd General_Concept; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 518 90 pd Container_Explanation; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 550 116 pd Fileformats; +#N canvas 174 18 646 317 read_save_possibilities 0; +#X obj 50 258 outlet; +#X msg 50 158 save data.dat; +#X msg 50 194 read data.dat; +#X text 155 158 <- save all the data of the current namespace as textfile +; +#X text 149 194 <- read this textfile to the current namespace and +insert it at the back (so the size will increase); +#X text 173 83 <- read this XML-file to the current namespace and insert +it at the back (so the size will increase); +#X text 176 50 <- save all the data of the current namespace as XML-file +; +#X msg 51 50 saveXML data.xml; +#X msg 51 82 readXML data.xml; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 7 0 0 0; +#X connect 8 0 0 0; +#X restore 470 559 pd read_save_possibilities; +#X text 508 580 different possiblities to read; +#X text 508 594 and write from and to files; +#X text 507 608 (XML and textfiles); +#X text 244 827 htttp://grh.mur.at/software/pdcontainer.html; +#X text 204 811 =%)!(%= PDContainer \, by Georg Holzmann +\, 2004; +#X msg 470 416 getall; +#X text 522 416 <- dumps out all data sequentially; +#X text 543 430 at the first outlet; +#X connect 0 0 43 0; +#X connect 5 0 45 0; +#X connect 6 0 45 0; +#X connect 7 0 45 0; +#X connect 8 0 45 0; +#X connect 9 0 45 0; +#X connect 11 0 45 0; +#X connect 21 0 43 0; +#X connect 22 0 43 0; +#X connect 23 0 43 0; +#X connect 24 0 23 0; +#X connect 25 0 23 0; +#X connect 26 0 29 0; +#X connect 27 0 29 0; +#X connect 29 0 44 0; +#X connect 30 0 44 0; +#X connect 31 0 44 0; +#X connect 32 0 44 0; +#X connect 33 0 35 0; +#X connect 34 0 35 0; +#X connect 35 0 44 0; +#X connect 36 0 44 0; +#X connect 37 0 44 0; +#X connect 38 0 44 0; +#X connect 43 0 41 0; +#X connect 44 0 39 0; +#X connect 45 0 40 0; +#X connect 45 1 52 0; +#X connect 49 0 45 0; +#X connect 58 0 45 0; +#X connect 64 0 45 0; diff --git a/PDContainer/help/h_priority_queue-help.pd b/PDContainer/help/h_priority_queue-help.pd new file mode 100755 index 0000000..de43ceb --- /dev/null +++ b/PDContainer/help/h_priority_queue-help.pd @@ -0,0 +1,377 @@ +#N canvas 354 37 801 853 10; +#X obj 261 702 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 295 36 help file of; +#X text 40 98 init arg: namespace; +#X msg 430 438 clear; +#X msg 430 532 help; +#X obj 607 586 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 430 335 getnamespace; +#X msg 430 476 clearall; +#X obj 430 630 print BBB; +#X text 541 360 <- change namespace; +#X msg 430 359 namespace grix; +#X text 478 438 <- clear all the data of the; +#X text 499 453 current namespace; +#X text 498 478 <- clear all the data in all; +#X text 519 493 same containers (maybe; +#X text 521 508 you shouldn't use this); +#X text 530 337 <- get current namespace; +#X text 429 283 general operations:; +#X floatatom 518 606 5 0 0 0 - - -; +#X floatatom 172 717 5 0 0 0 - - -; +#X msg 430 391 getsize; +#X text 493 391 <- puts out the size of the; +#X text 514 407 stack at the 2nd outlet; +#X text 153 600 removing it; +#X msg 84 626 pop; +#X text 285 53 ::: h_queue :::; +#X text 562 606 <- nr of elements; +#X text 119 627 <- removes the data fom the front; +#X text 40 128 A priority queue is also a "first in first out" (FIFO) +data structure like a queue \, but you can give the elements a priority. +So the elements with a higher priority are automatically inserted before +all other elements with a lower priority.; +#X msg 84 571 top; +#X text 132 572 <- get the data from the top; +#X text 153 587 of the container without; +#X text 140 642 of the container; +#X text 287 702 <- bang if container is empty; +#X obj 79 486 print AAA; +#X msg 256 431 list damm 4345 it; +#X floatatom 256 337 5 0 0 0 - - -; +#X symbolatom 256 355 10 0 0 0 - - -; +#X msg 256 407 hacka 45; +#X msg 256 384 3 4 krschi; +#X text 253 309 value:; +#X msg 79 358 push \$1; +#X floatatom 79 336 5 0 0 0 - - -; +#X text 77 308 priority:; +#X text 81 263 add data to the priority_queue:; +#X obj 79 463 h_priority_queue \$0-aetsch; +#X obj 84 743 print CCC; +#X obj 84 678 h_priority_queue \$0-aetsch; +#X obj 430 563 h_priority_queue \$0-aetsch; +#X obj 500 24 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 502 26 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 536 62 pd General_Concept; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 518 90 pd Container_Explanation; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 550 116 pd Fileformats; +#X text 224 810 htttp://grh.mur.at/software/pdcontainer.html; +#X text 184 794 =%)!(%= PDContainer \, by Georg Holzmann +\, 2004; +#X connect 5 0 50 0; +#X connect 6 0 50 0; +#X connect 8 0 50 0; +#X connect 9 0 50 0; +#X connect 12 0 50 0; +#X connect 22 0 50 0; +#X connect 26 0 49 0; +#X connect 31 0 49 0; +#X connect 37 0 47 1; +#X connect 38 0 47 1; +#X connect 39 0 47 1; +#X connect 40 0 47 1; +#X connect 41 0 47 1; +#X connect 43 0 47 0; +#X connect 44 0 43 0; +#X connect 47 0 36 0; +#X connect 49 0 48 0; +#X connect 49 1 21 0; +#X connect 49 2 0 0; +#X connect 50 0 10 0; +#X connect 50 1 20 0; +#X connect 50 2 7 0; diff --git a/PDContainer/help/h_queue-help.pd b/PDContainer/help/h_queue-help.pd new file mode 100755 index 0000000..339f5f3 --- /dev/null +++ b/PDContainer/help/h_queue-help.pd @@ -0,0 +1,363 @@ +#N canvas 529 37 794 742 10; +#X obj 154 536 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 295 36 help file of; +#X text 40 98 init arg: namespace; +#X msg 430 438 clear; +#X msg 430 532 help; +#X obj 502 587 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 430 335 getnamespace; +#X msg 430 476 clearall; +#X obj 430 630 print BBB; +#X obj 82 579 print AAA; +#X text 541 360 <- change namespace; +#X msg 430 359 namespace grix; +#X text 478 438 <- clear all the data of the; +#X text 499 453 current namespace; +#X text 498 478 <- clear all the data in all; +#X text 519 493 same containers (maybe; +#X text 521 508 you shouldn't use this); +#X text 530 337 <- get current namespace; +#X text 429 283 general operations:; +#X floatatom 466 606 5 0 0 0 - - -; +#X floatatom 118 556 5 0 0 0 - - -; +#X msg 430 391 getsize; +#X text 493 391 <- puts out the size of the; +#X text 514 407 stack at the 2nd outlet; +#X msg 82 358 push \$1; +#X floatatom 82 332 5 0 0 0 - - -; +#X symbolatom 130 332 10 0 0 0 - - -; +#X text 151 436 removing it; +#X msg 82 462 pop; +#X text 285 53 ::: h_queue :::; +#X obj 82 514 h_queue xlt; +#X obj 430 563 h_queue xlt; +#X text 39 136 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X text 510 606 <- nr of elements; +#X text 180 536 <- bang if queue is empty; +#X text 148 359 <- push some data in the queue; +#X msg 82 407 front; +#X text 130 408 <- get the data from the front; +#X text 151 423 of the queue without; +#X text 138 478 of the queue; +#X text 117 463 <- removes the data fom the front; +#X obj 500 24 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 502 26 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 536 62 pd General_Concept; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 518 90 pd Container_Explanation; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 550 116 pd Fileformats; +#X text 211 703 htttp://grh.mur.at/software/pdcontainer.html; +#X text 171 687 =%)!(%= PDContainer \, by Georg Holzmann +\, 2004; +#X connect 5 0 33 0; +#X connect 6 0 33 0; +#X connect 8 0 33 0; +#X connect 9 0 33 0; +#X connect 13 0 33 0; +#X connect 23 0 33 0; +#X connect 26 0 32 0; +#X connect 27 0 26 0; +#X connect 28 0 26 0; +#X connect 30 0 32 0; +#X connect 32 0 11 0; +#X connect 32 1 22 0; +#X connect 32 2 0 0; +#X connect 33 0 10 0; +#X connect 33 1 21 0; +#X connect 33 2 7 0; +#X connect 38 0 32 0; diff --git a/PDContainer/help/h_set-help.pd b/PDContainer/help/h_set-help.pd new file mode 100755 index 0000000..26932e9 --- /dev/null +++ b/PDContainer/help/h_set-help.pd @@ -0,0 +1,412 @@ +#N canvas 0 0 800 865 10; +#X msg 154 388 add ge; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 295 36 help file of; +#X text 37 100 init arg: namespace; +#X msg 477 380 print; +#X msg 477 454 clear; +#X msg 477 674 help; +#X msg 477 321 getnamespace; +#X msg 477 492 clearall; +#X text 588 346 <- change namespace; +#X msg 477 345 namespace grix; +#X text 524 381 <- print all the data of the; +#X text 543 396 current namespace; +#X text 525 454 <- clear all the data of the; +#X text 546 469 current namespace; +#X text 545 494 <- clear all the data in all; +#X text 566 509 same containers (maybe; +#X text 568 524 you shouldn't use this); +#X text 577 323 <- get current namespace; +#X text 476 269 general operations:; +#X msg 154 362 add bla bal tuff; +#X msg 154 412 add 4 f 3; +#X msg 154 337 add \$1; +#X floatatom 154 299 5 0 0 0 - - -; +#X symbolatom 201 301 10 0 0 0 - - -; +#X floatatom 84 578 5 0 0 0 - - -; +#X symbolatom 131 580 10 0 0 0 - - -; +#X text 139 544 get \, remove data:; +#X msg 84 616 get \$1; +#X msg 84 641 get bla bal tuff; +#X msg 84 667 get ge; +#X msg 84 691 get 4 f 3; +#X floatatom 227 582 5 0 0 0 - - -; +#X symbolatom 274 584 10 0 0 0 - - -; +#X msg 227 620 remove \$1; +#X msg 227 645 remove bla bal tuff; +#X msg 227 671 remove ge; +#X msg 227 695 remove 4 f 3; +#X floatatom 84 757 5 0 0 0 - - -; +#X floatatom 477 728 5 0 0 0 - - -; +#X text 291 51 ::: h_set :::; +#X text 37 129 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X text 140 268 add data to the set:; +#X obj 154 453 h_set krx; +#X floatatom 154 477 5 0 0 0 - - -; +#X obj 84 732 h_set krx; +#X text 131 757 <- 1 if the data is set (otherwise 0); +#X obj 477 705 h_set krx; +#X obj 535 728 print size; +#X msg 477 639 getsize; +#X text 542 638 <- get the size (at 2nd; +#X text 564 652 outlet); +#X obj 500 24 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 502 26 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 536 62 pd General_Concept; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 518 90 pd Container_Explanation; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 550 116 pd Fileformats; +#N canvas 174 18 646 317 read_save_possibilities 0; +#X obj 50 258 outlet; +#X msg 50 158 save data.dat; +#X msg 50 194 read data.dat; +#X text 155 158 <- save all the data of the current namespace as textfile +; +#X text 149 194 <- read this textfile to the current namespace and +insert it at the back (so the size will increase); +#X text 173 83 <- read this XML-file to the current namespace and insert +it at the back (so the size will increase); +#X text 176 50 <- save all the data of the current namespace as XML-file +; +#X msg 51 50 saveXML data.xml; +#X msg 51 82 readXML data.xml; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 7 0 0 0; +#X connect 8 0 0 0; +#X restore 477 555 pd read_save_possibilities; +#X text 515 576 different possiblities to read; +#X text 515 590 and write from and to files; +#X text 514 604 (XML and textfiles); +#X text 283 824 htttp://grh.mur.at/software/pdcontainer.html; +#X text 243 808 =%)!(%= PDContainer \, by Georg Holzmann +\, 2004; +#X msg 477 418 getall; +#X text 529 418 <- dumps out all data sequentially; +#X text 550 432 at the first outlet; +#X connect 0 0 44 0; +#X connect 5 0 48 0; +#X connect 6 0 48 0; +#X connect 7 0 48 0; +#X connect 8 0 48 0; +#X connect 9 0 48 0; +#X connect 11 0 48 0; +#X connect 21 0 44 0; +#X connect 22 0 44 0; +#X connect 23 0 44 0; +#X connect 24 0 23 0; +#X connect 25 0 23 0; +#X connect 26 0 29 0; +#X connect 27 0 29 0; +#X connect 29 0 46 0; +#X connect 30 0 46 0; +#X connect 31 0 46 0; +#X connect 32 0 46 0; +#X connect 33 0 35 0; +#X connect 34 0 35 0; +#X connect 35 0 46 0; +#X connect 36 0 46 0; +#X connect 37 0 46 0; +#X connect 38 0 46 0; +#X connect 44 0 45 0; +#X connect 46 0 39 0; +#X connect 48 0 40 0; +#X connect 48 1 49 0; +#X connect 50 0 7 0; +#X connect 58 0 48 0; +#X connect 64 0 48 0; diff --git a/PDContainer/help/h_stack-help.pd b/PDContainer/help/h_stack-help.pd new file mode 100755 index 0000000..7e090ac --- /dev/null +++ b/PDContainer/help/h_stack-help.pd @@ -0,0 +1,367 @@ +#N canvas 0 0 796 754 10; +#X obj 161 579 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 295 36 help file of; +#X text 40 98 init arg: namespace; +#X msg 430 438 clear; +#X msg 430 532 help; +#X obj 509 588 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 430 335 getnamespace; +#X msg 430 476 clearall; +#X obj 430 630 print BBB; +#X obj 82 622 print AAA; +#X text 541 360 <- change namespace; +#X msg 430 359 namespace grix; +#X text 478 438 <- clear all the data of the; +#X text 499 453 current namespace; +#X text 498 478 <- clear all the data in all; +#X text 519 493 same containers (maybe; +#X text 521 508 you shouldn't use this); +#X text 530 337 <- get current namespace; +#X text 429 283 general operations:; +#X text 287 53 ::: h_stack :::; +#X obj 430 563 h_stack data; +#X floatatom 469 606 5 0 0 0 - - -; +#X obj 82 557 h_stack data; +#X floatatom 121 599 5 0 0 0 - - -; +#X msg 430 391 getsize; +#X text 493 391 <- puts out the size of the; +#X text 514 407 stack at the 2nd outlet; +#X msg 82 358 push \$1; +#X floatatom 82 332 5 0 0 0 - - -; +#X symbolatom 130 332 10 0 0 0 - - -; +#X text 148 359 <- push some data to the; +#X text 169 374 top of the stack; +#X msg 82 407 top; +#X text 117 408 <- get the data from the top; +#X text 138 423 of the stack without; +#X text 138 436 removing it; +#X msg 82 462 pop; +#X text 513 606 <- nr of elements; +#X text 187 579 <- bang if stack is empty; +#X text 117 463 <- removes the data from the; +#X text 138 478 top of the stack; +#X text 137 494 (but without putting it; +#X text 146 508 out !!!); +#X text 38 133 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop removes it without putting it out.; +#X obj 500 24 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 502 26 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 536 62 pd General_Concept; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 518 90 pd Container_Explanation; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 550 116 pd Fileformats; +#X text 218 709 htttp://grh.mur.at/software/pdcontainer.html; +#X text 178 693 =%)!(%= PDContainer \, by Georg Holzmann +\, 2004; +#X connect 5 0 22 0; +#X connect 6 0 22 0; +#X connect 8 0 22 0; +#X connect 9 0 22 0; +#X connect 13 0 22 0; +#X connect 22 0 10 0; +#X connect 22 1 23 0; +#X connect 22 2 7 0; +#X connect 24 0 11 0; +#X connect 24 1 25 0; +#X connect 24 2 0 0; +#X connect 26 0 22 0; +#X connect 29 0 24 0; +#X connect 30 0 29 0; +#X connect 31 0 29 0; +#X connect 34 0 24 0; +#X connect 38 0 24 0; diff --git a/PDContainer/help/h_vector-help.pd b/PDContainer/help/h_vector-help.pd new file mode 100755 index 0000000..802316c --- /dev/null +++ b/PDContainer/help/h_vector-help.pd @@ -0,0 +1,448 @@ +#N canvas 0 54 830 880 10; +#X obj 157 404 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 295 36 help file of; +#X text 40 98 init arg: namespace; +#X msg 480 313 print; +#X msg 480 395 clear; +#X msg 480 676 help; +#X obj 566 726 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 480 254 getnamespace; +#X msg 480 433 clearall; +#X obj 480 775 print BBB; +#X obj 71 443 print AAA; +#X text 591 279 <- change namespace; +#X msg 480 278 namespace grix; +#X text 527 314 <- print all the data of the; +#X text 546 329 current namespace; +#X text 528 395 <- clear all the data of the; +#X text 549 410 current namespace; +#X text 548 435 <- clear all the data in all; +#X text 569 450 same containers (maybe; +#X text 571 465 you shouldn't use this); +#X text 580 256 <- get current namespace; +#X text 512 213 general operations:; +#X msg 297 366 list damm 4345 it; +#X floatatom 297 272 5 0 0 0 - - -; +#X symbolatom 297 290 10 0 0 0 - - -; +#X msg 297 342 hacka 45; +#X msg 297 319 3 4 krschi; +#X text 307 241 value:; +#X text 279 54 ::: h_vector :::; +#X text 31 143 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X msg 480 613 resize \$1; +#X msg 480 647 getsize; +#X floatatom 488 585 5 0 0 0 - - -; +#X text 556 614 <- resizes the vector; +#X obj 480 703 h_vector klax; +#X floatatom 523 746 5 0 0 0 - - -; +#X text 545 646 <- get the size (at 2nd; +#X text 567 660 outlet); +#X text 567 745 <- size of vector; +#X obj 71 383 h_vector klax; +#X floatatom 114 422 5 0 0 0 - - -; +#X msg 71 290 get \$1; +#X floatatom 77 269 5 0 0 0 - - -; +#X floatatom 77 226 5 0 0 0 - - -; +#X msg 71 247 set \$1; +#X msg 71 698 insert \$1; +#X floatatom 78 671 5 0 0 0 - - -; +#X floatatom 79 721 5 0 0 0 - - -; +#X msg 70 744 remove \$1; +#X text 127 246 <- changes the value; +#X text 148 260 at that index; +#X text 145 304 at that index; +#X text 124 290 <- get the value; +#X text 177 404 <- bang if not found; +#X msg 70 526 pushback gsdfg 34; +#X msg 70 572 popback; +#X obj 70 622 h_vector klax; +#X floatatom 70 481 5 0 0 0 - - -; +#X msg 70 503 pushback \$1; +#X text 166 503 <- inserts the data at the; +#X text 223 518 back of the vector; +#X text 230 532 (so the size will; +#X text 230 545 increase); +#X text 131 571 <- removes the element from the; +#X text 154 586 back (so the size will decrease); +#X msg 178 768 some data; +#X text 152 671 remove and insert at index:; +#X text 188 708 If you need this very often you; +#X text 188 722 should better use a list or a map; +#X text 187 694 Thats not very fast with a vector!; +#X text 188 735 (or something else) !; +#X obj 70 768 h_vector klax; +#X symbolatom 115 481 10 0 0 0 - - -; +#X obj 500 24 cnv 15 204 120 empty empty empty 20 12 0 14 -66577 -66577 +0; +#X obj 502 26 cnv 15 200 116 empty empty ReadMe: 65 15 0 14 -262131 +-143491 0; +#N canvas 674 0 511 843 General_Concept 0; +#X text 37 165 This library was made for algorithmic composition and +of course for all other algorithms. I came into troubles with making +bigger musical structures in PD with send-receive pairs \, arrays \, +etc. So I tried to make it possible \, to have access to some storage +in a whole patch.; +#X text 131 131 ::: GOAL OF THE LIBRARY :::; +#X text 39 428 For communication I use namespaces. Every Container +with the same namespace (and the same container type) has access to +the same data. So you can modify and get this data everywhere in the +patch. For local namespaces use names with \$0.; +#X text 140 266 ::: DATASTRUCTURES :::; +#X text 156 397 ::: NAMESPACES :::; +#X obj 33 24 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 35 26 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#N canvas 434 247 671 362 namespace_example 0; +#X obj 43 176 h_stack hallawum; +#X msg 43 151 push some data; +#X text 34 25 ::: NAMESPACE EXAMPLE :::; +#X text 166 150 <- add the list "some data" to the stack; +#X text 187 167 (namespace "hallawum"); +#X obj 41 254 h_stack hallawum; +#X msg 41 231 top; +#X text 76 231 <- get the data (same namespace); +#X msg 341 235 top; +#X obj 341 258 h_stack kaletom; +#X obj 341 281 print BBB; +#X obj 41 277 print AAA; +#X text 376 235 <- get the data (different namespace); +#X text 475 271 not possible !!!; +#X text 35 65 In different namespaces you have access to different +data. Here with the datastructure "stack". The two objects with the +same namespace (here "hallawum") are sharing their data!; +#X connect 1 0 0 0; +#X connect 5 0 11 0; +#X connect 6 0 5 0; +#X connect 8 0 9 0; +#X connect 9 0 10 0; +#X restore 39 503 pd namespace_example; +#X text 161 554 ::: DATATYPES :::; +#X text 38 296 As storage datastructures I implemented the C++ STL +(Standard Template Library) Containers in PD. Currently following datastructures +are available (prefixed with h_): h_map \, h_multimap \, h_set \, h_multiset +\, h_vector \, h_list \, h_deque \, h_queue \, h_priority_queue and +h_stack.; +#N canvas 438 21 583 739 map_example 0; +#X obj 45 297 h_map \$0-data; +#X msg 45 256 add data1; +#X msg 131 273 1 4 3 5 6; +#X obj 45 220 t b b; +#X obj 45 194 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 321 303 h_map \$0-data; +#X obj 321 226 t b b; +#X obj 321 200 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X msg 321 262 add data2; +#X msg 407 279 6 4 5 1 2; +#X obj 118 402 h_map \$0-data; +#X msg 118 376 print; +#X text 170 375 <- see whats in the container; +#X obj 118 556 h_map \$0-data; +#X msg 118 485 get data1; +#X msg 142 519 get data2; +#X obj 118 578 print AAA; +#X text 202 485 <- get data1; +#X text 229 520 <- get data2; +#X text 345 199 <- add to key data2 a list; +#X text 69 193 <- add to key data1 a list; +#X text 32 32 ::: MAP_EXAMPLE :::; +#X text 34 72 With the datastructure "map" it's for example possible +to make send-receive pairs \, you don't have to update the send-receive +pairs all the time (like [value]) \, you can use send-receive "namespaces" +\, ...; +#X text 111 659 ( If you use lists as key you can also make a multidimensional +matrix ... ); +#X connect 1 0 0 0; +#X connect 2 0 0 1; +#X connect 3 0 1 0; +#X connect 3 1 2 0; +#X connect 4 0 3 0; +#X connect 6 0 8 0; +#X connect 6 1 9 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 9 0 5 1; +#X connect 11 0 10 0; +#X connect 13 0 16 0; +#X connect 14 0 13 0; +#X connect 15 0 13 0; +#X restore 41 615 pd map_example; +#X text 273 34 general concept of; +#X text 274 52 PDContainer; +#X text 41 579 In the containers you can save all of the PD build-in +datatypes: lists \, floats \, and symbol.; +#N canvas 215 140 716 600 save_load_example 0; +#X text 27 23 ::: SAVE/LOAD EXAMPLE :::; +#X msg 68 229 pushback one word; +#X msg 90 260 pushback an other word; +#X msg 114 290 pushback something else; +#X obj 68 198 t b b b; +#X obj 68 168 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X obj 68 324 h_list \$0-local; +#X text 93 168 <- add these three lists to h_list; +#X obj 333 321 h_list \$0-local; +#X msg 358 285 print; +#X obj 140 477 h_set blablu; +#X msg 140 413 read example.dat; +#X text 274 413 <- read the same data now into a h_set; +#X text 26 67 You can save and load data from and to disk. So you can +also exchange data through different datastructures with the same data-format +(here from a h_list to a h_set).; +#X msg 178 441 print; +#X msg 333 207 saveXML example.xml; +#X text 457 238 <- save data as file; +#X msg 333 238 save example.dat; +#X text 477 208 <- save data as XML file; +#X msg 140 378 readXML example.xml; +#X text 283 379 <- read the same XML data now into a h_set; +#X text 22 529 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable !; +#X connect 1 0 6 0; +#X connect 2 0 6 0; +#X connect 3 0 6 0; +#X connect 4 0 1 0; +#X connect 4 1 2 0; +#X connect 4 2 3 0; +#X connect 5 0 4 0; +#X connect 9 0 8 0; +#X connect 11 0 10 0; +#X connect 14 0 10 0; +#X connect 15 0 8 0; +#X connect 17 0 8 0; +#X connect 19 0 10 0; +#X restore 40 797 pd save_load_example; +#X text 41 696 All the data of all containers can be saved to disk. +So you can also manually edit the file with an editor (which is sometimes +much faster) and then load it in PD into a container. You can also +load data from other containers. Please use the XML fileformat if possible +\, because it's easier to edit in an external editor and the XML parser +is much more stable.; +#X text 164 671 ::: SAVE/LOAD :::; +#X restore 536 62 pd General_Concept; +#N canvas 205 0 993 742 Container_Explanation 0; +#X obj 14 13 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 16 15 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 254 23 general explation of; +#X text 254 40 the datastructures; +#X text 23 655 A vector is a sequence that supports access to all elements +via index (like an array) and fast insertion and removal of elements +at the end. The number of elements in a vector may vary dynamically. +; +#X obj 189 627 h_vector; +#X text 500 654 Fast insertion and removal anywhere \, all the other +elements move up. But a list provides only sequential access (not via +index !). A list is a doubly linked list.; +#X obj 680 628 h_list; +#X obj 189 773 h_deque; +#X text 498 801 A queue is a "first in first out" (FIFO) data structure. +That is \, elements are added to the back of the queue (push) and may +be removed from the front (pop).; +#X obj 679 774 h_queue; +#X text 22 951 A priority queue is also a "first in first out" (FIFO) +data structure \, but you can give the elements a priority. So the +elements with a higher priority are automatically inserted before all +other elements with a lower priority.; +#X obj 154 924 h_priority_queue; +#X text 20 800 A deque (double ended queue \, pronounced "deck") is +very much like a vector: like vector \, it is a sequence that supports +access to all elements via index. The main way in which deque differs +from vector is that fast insertion and removal of elements is possible +at the beginning _and_ the end.; +#X text 22 232 Maps represent a mapping from one type (the key type) +to another type (the value type). You can associate a value with a +key \, or find the value associated with a key \, very efficiently. +Map is a Sorted Associative Container and it is also a Unique Associative +Container \, meaning that no two elements have the same key. (see Multimap +for more elements with the same key); +#X obj 188 203 h_map; +#X text 492 231 Multimaps are just like maps except that a key can +be associated with several values. Multimap is a Sorted Associative +Container and also a Multiple Associative Container \, meaning that +there is no limit on the number of elements with the same key. (see +also Map); +#X obj 643 201 h_multimap; +#X text 24 419 Sets allow you to add and delete elements. Afterwards +you can look if an element is set. Set is a Sorted Associative Container +and a Unique Associative Container \, meaning that no two elements +are the same. (see Multiset to have several copies of the same element) +; +#X obj 187 392 h_set; +#X text 493 419 Multisets are just like sets \, except that you can +have several copies of the same element. Multiset is a Sorted Associative +Container and a Multiple Associative Container \, meaning that two +or more elements may be identical. (see also Set); +#X obj 642 391 h_multiset; +#X text 339 167 :::: ASSOCIATIVE CONTAINERS ::::; +#X text 393 592 :::: SEQUENCES ::::; +#X text 289 1099 (look for help at all the objects for more information) +; +#X text 35 87 PDContainer contains the following datastructures:; +#X text 399 86 map \, nultimap \, set \, multiset \, vector \, list +\, deque \, queue \, stack \, priority queue; +#X obj 679 916 h_stack; +#X text 495 950 Stack is a "last in first out" (LIFO) data structure: +the element at the top of a stack is the one that was most recently +added (push). Top outputs the elements from the top without removing +it \, pop outputs and removes it.; +#X restore 518 90 pd Container_Explanation; +#N canvas 254 0 927 786 Fileformats 0; +#X obj 38 27 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 +; +#X obj 40 29 cnv 15 400 50 empty empty PDContainer 22 25 0 18 -228992 +-66577 0; +#X text 259 56 PDContainer; +#X text 257 38 different fileformats of; +#X text 472 116 Please use the XML fileformat if possible \, because +it's easier to edit in an external editor and the XML parser is much +more stable!; +#X text 40 582 s go; +#X text 40 569 f 2 s wow f 2; +#X text 40 599 f 23; +#X text 38 634 (f=float \, s=symbol); +#X text 37 171 a) single elements: are the containers h_vector \, h_list +\, h_deque \, h_set \, h_multiset; +#X text 471 172 b) key-value pairs: are the containers h_map and h_multimap +; +#X text 469 276 2.element: symbol go; +#X text 476 698 f 2 s wow - f 2; +#X text 476 712 s go - s not f 34; +#X text 476 729 f 23 - s op; +#X text 488 244 key: list 2 wow; +#X text 470 229 1.element:; +#X text 488 258 value: float 2; +#X text 490 291 key: symbol go; +#X text 490 305 value: list symbol not float 34; +#X text 39 243 1.element: list 2 wow 2; +#X text 39 257 2.element: symbol go; +#X text 38 272 3.element: float 23; +#X text 37 223 a) example1:; +#X text 470 212 b) example2:; +#X text 37 312 a) example1 \, XML:; +#X text 37 339 ; +#X text 37 353 ; +#X text 54 366 ; +#X text 70 379 2 ; +#X text 70 405 2 ; +#X text 56 418 ; +#X text 70 391 wow ; +#X text 56 431 ; +#X text 57 455 ; +#X text 72 443 go ; +#X text 56 468 ; +#X text 57 492 ; +#X text 72 480 23 ; +#X text 41 506 ; +#X text 41 542 a) example1 \, textfile:; +#X text 39 115 You can save the data of the containers to XML files +and normal textfiles (see General_Concept).; +#X text 469 375 ; +#X text 469 389 ; +#X text 486 402 ; +#X text 519 430 2 ; +#X text 520 482 2 ; +#X text 488 506 ; +#X text 519 442 wow ; +#X text 475 634 ; +#X text 469 348 b) example2 \, XML:; +#X text 503 415 ; +#X text 504 456 ; +#X text 503 468 ; +#X text 504 494 ; +#X text 487 519 ; +#X text 489 621 ; +#X text 504 532 ; +#X text 505 559 ; +#X text 504 571 ; +#X text 505 609 ; +#X text 520 545 go ; +#X text 521 584 not ; +#X text 521 597 34 ; +#X text 476 668 b) example2 \, textfile:; +#X restore 550 116 pd Fileformats; +#X text 238 841 htttp://grh.mur.at/software/pdcontainer.html; +#X text 198 825 =%)!(%= PDContainer \, by Georg Holzmann +\, 2004; +#N canvas 174 18 646 402 read_save_possibilities 0; +#X obj 44 336 outlet; +#X msg 44 208 save data.dat; +#X msg 44 244 read data.dat; +#X msg 44 288 readat data.dat 0; +#X text 149 208 <- save all the data of the current namespace as textfile +; +#X text 143 244 <- read this textfile to the current namespace and +insert it at the back (so the size will increase); +#X text 177 287 <- read the textfile and insert it at the given index +(so the size won't increase !); +#X text 166 94 <- read this XML-file to the current namespace and insert +it at the back (so the size will increase); +#X text 169 61 <- save all the data of the current namespace as XML-file +; +#X text 196 139 <- read the XML-file and insert it at the given index +(so the size won't increase !); +#X msg 44 61 saveXML data.xml; +#X msg 44 93 readXML data.xml; +#X msg 44 139 readatXML data.xml 0; +#X connect 1 0 0 0; +#X connect 2 0 0 0; +#X connect 3 0 0 0; +#X connect 10 0 0 0; +#X connect 11 0 0 0; +#X connect 12 0 0 0; +#X restore 480 501 pd read_save_possibilities; +#X text 520 525 different possiblities to read; +#X text 520 539 and write from and to files; +#X text 519 554 (XML and textfiles); +#X msg 480 352 getall; +#X text 532 352 <- dumps out all data sequentially; +#X text 553 366 at the first outlet; +#X connect 5 0 36 0; +#X connect 6 0 36 0; +#X connect 7 0 36 0; +#X connect 9 0 36 0; +#X connect 10 0 36 0; +#X connect 14 0 36 0; +#X connect 24 0 41 1; +#X connect 25 0 41 1; +#X connect 26 0 41 1; +#X connect 27 0 41 1; +#X connect 28 0 41 1; +#X connect 32 0 36 0; +#X connect 33 0 36 0; +#X connect 34 0 32 0; +#X connect 36 0 11 0; +#X connect 36 1 37 0; +#X connect 36 2 8 0; +#X connect 41 0 12 0; +#X connect 41 1 42 0; +#X connect 41 2 0 0; +#X connect 43 0 41 0; +#X connect 44 0 43 0; +#X connect 45 0 46 0; +#X connect 46 0 41 0; +#X connect 47 0 73 0; +#X connect 48 0 47 0; +#X connect 49 0 50 0; +#X connect 50 0 73 0; +#X connect 56 0 58 0; +#X connect 57 0 58 0; +#X connect 59 0 60 0; +#X connect 60 0 58 0; +#X connect 67 0 73 1; +#X connect 74 0 60 0; +#X connect 82 0 36 0; +#X connect 86 0 36 0; diff --git a/pix_recNN/help-pix_recNN.pd b/pix_recNN/help-pix_recNN.pd deleted file mode 100755 index 4236941..0000000 --- a/pix_recNN/help-pix_recNN.pd +++ /dev/null @@ -1,146 +0,0 @@ -#N canvas 871 74 498 783 10; -#X obj 36 327 gemwin; -#X msg 36 301 create \, 1; -#N canvas 75 72 765 790 pix2sig_stuff~ 0; -#X obj 120 35 gemhead; -#X obj 120 132 pix_texture; -#X obj 119 274 outlet~; -#X obj 139 185 square 4; -#X obj 139 163 separator; -#X obj 61 165 separator; -#X obj 120 101 pix_video; -#X msg 186 64 dimen 640 480; -#X obj 26 36 block~ 2048; -#X msg 186 38 dimen 320 240; -#X msg 76 535 getprecision; -#X msg 93 696 getlearnrate; -#X msg 65 671 learnrate 0.2; -#X msg 424 459 getneurons; -#X msg 404 206 train; -#X obj 31 227 inlet~; -#X msg 65 647 learnrate 0.05; -#X msg 381 708 getmemory; -#X msg 361 639 memory 0; -#X msg 361 660 memory 1; -#X obj 61 252 pix_recNN; -#X text 296 49 <- input dimension; -#X obj 78 226 r \$0-recNN; -#X obj 62 564 s \$0-recNN; -#X msg 76 498 precision \$1; -#X floatatom 76 481 5 0 0 0 - - -; -#X text 42 335 precision:; -#X text 53 358 1: means every pixel is used in calculation; -#X text 53 372 2: only every second pixel; -#X text 53 386 ...; -#X obj 62 411 loadbang; -#X msg 407 401 neurons 2048; -#X msg 407 422 neurons 64; -#X obj 407 492 s \$0-recNN; -#X text 403 336 neurons:; -#X text 416 357 nr. of neurons used in the calculation; -#X text 415 370 (_MUST_ be the same as the buffersize !!!); -#X text 43 615 learnrate:; -#X obj 65 725 s \$0-recNN; -#X msg 361 681 memory 3; -#X obj 361 741 s \$0-recNN; -#X text 343 543 memory:; -#X text 356 565 this determines \, how much values from the past the -recurrent net considers in the calculation; -#X text 357 604 (be carefull with large values !!!); -#X msg 62 456 precision 1; -#X msg 62 436 precision 4; -#X obj 404 233 s \$0-recNN; -#X text 397 126 train:; -#X text 417 152 trains the neural net; -#X text 418 166 (the current video frame to; -#X text 425 178 the current audio block); -#X connect 0 0 6 0; -#X connect 1 0 4 0; -#X connect 1 0 5 0; -#X connect 4 0 3 0; -#X connect 5 0 20 0; -#X connect 6 0 1 0; -#X connect 7 0 6 0; -#X connect 9 0 6 0; -#X connect 10 0 23 0; -#X connect 11 0 38 0; -#X connect 12 0 38 0; -#X connect 13 0 33 0; -#X connect 14 0 46 0; -#X connect 15 0 20 0; -#X connect 16 0 38 0; -#X connect 17 0 40 0; -#X connect 18 0 40 0; -#X connect 19 0 40 0; -#X connect 20 1 2 0; -#X connect 22 0 20 0; -#X connect 24 0 23 0; -#X connect 25 0 24 0; -#X connect 30 0 45 0; -#X connect 31 0 33 0; -#X connect 32 0 33 0; -#X connect 39 0 40 0; -#X connect 44 0 23 0; -#X connect 45 0 23 0; -#X restore 89 542 pd pix2sig_stuff~; -#X msg 110 302 0 \, destroy; -#X obj 116 587 unsig~; -#X obj 206 432 osc~ 440; -#X obj 205 456 *~; -#X obj 237 456 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 -1; -#X obj 207 496 sig~ 0; -#X floatatom 117 608 8 0 0 0 - - -; -#X text 25 23 pix_recNN:; -#X text 24 57 pix_recNN is an instument/interface. This instrument -should be useful as a general experimental video interface to generate -audio. You can train the neural net with playing audio samples to specific -video frames in real-time. The main interest for me was not to train -the net exactly to reproduce these samples \, but to make experimental -sounds \, which are "between" all the trained samples.; -#X text 22 214 (but this version is unfinished - e.g. the training -algorithm must be tuned etc. - so it's only a very basic prototype...) -; -#X text 207 320 <- create gemwin; -#X obj 41 442 readsf~; -#X obj 41 401 openpanel; -#X msg 41 421 open \$1; -#X obj 41 380 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X text 67 379 <- load sample for training; -#X obj 122 417 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0 -1; -#X floatatom 206 414 5 0 0 0 - - -; -#X text 272 431 <- simple osc for training; -#X text 262 497 <- to train silence; -#X obj 85 463 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 --1; -#X text 216 541 <- audio/video work; -#X obj 90 684 dac~; -#X obj 90 659 *~; -#X obj 118 659 dbtorms; -#X floatatom 118 641 5 0 0 0 - - -; -#X text 168 638 <- outvol in dB; -#X text 22 170 pix_recNN uses a 2 layer recurrent neural net (for more -detailed info look at the source code.); -#X text 119 737 Georg Holzmann \, 2004; -#X connect 1 0 0 0; -#X connect 2 0 4 0; -#X connect 2 0 26 0; -#X connect 3 0 0 0; -#X connect 4 0 9 0; -#X connect 5 0 6 0; -#X connect 6 0 2 0; -#X connect 7 0 6 1; -#X connect 8 0 2 0; -#X connect 14 0 2 0; -#X connect 14 1 23 0; -#X connect 15 0 16 0; -#X connect 16 0 14 0; -#X connect 17 0 15 0; -#X connect 19 0 14 0; -#X connect 20 0 5 0; -#X connect 26 0 25 0; -#X connect 26 0 25 1; -#X connect 27 0 26 1; -#X connect 28 0 27 0; diff --git a/pix_recNN/pix_recNN-help.pd b/pix_recNN/pix_recNN-help.pd new file mode 100755 index 0000000..4236941 --- /dev/null +++ b/pix_recNN/pix_recNN-help.pd @@ -0,0 +1,146 @@ +#N canvas 871 74 498 783 10; +#X obj 36 327 gemwin; +#X msg 36 301 create \, 1; +#N canvas 75 72 765 790 pix2sig_stuff~ 0; +#X obj 120 35 gemhead; +#X obj 120 132 pix_texture; +#X obj 119 274 outlet~; +#X obj 139 185 square 4; +#X obj 139 163 separator; +#X obj 61 165 separator; +#X obj 120 101 pix_video; +#X msg 186 64 dimen 640 480; +#X obj 26 36 block~ 2048; +#X msg 186 38 dimen 320 240; +#X msg 76 535 getprecision; +#X msg 93 696 getlearnrate; +#X msg 65 671 learnrate 0.2; +#X msg 424 459 getneurons; +#X msg 404 206 train; +#X obj 31 227 inlet~; +#X msg 65 647 learnrate 0.05; +#X msg 381 708 getmemory; +#X msg 361 639 memory 0; +#X msg 361 660 memory 1; +#X obj 61 252 pix_recNN; +#X text 296 49 <- input dimension; +#X obj 78 226 r \$0-recNN; +#X obj 62 564 s \$0-recNN; +#X msg 76 498 precision \$1; +#X floatatom 76 481 5 0 0 0 - - -; +#X text 42 335 precision:; +#X text 53 358 1: means every pixel is used in calculation; +#X text 53 372 2: only every second pixel; +#X text 53 386 ...; +#X obj 62 411 loadbang; +#X msg 407 401 neurons 2048; +#X msg 407 422 neurons 64; +#X obj 407 492 s \$0-recNN; +#X text 403 336 neurons:; +#X text 416 357 nr. of neurons used in the calculation; +#X text 415 370 (_MUST_ be the same as the buffersize !!!); +#X text 43 615 learnrate:; +#X obj 65 725 s \$0-recNN; +#X msg 361 681 memory 3; +#X obj 361 741 s \$0-recNN; +#X text 343 543 memory:; +#X text 356 565 this determines \, how much values from the past the +recurrent net considers in the calculation; +#X text 357 604 (be carefull with large values !!!); +#X msg 62 456 precision 1; +#X msg 62 436 precision 4; +#X obj 404 233 s \$0-recNN; +#X text 397 126 train:; +#X text 417 152 trains the neural net; +#X text 418 166 (the current video frame to; +#X text 425 178 the current audio block); +#X connect 0 0 6 0; +#X connect 1 0 4 0; +#X connect 1 0 5 0; +#X connect 4 0 3 0; +#X connect 5 0 20 0; +#X connect 6 0 1 0; +#X connect 7 0 6 0; +#X connect 9 0 6 0; +#X connect 10 0 23 0; +#X connect 11 0 38 0; +#X connect 12 0 38 0; +#X connect 13 0 33 0; +#X connect 14 0 46 0; +#X connect 15 0 20 0; +#X connect 16 0 38 0; +#X connect 17 0 40 0; +#X connect 18 0 40 0; +#X connect 19 0 40 0; +#X connect 20 1 2 0; +#X connect 22 0 20 0; +#X connect 24 0 23 0; +#X connect 25 0 24 0; +#X connect 30 0 45 0; +#X connect 31 0 33 0; +#X connect 32 0 33 0; +#X connect 39 0 40 0; +#X connect 44 0 23 0; +#X connect 45 0 23 0; +#X restore 89 542 pd pix2sig_stuff~; +#X msg 110 302 0 \, destroy; +#X obj 116 587 unsig~; +#X obj 206 432 osc~ 440; +#X obj 205 456 *~; +#X obj 237 456 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 +1; +#X obj 207 496 sig~ 0; +#X floatatom 117 608 8 0 0 0 - - -; +#X text 25 23 pix_recNN:; +#X text 24 57 pix_recNN is an instument/interface. This instrument +should be useful as a general experimental video interface to generate +audio. You can train the neural net with playing audio samples to specific +video frames in real-time. The main interest for me was not to train +the net exactly to reproduce these samples \, but to make experimental +sounds \, which are "between" all the trained samples.; +#X text 22 214 (but this version is unfinished - e.g. the training +algorithm must be tuned etc. - so it's only a very basic prototype...) +; +#X text 207 320 <- create gemwin; +#X obj 41 442 readsf~; +#X obj 41 401 openpanel; +#X msg 41 421 open \$1; +#X obj 41 380 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 67 379 <- load sample for training; +#X obj 122 417 tgl 25 0 empty empty empty 0 -6 0 8 -195568 -1 -1 0 +1; +#X floatatom 206 414 5 0 0 0 - - -; +#X text 272 431 <- simple osc for training; +#X text 262 497 <- to train silence; +#X obj 85 463 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 +-1; +#X text 216 541 <- audio/video work; +#X obj 90 684 dac~; +#X obj 90 659 *~; +#X obj 118 659 dbtorms; +#X floatatom 118 641 5 0 0 0 - - -; +#X text 168 638 <- outvol in dB; +#X text 22 170 pix_recNN uses a 2 layer recurrent neural net (for more +detailed info look at the source code.); +#X text 119 737 Georg Holzmann \, 2004; +#X connect 1 0 0 0; +#X connect 2 0 4 0; +#X connect 2 0 26 0; +#X connect 3 0 0 0; +#X connect 4 0 9 0; +#X connect 5 0 6 0; +#X connect 6 0 2 0; +#X connect 7 0 6 1; +#X connect 8 0 2 0; +#X connect 14 0 2 0; +#X connect 14 1 23 0; +#X connect 15 0 16 0; +#X connect 16 0 14 0; +#X connect 17 0 15 0; +#X connect 19 0 14 0; +#X connect 20 0 5 0; +#X connect 26 0 25 0; +#X connect 26 0 25 1; +#X connect 27 0 26 1; +#X connect 28 0 27 0; diff --git a/threadlib/doc/help-detach.pd b/threadlib/doc/help-detach.pd deleted file mode 100755 index 03895aa..0000000 --- a/threadlib/doc/help-detach.pd +++ /dev/null @@ -1,105 +0,0 @@ -#N canvas 658 0 480 847 10; -#X obj 29 23 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 -; -#X obj 31 25 cnv 15 400 50 empty empty threadlib 22 25 0 18 -228992 --66577 0; -#X text 322 34 help file of; -#X text 316 50 ::: detach :::; -#X text 39 783 =%)!(%= threadlib \, by Georg Holzmann -\, 2005; -#X text 82 817 htttp://grh.mur.at/software/threadlib.html; -#X text 29 150 Detach is working on control objects only \, creates -a helper thread and runs all functions of the following object in this -helper thread.; -#X text 27 194 If a message form that thread reaches a join object -a callback for running the outlet function will be placed in the scheduler -and run in the next scheduler loop - so you can synchronize the message -with pd's main thread again.; -#X text 173 110 ::: DETACH :::; -#X text 28 251 Detach is useful \, if you have a control operation -that would be too CPU-intensive and would disturb dsp.; -#X obj 223 717 sleep; -#X obj 178 717 join; -#X obj 273 717 threadedsf; -#X text 98 717 see also:; -#X text 163 324 see the examples:; -#X text 154 407 !!!!! WARNING !!!!!; -#X text 30 436 detach/join provide the possibility of threaded patching -\, beware of the risks:; -#X text 30 466 - not every pd object is thread-safe (if unsure \, look -at the source \, ask the pd-list or me); -#X text 31 497 - pd is not completely thread-safe itself; -#X text 31 516 - everything that is triggered by the detached message -will be detached - so don't mix threaded and non-threaded message paths -unless you know what you are doing. use join to synchronize with the -main pd thread !; -#X text 31 575 - if detach/join crashes pd during a performance \, -don't complain ...; -#X text 31 607 - both detach and join have an overhead ... so only -use them if you really need threaded patching \, e.g. have a subpatch -that has to run for quite some time and would interrupt audio or something -else; -#X text 67 800 heavily based on pd_devel code by Tim Blechmann; -#N canvas 421 0 803 576 detach_join_examples 0; -#X msg 117 105 5; -#X obj 117 133 sleep; -#X text 37 39 1) this will block the system for 5 sec:; -#X obj 117 161 print EX1_DONE; -#X text 554 112 (instead of sleep you could; -#X msg 499 73 5; -#X obj 499 123 sleep; -#X text 396 39 2) to avoid this you can run it in a helper thread: -; -#X obj 499 97 detach; -#X obj 499 184 print EX2_DONE; -#X text 560 127 of course use an other cpu; -#X text 559 143 intensive object which could; -#X text 561 158 block the main thread); -#X text 34 252 3) be aware that each object connected to; -#X text 55 267 detach will run in the helper thread:; -#X msg 127 305 5; -#X obj 127 366 sleep; -#X obj 127 330 detach; -#X obj 170 397 print EX3_DONE_1; -#X msg 127 396 5; -#X obj 127 433 sleep; -#X obj 127 514 print EX3_DONE_2; -#X text 179 436 <- also in helper thread; -#X text 164 457 (and anything else connected; -#X text 171 472 to objects which are connected; -#X text 172 487 to detach !); -#X text 392 251 4) to synchronize these objects with pd main thread -; -#X text 413 268 again you have to use the join object:; -#X text 58 56 (so you will get e.g. an 5 sec; -#X text 61 71 audio drop out !); -#X msg 503 303 5; -#X obj 503 364 sleep; -#X obj 503 328 detach; -#X msg 503 394 5; -#X obj 546 395 print EX4_DONE_1; -#X text 579 368 <- in helper thread; -#X obj 503 431 join; -#X obj 503 463 sleep; -#X obj 503 518 print EX4_DONE_2; -#X text 551 464 <- in main thread again; -#X text 551 481 (and will so block the system); -#X connect 0 0 1 0; -#X connect 1 0 3 0; -#X connect 5 0 8 0; -#X connect 6 0 9 0; -#X connect 8 0 6 0; -#X connect 15 0 17 0; -#X connect 16 0 18 0; -#X connect 16 0 19 0; -#X connect 17 0 16 0; -#X connect 19 0 20 0; -#X connect 20 0 21 0; -#X connect 30 0 32 0; -#X connect 31 0 33 0; -#X connect 31 0 34 0; -#X connect 32 0 31 0; -#X connect 33 0 36 0; -#X connect 36 0 37 0; -#X connect 37 0 38 0; -#X restore 141 343 pd detach_join_examples; diff --git a/threadlib/doc/help-join.pd b/threadlib/doc/help-join.pd deleted file mode 100755 index 44fe459..0000000 --- a/threadlib/doc/help-join.pd +++ /dev/null @@ -1,106 +0,0 @@ -#N canvas 280 37 480 847 10; -#X obj 29 23 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 -; -#X obj 31 25 cnv 15 400 50 empty empty threadlib 22 25 0 18 -228992 --66577 0; -#X text 322 34 help file of; -#X text 39 783 =%)!(%= threadlib \, by Georg Holzmann -\, 2005; -#X text 82 817 htttp://grh.mur.at/software/threadlib.html; -#X obj 232 717 sleep; -#X obj 281 717 threadedsf; -#X text 95 717 see also:; -#X text 163 324 see the examples:; -#X text 154 407 !!!!! WARNING !!!!!; -#X text 30 436 detach/join provide the possibility of threaded patching -\, beware of the risks:; -#X text 30 466 - not every pd object is thread-safe (if unsure \, look -at the source \, ask the pd-list or me); -#X text 31 497 - pd is not completely thread-safe itself; -#X text 31 516 - everything that is triggered by the detached message -will be detached - so don't mix threaded and non-threaded message paths -unless you know what you are doing. use join to synchronize with the -main pd thread !; -#X text 31 575 - if detach/join crashes pd during a performance \, -don't complain ...; -#X text 31 607 - both detach and join have an overhead ... so only -use them if you really need threaded patching \, e.g. have a subpatch -that has to run for quite some time and would interrupt audio or something -else; -#X text 67 800 heavily based on pd_devel code by Tim Blechmann; -#N canvas 421 0 803 576 detach_join_examples 0; -#X msg 117 105 5; -#X obj 117 133 sleep; -#X text 37 39 1) this will block the system for 5 sec:; -#X obj 117 161 print EX1_DONE; -#X text 554 112 (instead of sleep you could; -#X msg 499 73 5; -#X obj 499 123 sleep; -#X text 396 39 2) to avoid this you can run it in a helper thread: -; -#X obj 499 97 detach; -#X obj 499 184 print EX2_DONE; -#X text 560 127 of course use an other cpu; -#X text 559 143 intensive object which could; -#X text 561 158 block the main thread); -#X text 34 252 3) be aware that each object connected to; -#X text 55 267 detach will run in the helper thread:; -#X msg 127 305 5; -#X obj 127 366 sleep; -#X obj 127 330 detach; -#X obj 170 397 print EX3_DONE_1; -#X msg 127 396 5; -#X obj 127 433 sleep; -#X obj 127 514 print EX3_DONE_2; -#X text 179 436 <- also in helper thread; -#X text 164 457 (and anything else connected; -#X text 171 472 to objects which are connected; -#X text 172 487 to detach !); -#X text 392 251 4) to synchronize these objects with pd main thread -; -#X text 413 268 again you have to use the join object:; -#X text 58 56 (so you will get e.g. an 5 sec; -#X text 61 71 audio drop out !); -#X msg 503 303 5; -#X obj 503 364 sleep; -#X obj 503 328 detach; -#X msg 503 394 5; -#X obj 546 395 print EX4_DONE_1; -#X text 579 368 <- in helper thread; -#X obj 503 431 join; -#X obj 503 463 sleep; -#X obj 503 518 print EX4_DONE_2; -#X text 551 464 <- in main thread again; -#X text 551 481 (and will so block the system); -#X connect 0 0 1 0; -#X connect 1 0 3 0; -#X connect 5 0 8 0; -#X connect 6 0 9 0; -#X connect 8 0 6 0; -#X connect 15 0 17 0; -#X connect 16 0 18 0; -#X connect 16 0 19 0; -#X connect 17 0 16 0; -#X connect 19 0 20 0; -#X connect 20 0 21 0; -#X connect 30 0 32 0; -#X connect 31 0 33 0; -#X connect 31 0 34 0; -#X connect 32 0 31 0; -#X connect 33 0 36 0; -#X connect 36 0 37 0; -#X connect 37 0 38 0; -#X restore 141 343 pd detach_join_examples; -#X text 321 50 ::: join :::; -#X text 176 109 ::: JOIN :::; -#X obj 175 717 detach; -#X text 31 150 Join synchronizes messages from all threads to the pd -main thread. The message to the inlet will be sent to the outlet during -the next clock callback of the scheduler. It doesn't matter \, which -thread the message was coming from. Messages from the main pd thread -will be rescheduled.; -#X text 30 217 Join can be used everywhere \, where a message has to -be rescheduled \, this is also useful to place behind any threaded -external calling the outlet function from a helper thread - so you -can be sure \, that the following messages are being run in the main -pd thread.; diff --git a/threadlib/doc/help-sleep.pd b/threadlib/doc/help-sleep.pd deleted file mode 100755 index b9c172d..0000000 --- a/threadlib/doc/help-sleep.pd +++ /dev/null @@ -1,88 +0,0 @@ -#N canvas 280 37 465 589 10; -#X obj 29 23 cnv 15 404 54 empty empty empty 22 25 0 18 -1 -66577 0 -; -#X obj 31 25 cnv 15 400 50 empty empty threadlib 22 25 0 18 -228992 --66577 0; -#X text 322 34 help file of; -#X text 27 518 =%)!(%= threadlib \, by Georg Holzmann -\, 2005; -#X text 70 552 htttp://grh.mur.at/software/threadlib.html; -#X obj 261 452 threadedsf; -#X text 83 452 see also:; -#X text 55 535 heavily based on pd_devel code by Tim Blechmann; -#N canvas 421 0 803 576 detach_join_examples 0; -#X msg 117 105 5; -#X obj 117 133 sleep; -#X text 37 39 1) this will block the system for 5 sec:; -#X obj 117 161 print EX1_DONE; -#X text 554 112 (instead of sleep you could; -#X msg 499 73 5; -#X obj 499 123 sleep; -#X text 396 39 2) to avoid this you can run it in a helper thread: -; -#X obj 499 97 detach; -#X obj 499 184 print EX2_DONE; -#X text 560 127 of course use an other cpu; -#X text 559 143 intensive object which could; -#X text 561 158 block the main thread); -#X text 34 252 3) be aware that each object connected to; -#X text 55 267 detach will run in the helper thread:; -#X msg 127 305 5; -#X obj 127 366 sleep; -#X obj 127 330 detach; -#X obj 170 397 print EX3_DONE_1; -#X msg 127 396 5; -#X obj 127 433 sleep; -#X obj 127 514 print EX3_DONE_2; -#X text 179 436 <- also in helper thread; -#X text 164 457 (and anything else connected; -#X text 171 472 to objects which are connected; -#X text 172 487 to detach !); -#X text 392 251 4) to synchronize these objects with pd main thread -; -#X text 413 268 again you have to use the join object:; -#X text 58 56 (so you will get e.g. an 5 sec; -#X text 61 71 audio drop out !); -#X msg 503 303 5; -#X obj 503 364 sleep; -#X obj 503 328 detach; -#X msg 503 394 5; -#X obj 546 395 print EX4_DONE_1; -#X text 579 368 <- in helper thread; -#X obj 503 431 join; -#X obj 503 463 sleep; -#X obj 503 518 print EX4_DONE_2; -#X text 551 464 <- in main thread again; -#X text 551 481 (and will so block the system); -#X connect 0 0 1 0; -#X connect 1 0 3 0; -#X connect 5 0 8 0; -#X connect 6 0 9 0; -#X connect 8 0 6 0; -#X connect 15 0 17 0; -#X connect 16 0 18 0; -#X connect 16 0 19 0; -#X connect 17 0 16 0; -#X connect 19 0 20 0; -#X connect 20 0 21 0; -#X connect 30 0 32 0; -#X connect 31 0 33 0; -#X connect 31 0 34 0; -#X connect 32 0 31 0; -#X connect 33 0 36 0; -#X connect 36 0 37 0; -#X connect 37 0 38 0; -#X restore 135 372 pd detach_join_examples; -#X obj 163 452 detach; -#X text 319 50 ::: sleep :::; -#X text 176 109 ::: SLEEP :::; -#X text 31 149 Sleep simply uses the c-function sleep() and blocks -the system for a specific time.; -#X obj 122 256 sleep; -#X msg 122 226 5; -#X text 159 227 <- sleep time in seconds !; -#X obj 122 287 print SLEEP_OVER; -#X text 154 353 see more examples:; -#X obj 220 452 join; -#X connect 13 0 16 0; -#X connect 14 0 13 0; -- cgit v1.2.1