From 77bf9d9edd54328ac41e1807c7cea2fb0bcbe3bf Mon Sep 17 00:00:00 2001 From: Luke Iannini Date: Sun, 26 Oct 2008 08:23:30 +0000 Subject: created ds-abs to house a growing collection of data structure manipulation objects svn path=/trunk/abstractions/sfruit/; revision=10350 --- ds-abs/ds-begin-help.pd | 41 ++++++++++++ ds-abs/ds-begin.pd | 13 ++++ ds-abs/ds-dump-array.pd | 20 ++++++ ds-abs/ds-dump-help.pd | 58 +++++++++++++++++ ds-abs/ds-dump-only-help.pd | 84 ++++++++++++++++++++++++ ds-abs/ds-dump-only.pd | 26 ++++++++ ds-abs/ds-dump.pd | 27 ++++++++ ds-abs/ds-end-help.pd | 41 ++++++++++++ ds-abs/ds-end.pd | 26 ++++++++ ds-abs/ds-first-help.pd | 84 ++++++++++++++++++++++++ ds-abs/ds-first.pd | 29 +++++++++ ds-abs/ds-get-list.pd | 70 ++++++++++++++++++++ ds-abs/ds-idx-only-help.pd | 23 +++++++ ds-abs/ds-idx-only.pd | 58 +++++++++++++++++ ds-abs/ds-idx.pd | 36 +++++++++++ ds-abs/ds-next-element.pd | 154 ++++++++++++++++++++++++++++++++++++++++++++ ds-abs/ds-raise-help.pd | 7 ++ ds-abs/ds-raise.pd | 11 ++++ ds-abs/ds-select-help.pd | 39 +++++++++++ ds-abs/ds-select.pd | 22 +++++++ sfruit/ds-begin-help.pd | 41 ------------ sfruit/ds-begin.pd | 13 ---- sfruit/ds-dump-array.pd | 20 ------ sfruit/ds-dump-help.pd | 58 ----------------- sfruit/ds-dump-only-help.pd | 84 ------------------------ sfruit/ds-dump-only.pd | 26 -------- sfruit/ds-dump.pd | 27 -------- sfruit/ds-end-help.pd | 41 ------------ sfruit/ds-end.pd | 26 -------- sfruit/ds-first-help.pd | 84 ------------------------ sfruit/ds-first.pd | 29 --------- sfruit/ds-get-list.pd | 70 -------------------- sfruit/ds-idx-only-help.pd | 23 ------- sfruit/ds-idx-only.pd | 58 ----------------- sfruit/ds-idx.pd | 36 ----------- sfruit/ds-next-element.pd | 154 -------------------------------------------- sfruit/ds-raise-help.pd | 7 -- sfruit/ds-raise.pd | 11 ---- sfruit/ds-select-help.pd | 39 ----------- sfruit/ds-select.pd | 22 ------- 40 files changed, 869 insertions(+), 869 deletions(-) create mode 100644 ds-abs/ds-begin-help.pd create mode 100644 ds-abs/ds-begin.pd create mode 100644 ds-abs/ds-dump-array.pd create mode 100644 ds-abs/ds-dump-help.pd create mode 100644 ds-abs/ds-dump-only-help.pd create mode 100644 ds-abs/ds-dump-only.pd create mode 100644 ds-abs/ds-dump.pd create mode 100644 ds-abs/ds-end-help.pd create mode 100644 ds-abs/ds-end.pd create mode 100644 ds-abs/ds-first-help.pd create mode 100644 ds-abs/ds-first.pd create mode 100644 ds-abs/ds-get-list.pd create mode 100644 ds-abs/ds-idx-only-help.pd create mode 100644 ds-abs/ds-idx-only.pd create mode 100644 ds-abs/ds-idx.pd create mode 100644 ds-abs/ds-next-element.pd create mode 100644 ds-abs/ds-raise-help.pd create mode 100644 ds-abs/ds-raise.pd create mode 100644 ds-abs/ds-select-help.pd create mode 100644 ds-abs/ds-select.pd delete mode 100644 sfruit/ds-begin-help.pd delete mode 100644 sfruit/ds-begin.pd delete mode 100644 sfruit/ds-dump-array.pd delete mode 100644 sfruit/ds-dump-help.pd delete mode 100644 sfruit/ds-dump-only-help.pd delete mode 100644 sfruit/ds-dump-only.pd delete mode 100644 sfruit/ds-dump.pd delete mode 100644 sfruit/ds-end-help.pd delete mode 100644 sfruit/ds-end.pd delete mode 100644 sfruit/ds-first-help.pd delete mode 100644 sfruit/ds-first.pd delete mode 100644 sfruit/ds-get-list.pd delete mode 100644 sfruit/ds-idx-only-help.pd delete mode 100644 sfruit/ds-idx-only.pd delete mode 100644 sfruit/ds-idx.pd delete mode 100644 sfruit/ds-next-element.pd delete mode 100644 sfruit/ds-raise-help.pd delete mode 100644 sfruit/ds-raise.pd delete mode 100644 sfruit/ds-select-help.pd delete mode 100644 sfruit/ds-select.pd diff --git a/ds-abs/ds-begin-help.pd b/ds-abs/ds-begin-help.pd new file mode 100644 index 0000000..b17158d --- /dev/null +++ b/ds-abs/ds-begin-help.pd @@ -0,0 +1,41 @@ +#N struct 1631datatemplate float x float y; +#N canvas 544 342 450 300 10; +#X obj 127 140 ds-begin pd-\$0mydata; +#N canvas 0 22 450 300 \$0datatemplate 0; +#X obj 99 58 drawpolygon 90 3 0 0 0 10 10 10 10 0 0 0; +#X obj 112 95 loadbang; +#X obj 112 124 t b b b; +#X msg 188 127 clear; +#X obj 188 149 s pd-\$0mydata; +#X msg 112 182 0 0 \, 20 0 \, 40 0; +#X obj 131 213 ds-begin pd-\$0mydata; +#X obj 90 247 append \$0datatemplate x y; +#X obj 94 96 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X obj 99 32 struct \$0datatemplate float x float y; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 6 0; +#X connect 2 2 3 0; +#X connect 3 0 4 0; +#X connect 5 0 7 0; +#X connect 6 0 7 2; +#X connect 8 0 2 0; +#X restore 293 88 pd \$0datatemplate; +#N canvas 3 345 126 108 \$0mydata 1; +#X scalar 1631datatemplate 0 0 \;; +#X scalar 1631datatemplate 20 0 \;; +#X scalar 1631datatemplate 40 0 \;; +#X restore 293 110 pd \$0mydata; +#X obj 50 177 append \$0datatemplate x y; +#X obj 50 99 t b b; +#X obj 50 68 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X msg 50 140 20 20; +#X text 8 5 Convenience abstraction for the common task of outputting +the head of a data structure subpatch.; +#X connect 0 0 3 2; +#X connect 4 0 6 0; +#X connect 4 1 0 0; +#X connect 5 0 4 0; +#X connect 6 0 3 0; diff --git a/ds-abs/ds-begin.pd b/ds-abs/ds-begin.pd new file mode 100644 index 0000000..d2322ff --- /dev/null +++ b/ds-abs/ds-begin.pd @@ -0,0 +1,13 @@ +#N canvas 339 80 224 198 10; +#X obj 48 65 list append traverse \$1; +#X obj 48 88 list trim; +#X obj 21 13 inlet; +#X obj 21 36 t b b; +#X obj 21 156 outlet; +#X obj 21 120 pointer; +#X connect 0 0 1 0; +#X connect 1 0 5 0; +#X connect 2 0 3 0; +#X connect 3 0 5 0; +#X connect 3 1 0 0; +#X connect 5 0 4 0; diff --git a/ds-abs/ds-dump-array.pd b/ds-abs/ds-dump-array.pd new file mode 100644 index 0000000..f27db40 --- /dev/null +++ b/ds-abs/ds-dump-array.pd @@ -0,0 +1,20 @@ +#N canvas 1004 477 263 225 10; +#X declare -lib list-abs; +#X declare -lib list-abs; +#X obj 81 29 inlet; +#X obj 81 78 getsize \$1 \$2; +#X obj 81 50 t p p; +#X obj 81 156 element \$1 \$2; +#X obj 81 185 outlet; +#X obj 81 106 list-range; +#X obj 81 131 list-drip; +#X obj 132 185 outlet; +#X obj 140 33 import list-abs; +#X connect 0 0 2 0; +#X connect 1 0 5 0; +#X connect 2 0 1 0; +#X connect 2 1 3 1; +#X connect 3 0 4 0; +#X connect 5 0 6 0; +#X connect 6 0 3 0; +#X connect 6 1 7 0; diff --git a/ds-abs/ds-dump-help.pd b/ds-abs/ds-dump-help.pd new file mode 100644 index 0000000..aa8d298 --- /dev/null +++ b/ds-abs/ds-dump-help.pd @@ -0,0 +1,58 @@ +#N struct datatemplate float x float y; +#N canvas 471 25 394 302 10; +#X text 12 13 Outputs all (input bang) or first n (input float n) pointers +in a subpatch. Takes a subpatch as its argument.; +#X obj 55 136 ds-dump pd-\$0data; +#X obj 55 86 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X text 13 48 Right outlet bangs at end of data.; +#X obj 55 174 get datatemplate x; +#N canvas 450 363 128 100 \$0data 1; +#X scalar datatemplate 10 10 \;; +#X scalar datatemplate 20 20 \;; +#X scalar datatemplate 30 30 \;; +#X scalar datatemplate 40 40 \;; +#X restore 271 116 pd \$0data; +#N canvas 10 355 450 300 datatemplate 0; +#X msg 190 198 traverse pd-\$1data \, bang; +#X obj 190 224 pointer; +#X obj 163 128 loadbang; +#X obj 79 279 append datatemplate x y; +#X msg 17 208 10 10 \, 20 20 \, 30 30 \, 40 40; +#X obj 48 18 struct datatemplate float x float y; +#X obj 48 41 drawpolygon 0 3 0 0 0 10 10 10 10 0 0 0; +#X obj 144 129 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 190 175 \$0; +#X obj 163 153 t b b b; +#X msg 229 153 clear; +#X obj 229 176 s pd-\$0data; +#X connect 0 0 1 0; +#X connect 1 0 3 2; +#X connect 2 0 9 0; +#X connect 4 0 3 0; +#X connect 7 0 9 0; +#X connect 8 0 0 0; +#X connect 9 0 4 0; +#X connect 9 1 8 0; +#X connect 9 2 10 0; +#X connect 10 0 11 0; +#X restore 272 141 pd datatemplate; +#X obj 55 110 t a b; +#X obj 55 200 list-extend; +#X obj 55 224 prepent set; +#X msg 80 85 2; +#X text 269 260 2008 Luke Iannini; +#X text 272 274 proyekto.net; +#X obj 169 137 bng 15 250 50 0 empty empty end 17 7 0 10 -262144 -1 +-1; +#X msg 55 251; +#X connect 1 0 4 0; +#X connect 1 1 13 0; +#X connect 2 0 7 0; +#X connect 4 0 8 0; +#X connect 7 0 1 0; +#X connect 7 1 8 1; +#X connect 8 0 9 0; +#X connect 9 0 14 0; +#X connect 10 0 7 0; diff --git a/ds-abs/ds-dump-only-help.pd b/ds-abs/ds-dump-only-help.pd new file mode 100644 index 0000000..3fe50c1 --- /dev/null +++ b/ds-abs/ds-dump-only-help.pd @@ -0,0 +1,84 @@ +#N struct datatemplatered float x float y; +#N struct datatemplateblue float x float y; +#N canvas 447 356 450 300 10; +#X obj 55 86 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X text 13 48 Right outlet bangs at end of data.; +#N canvas 963 339 134 109 \$0data 1; +#X scalar datatemplatered 30 10 \;; +#X scalar datatemplatered 40 20 \;; +#X scalar datatemplatered 50 30 \;; +#X scalar datatemplatered 60 40 \;; +#X scalar datatemplateblue 10 10 \;; +#X scalar datatemplateblue 20 20 \;; +#X scalar datatemplateblue 30 30 \;; +#X scalar datatemplateblue 40 40 \;; +#X restore 321 56 pd \$0data; +#X obj 55 110 t a b; +#X obj 55 200 list-extend; +#X obj 55 224 prepent set; +#X text 269 260 2008 Luke Iannini; +#X text 272 274 proyekto.net; +#X obj 298 142 bng 15 250 50 0 empty empty end 17 7 0 10 -262144 -1 +-1; +#X msg 55 251; +#N canvas 10 355 450 300 datatemplateblue 0; +#X msg 190 198 traverse pd-\$1data \, bang; +#X obj 190 224 pointer; +#X obj 163 128 loadbang; +#X msg 17 208 10 10 \, 20 20 \, 30 30 \, 40 40; +#X obj 144 129 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 190 175 \$0; +#X msg 229 153 clear; +#X obj 229 176 s pd-\$0data; +#X obj 48 18 struct datatemplateblue float x float y; +#X obj 79 279 append datatemplateblue x y; +#X obj 48 41 drawpolygon 9 3 0 0 0 10 10 10 10 0 0 0; +#X obj 163 153 t b b b b; +#X obj 89 153 s \$0makeRed; +#X connect 0 0 1 0; +#X connect 1 0 9 2; +#X connect 2 0 11 0; +#X connect 3 0 9 0; +#X connect 4 0 11 0; +#X connect 5 0 0 0; +#X connect 6 0 7 0; +#X connect 11 0 12 0; +#X connect 11 1 3 0; +#X connect 11 2 5 0; +#X connect 11 3 6 0; +#X restore 322 81 pd datatemplateblue; +#N canvas 10 355 450 300 datatemplatered 0; +#X msg 190 198 traverse pd-\$1data \, bang; +#X obj 190 224 pointer; +#X obj 144 129 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 190 175 \$0; +#X obj 79 279 append datatemplatered x y; +#X obj 48 18 struct datatemplatered float x float y; +#X obj 48 41 drawpolygon 900 3 0 0 0 10 10 10 10 0 0 0; +#X msg 17 208 30 10 \, 40 20 \, 50 30 \, 60 40; +#X obj 163 152 t b b; +#X obj 163 128 r \$0makeRed; +#X connect 0 0 1 0; +#X connect 1 0 4 2; +#X connect 2 0 8 0; +#X connect 3 0 0 0; +#X connect 7 0 4 0; +#X connect 8 0 7 0; +#X connect 8 1 3 0; +#X connect 9 0 8 0; +#X restore 322 101 pd datatemplatered; +#X text 12 13 Outputs all pointers in a subpatch conforming to a specific +template \, with the rest coming out the middle outlet.; +#X obj 55 174 get datatemplatered x; +#X obj 55 141 ds-dump-only pd-\$0data datatemplatered; +#X connect 0 0 3 0; +#X connect 3 0 14 0; +#X connect 3 1 4 1; +#X connect 4 0 5 0; +#X connect 5 0 9 0; +#X connect 13 0 4 0; +#X connect 14 0 13 0; +#X connect 14 2 8 0; diff --git a/ds-abs/ds-dump-only.pd b/ds-abs/ds-dump-only.pd new file mode 100644 index 0000000..ce3a454 --- /dev/null +++ b/ds-abs/ds-dump-only.pd @@ -0,0 +1,26 @@ +#N canvas 480 22 450 300 10; +#X declare -lib list-abs; +#X obj 182 135 until; +#X msg 182 156 next; +#X obj 56 90 list append \$1; +#X obj 56 113 prepent traverse; +#X obj 56 53 loadbang; +#X obj 182 22 inlet; +#X obj 182 242 outlet; +#X obj 336 242 outlet; +#X obj 317 40 t b b b; +#X obj 242 242 outlet; +#X obj 182 179 pointer \$2; +#X obj 318 18 import list-abs; +#X connect 0 0 1 0; +#X connect 1 0 10 0; +#X connect 2 0 3 0; +#X connect 3 0 10 0; +#X connect 4 0 2 0; +#X connect 5 0 0 0; +#X connect 8 0 2 0; +#X connect 8 1 7 0; +#X connect 8 2 0 1; +#X connect 10 0 6 0; +#X connect 10 1 9 0; +#X connect 10 2 8 0; diff --git a/ds-abs/ds-dump.pd b/ds-abs/ds-dump.pd new file mode 100644 index 0000000..43171b9 --- /dev/null +++ b/ds-abs/ds-dump.pd @@ -0,0 +1,27 @@ +#N canvas 0 22 450 300 10; +#X declare -lib list-abs; +#X obj 182 135 until; +#X obj 182 179 pointer; +#X msg 182 156 next; +#X obj 56 90 list append \$1; +#X obj 56 113 prepent traverse; +#X obj 56 53 loadbang; +#X obj 182 16 inlet; +#X obj 182 242 outlet; +#X obj 336 242 outlet; +#X obj 317 40 t b b b; +#X obj 182 46 t a b; +#X obj 293 16 import list-abs; +#X connect 0 0 2 0; +#X connect 1 0 7 0; +#X connect 1 1 9 0; +#X connect 2 0 1 0; +#X connect 3 0 4 0; +#X connect 4 0 1 0; +#X connect 5 0 3 0; +#X connect 6 0 10 0; +#X connect 9 0 3 0; +#X connect 9 1 8 0; +#X connect 9 2 0 1; +#X connect 10 0 0 0; +#X connect 10 1 3 0; diff --git a/ds-abs/ds-end-help.pd b/ds-abs/ds-end-help.pd new file mode 100644 index 0000000..085b8fd --- /dev/null +++ b/ds-abs/ds-end-help.pd @@ -0,0 +1,41 @@ +#N struct 1635datatemplate float x float y; +#N canvas 0 22 450 300 10; +#N canvas 0 22 450 300 \$0datatemplate 0; +#X obj 99 58 drawpolygon 90 3 0 0 0 10 10 10 10 0 0 0; +#X obj 112 95 loadbang; +#X obj 112 124 t b b b; +#X msg 188 127 clear; +#X obj 188 149 s pd-\$0mydata; +#X msg 112 182 0 0 \, 20 0 \, 40 0; +#X obj 131 213 ds-begin pd-\$0mydata; +#X obj 90 247 append \$0datatemplate x y; +#X obj 94 96 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X obj 99 32 struct \$0datatemplate float x float y; +#X connect 1 0 2 0; +#X connect 2 0 5 0; +#X connect 2 1 6 0; +#X connect 2 2 3 0; +#X connect 3 0 4 0; +#X connect 5 0 7 0; +#X connect 6 0 7 2; +#X connect 8 0 2 0; +#X restore 293 88 pd \$0datatemplate; +#N canvas 3 345 126 108 \$0mydata 1; +#X scalar 1635datatemplate 0 0 \;; +#X scalar 1635datatemplate 20 0 \;; +#X scalar 1635datatemplate 40 0 \;; +#X restore 293 110 pd \$0mydata; +#X obj 50 177 append \$0datatemplate x y; +#X obj 50 99 t b b; +#X obj 50 68 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X obj 127 140 ds-end pd-\$0mydata; +#X msg 50 140 60 0; +#X text 8 4 Outputs the last pointer in a data structure so that one +can append after it.; +#X connect 3 0 6 0; +#X connect 3 1 5 0; +#X connect 4 0 3 0; +#X connect 5 0 2 2; +#X connect 6 0 2 0; diff --git a/ds-abs/ds-end.pd b/ds-abs/ds-end.pd new file mode 100644 index 0000000..df873b1 --- /dev/null +++ b/ds-abs/ds-end.pd @@ -0,0 +1,26 @@ +#N canvas 61 377 261 305 10; +#X declare -lib list-abs; +#X obj 139 175 pointer; +#X obj 139 37 inlet; +#X obj 100 228 pointer; +#X obj 32 113 list append \$1; +#X obj 32 137 prepent traverse; +#X obj 139 60 t b b b; +#X obj 139 110 until; +#X msg 139 140 next; +#X obj 178 198 t b b; +#X obj 100 255 outlet; +#X obj 27 19 import list-abs; +#X connect 0 0 2 1; +#X connect 0 1 8 0; +#X connect 1 0 5 0; +#X connect 2 0 9 0; +#X connect 3 0 4 0; +#X connect 4 0 0 0; +#X connect 5 0 6 0; +#X connect 5 1 0 0; +#X connect 5 2 3 0; +#X connect 6 0 7 0; +#X connect 7 0 0 0; +#X connect 8 0 2 0; +#X connect 8 1 6 1; diff --git a/ds-abs/ds-first-help.pd b/ds-abs/ds-first-help.pd new file mode 100644 index 0000000..a372af1 --- /dev/null +++ b/ds-abs/ds-first-help.pd @@ -0,0 +1,84 @@ +#N struct datatemplatered float x float y; +#N struct datatemplateblue float x float y; +#N canvas 0 22 450 300 10; +#X obj 360 250 ds-first; +#X obj 55 86 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X text 11 30 Right outlet bangs at end of data.; +#N canvas 963 339 134 109 \$0data 1; +#X scalar datatemplatered 30 10 \;; +#X scalar datatemplatered 40 20 \;; +#X scalar datatemplatered 50 30 \;; +#X scalar datatemplatered 60 40 \;; +#X scalar datatemplateblue 10 10 \;; +#X scalar datatemplateblue 20 20 \;; +#X scalar datatemplateblue 30 30 \;; +#X scalar datatemplateblue 40 40 \;; +#X restore 321 56 pd \$0data; +#X obj 55 110 t a b; +#X obj 55 200 list-extend; +#X obj 55 224 prepent set; +#X text 269 260 2008 Luke Iannini; +#X text 272 274 proyekto.net; +#X obj 298 142 bng 15 250 50 0 empty empty end 17 7 0 10 -262144 -1 +-1; +#X msg 55 251 30; +#N canvas 10 355 450 300 datatemplateblue 0; +#X msg 190 198 traverse pd-\$1data \, bang; +#X obj 190 224 pointer; +#X obj 163 128 loadbang; +#X msg 17 208 10 10 \, 20 20 \, 30 30 \, 40 40; +#X obj 144 129 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 190 175 \$0; +#X msg 229 153 clear; +#X obj 229 176 s pd-\$0data; +#X obj 48 18 struct datatemplateblue float x float y; +#X obj 79 279 append datatemplateblue x y; +#X obj 48 41 drawpolygon 9 3 0 0 0 10 10 10 10 0 0 0; +#X obj 163 153 t b b b b; +#X obj 89 153 s \$0makeRed; +#X connect 0 0 1 0; +#X connect 1 0 9 2; +#X connect 2 0 11 0; +#X connect 3 0 9 0; +#X connect 4 0 11 0; +#X connect 5 0 0 0; +#X connect 6 0 7 0; +#X connect 11 0 12 0; +#X connect 11 1 3 0; +#X connect 11 2 5 0; +#X connect 11 3 6 0; +#X restore 322 81 pd datatemplateblue; +#N canvas 10 355 450 300 datatemplatered 0; +#X msg 190 198 traverse pd-\$1data \, bang; +#X obj 190 224 pointer; +#X obj 144 129 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X obj 190 175 \$0; +#X obj 79 279 append datatemplatered x y; +#X obj 48 18 struct datatemplatered float x float y; +#X obj 48 41 drawpolygon 900 3 0 0 0 10 10 10 10 0 0 0; +#X msg 17 208 30 10 \, 40 20 \, 50 30 \, 60 40; +#X obj 163 152 t b b; +#X obj 163 128 r \$0makeRed; +#X connect 0 0 1 0; +#X connect 1 0 4 2; +#X connect 2 0 8 0; +#X connect 3 0 0 0; +#X connect 7 0 4 0; +#X connect 8 0 7 0; +#X connect 8 1 3 0; +#X connect 9 0 8 0; +#X restore 322 101 pd datatemplatered; +#X obj 55 174 get datatemplatered x; +#X text 12 13 Outputs first encountered pointer of a template.; +#X obj 55 141 ds-first pd-\$0data datatemplatered; +#X connect 1 0 4 0; +#X connect 4 0 15 0; +#X connect 4 1 5 1; +#X connect 5 0 6 0; +#X connect 6 0 10 0; +#X connect 13 0 5 0; +#X connect 15 0 13 0; +#X connect 15 1 9 0; diff --git a/ds-abs/ds-first.pd b/ds-abs/ds-first.pd new file mode 100644 index 0000000..9f02641 --- /dev/null +++ b/ds-abs/ds-first.pd @@ -0,0 +1,29 @@ +#N canvas 540 376 450 300 10; +#X declare -lib list-abs; +#X obj 182 135 until; +#X msg 182 156 next; +#X obj 56 90 list append \$1; +#X obj 56 113 prepent traverse; +#X obj 56 53 loadbang; +#X obj 182 22 inlet; +#X obj 209 242 outlet; +#X obj 336 242 outlet; +#X obj 182 179 pointer \$2; +#X obj 182 206 t b a; +#X obj 182 52 t b b; +#X obj 297 50 t b b; +#X obj 289 17 import list-abs; +#X connect 0 0 1 0; +#X connect 1 0 8 0; +#X connect 2 0 3 0; +#X connect 3 0 8 0; +#X connect 4 0 2 0; +#X connect 5 0 10 0; +#X connect 8 0 9 0; +#X connect 8 2 11 0; +#X connect 9 0 11 0; +#X connect 9 1 6 0; +#X connect 10 0 0 0; +#X connect 10 1 2 0; +#X connect 11 0 7 0; +#X connect 11 1 0 1; diff --git a/ds-abs/ds-get-list.pd b/ds-abs/ds-get-list.pd new file mode 100644 index 0000000..b1d4a0e --- /dev/null +++ b/ds-abs/ds-get-list.pd @@ -0,0 +1,70 @@ +#N canvas 539 101 566 566 10; +#X declare -lib list-abs; +#X declare -lib iemlib -lib list-abs; +#N canvas 936 317 494 366 builder 1; +#X obj 182 56 dollarg; +#X obj 182 30 initbang; +#X obj 209 277 s \$0self; +#N canvas 381 63 155 275 makepack 0; +#X obj 11 26 inlet; +#X obj 32 99 until; +#X obj 32 155 list-extend; +#X msg 95 100 pack; +#X msg 32 127 f; +#X obj 11 182 list; +#X obj 11 73 t b a b; +#X obj 11 208 list prepend obj 10 200; +#X obj 11 238 list trim; +#X obj 11 269 outlet; +#X connect 0 0 6 0; +#X connect 1 0 4 0; +#X connect 2 0 5 1; +#X connect 3 0 2 1; +#X connect 4 0 2 0; +#X connect 5 0 7 0; +#X connect 6 0 5 0; +#X connect 6 1 1 0; +#X connect 6 2 3 0; +#X connect 7 0 8 0; +#X connect 8 0 9 0; +#X restore 131 164 pd makepack; +#X msg 221 114 obj 10 10 inlet; +#X msg 111 185 obj 10 300 outlet; +#X obj 126 104 - 1; +#X text 304 73 first arg is template; +#X obj 126 82 f; +#X obj 92 141 t a b a; +#X obj 182 82 t b a b; +#X msg -10 168 connect 2 0 3 0; +#X obj 34 200 list-range; +#X obj 34 221 list-drip; +#X msg 34 252 connect 3 \$1 4 \$1; +#X msg -6 282 connect 4 0 5 0; +#X obj 202 158 list trim; +#X obj 202 135 list prepend obj 10 100 get; +#X obj 310 29 import iemlib list-abs; +#X connect 0 0 10 0; +#X connect 0 1 8 1; +#X connect 1 0 0 0; +#X connect 3 0 2 0; +#X connect 4 0 2 0; +#X connect 5 0 2 0; +#X connect 6 0 9 0; +#X connect 8 0 6 0; +#X connect 9 0 12 0; +#X connect 9 0 11 0; +#X connect 9 0 15 0; +#X connect 9 1 5 0; +#X connect 9 2 3 0; +#X connect 10 0 8 0; +#X connect 10 1 17 0; +#X connect 10 2 4 0; +#X connect 11 0 2 0; +#X connect 12 0 13 0; +#X connect 13 0 14 0; +#X connect 14 0 2 0; +#X connect 15 0 2 0; +#X connect 16 0 2 0; +#X connect 17 0 16 0; +#X restore 311 39 pd builder; +#X obj 310 16 namecanvas \$0self; diff --git a/ds-abs/ds-idx-only-help.pd b/ds-abs/ds-idx-only-help.pd new file mode 100644 index 0000000..02f3c23 --- /dev/null +++ b/ds-abs/ds-idx-only-help.pd @@ -0,0 +1,23 @@ +#N canvas 0 22 450 300 10; +#X text 16 11 ds-idx-only; +#X text 274 254 2008 Luke Iannini; +#X obj 105 89 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X text 123 88 bang for last used index; +#X msg 54 88 10; +#X obj 54 126 ds-idx-only pd-\$0data datatemplate5 3; +#X obj 273 153 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 +-1 -1; +#X text 16 35 outputs the nth pointer of a certain template type \, +or a bang from the right outlet if the nth pointer does not exist. +; +#X obj 54 170 get datatemplate5 x; +#X obj 70 198 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X floatatom 54 223 5 0 0 0 - - -; +#X connect 2 0 5 0; +#X connect 4 0 5 0; +#X connect 5 0 8 0; +#X connect 5 1 6 0; +#X connect 8 0 9 0; +#X connect 8 0 10 0; diff --git a/ds-abs/ds-idx-only.pd b/ds-abs/ds-idx-only.pd new file mode 100644 index 0000000..cf1a76f --- /dev/null +++ b/ds-abs/ds-idx-only.pd @@ -0,0 +1,58 @@ +#N canvas 869 295 378 463 10; +#X declare -lib list-abs -lib iemlib; +#X obj 197 233 sel \$3; +#X obj 197 210 f; +#X obj 221 210 + 1; +#X obj 116 289 pointer; +#X obj 162 346 once; +#X msg 183 325 reset; +#X obj 162 426 outlet; +#X obj 240 75 list append \$1; +#X obj 240 98 prepent traverse; +#X msg 212 187 0; +#X obj 38 85 until; +#X msg 38 109 next; +#X obj 127 102 t b; +#X obj 224 161 route bang; +#X obj 38 131 pointer \$2; +#X obj 144 8 inlet; +#X obj 128 172 t b p; +#X obj 197 255 t b b; +#X obj 183 138 t b b a; +#X obj 144 37 t b b a; +#X obj 127 80 r \$0stop; +#X obj 224 278 s \$0stop; +#X obj 162 375 route bang; +#X obj 232 426 outlet; +#X obj 206 17 import list-abs iemlib; +#X connect 0 0 17 0; +#X connect 1 0 2 0; +#X connect 1 0 0 0; +#X connect 2 0 1 1; +#X connect 3 0 4 0; +#X connect 4 0 22 0; +#X connect 5 0 4 1; +#X connect 7 0 8 0; +#X connect 8 0 14 0; +#X connect 9 0 1 1; +#X connect 10 0 11 0; +#X connect 11 0 14 0; +#X connect 12 0 10 1; +#X connect 13 1 0 1; +#X connect 14 0 16 0; +#X connect 14 2 12 0; +#X connect 14 2 4 0; +#X connect 15 0 19 0; +#X connect 16 0 1 0; +#X connect 16 1 3 1; +#X connect 17 0 3 0; +#X connect 17 1 21 0; +#X connect 18 0 5 0; +#X connect 18 1 9 0; +#X connect 18 2 13 0; +#X connect 19 0 10 0; +#X connect 19 1 7 0; +#X connect 19 2 18 0; +#X connect 20 0 12 0; +#X connect 22 0 23 0; +#X connect 22 1 6 0; diff --git a/ds-abs/ds-idx.pd b/ds-abs/ds-idx.pd new file mode 100644 index 0000000..d6955f1 --- /dev/null +++ b/ds-abs/ds-idx.pd @@ -0,0 +1,36 @@ +#N canvas 692 40 319 298 10; +#X declare -lib list-abs; +#X obj 64 28 inlet; +#X obj 166 134 list append \$1; +#X obj 166 157 prepent traverse; +#X obj 64 56 t a b; +#X obj 103 195 pointer; +#X obj 64 234 pointer; +#X msg 103 170 next; +#X obj 103 136 until; +#X obj 64 92 t b a; +#X obj 64 261 outlet; +#X obj 142 262 outlet; +#X obj 142 234 t b b; +#X obj 136 87 list append \$1; +#X obj 91 114 spigot 1; +#X obj 136 65 loadbang; +#X text 192 69 until protection; +#X obj 146 34 import list-abs; +#X connect 0 0 3 0; +#X connect 1 0 2 0; +#X connect 2 0 4 0; +#X connect 3 0 8 0; +#X connect 3 1 1 0; +#X connect 4 0 5 1; +#X connect 4 1 11 0; +#X connect 5 0 9 0; +#X connect 6 0 4 0; +#X connect 7 0 6 0; +#X connect 8 0 5 0; +#X connect 8 1 13 0; +#X connect 11 0 10 0; +#X connect 11 1 7 1; +#X connect 12 0 13 1; +#X connect 13 0 7 0; +#X connect 14 0 12 0; diff --git a/ds-abs/ds-next-element.pd b/ds-abs/ds-next-element.pd new file mode 100644 index 0000000..43c7d4b --- /dev/null +++ b/ds-abs/ds-next-element.pd @@ -0,0 +1,154 @@ +#N canvas 453 22 467 768 10; +#X declare -lib iemlib; +#X obj 133 259 f; +#X obj 160 259 + 1; +#X obj 133 237 until; +#X obj 118 701 once; +#X obj 199 603 t a; +#X obj 133 579 &&; +#X obj 160 327 + 1; +#X obj 133 640 f; +#X obj 133 600 sel 1; +#X obj 91 9 inlet; +#X obj 170 527 r \$0findValue; +#X obj 137 30 s \$0findValue; +#X msg 148 215 0; +#X obj 118 736 outlet; +#X obj 91 73 t p p; +#X obj 133 552 <=; +#X obj 160 552 >; +#X obj 133 306 t a a; +#X obj 133 665 t a b; +#X obj 172 665 s \$0stopLooking; +#X obj 170 237 r \$0stopLooking; +#X obj 160 346 t a a a; +#X obj 296 554 sel 1; +#X obj 296 382 >; +#X obj 311 358 - 1; +#X obj 91 116 sel 1; +#X obj 137 74 s \$0pointer; +#X obj 225 404 r \$0pointer; +#X obj 133 281 sel 0; +#X obj 245 467 t a b; +#N canvas 0 22 448 336 earliest? 0; +#X obj 82 74 inlet; +#X obj 157 97 r \$0pointer; +#X msg 82 100 0; +#X obj 97 178 r \$0findValue; +#X obj 82 206 >; +#X obj 82 232 sel 1; +#X obj 129 294 outlet; +#X msg 129 270 0; +#X msg 55 270 0; +#X obj 55 294 outlet; +#X obj 82 129 element \$1 \$2; +#X obj 82 154 get \$3 \$4; +#X connect 0 0 2 0; +#X connect 1 0 10 1; +#X connect 2 0 10 0; +#X connect 3 0 4 1; +#X connect 4 0 5 0; +#X connect 5 0 7 0; +#X connect 5 1 8 0; +#X connect 7 0 6 0; +#X connect 8 0 9 0; +#X connect 10 0 11 0; +#X connect 11 0 4 0; +#X restore 174 293 pd earliest?; +#X obj 272 513 s \$0stopLooking; +#X obj 245 642 t a; +#N canvas 848 394 186 293 first 0; +#X obj 13 10 inlet; +#X obj 88 41 r \$0pointer; +#X obj 27 252 outlet; +#X obj 13 90 t p p; +#X obj 28 139 r \$0findValue; +#X obj 13 188 sel 1; +#X obj 13 162 >; +#X msg 13 43 0; +#X msg 13 218 0; +#X msg 40 218 1; +#X obj 13 115 get \$3 \$4; +#X obj 13 68 element \$1 \$2; +#X connect 0 0 7 0; +#X connect 1 0 11 1; +#X connect 3 0 10 0; +#X connect 4 0 6 1; +#X connect 5 0 8 0; +#X connect 5 1 9 0; +#X connect 6 0 5 0; +#X connect 7 0 11 0; +#X connect 8 0 2 0; +#X connect 9 0 2 0; +#X connect 10 0 6 0; +#X connect 11 0 3 0; +#X restore 18 372 pd first; +#X obj 91 96 getsize \$1 \$2; +#X obj 160 434 element \$1 \$2; +#X obj 133 481 element \$1 \$2; +#X obj 160 453 get \$3 \$4; +#X obj 133 504 get \$3 \$4; +#X text 240 48 takes a pointer to an array; +#X obj 200 147 s \$0reset; +#X obj 118 147 t b a b a b; +#X obj 151 701 r \$0reset; +#X obj 315 34 inlet; +#X obj 91 51 pointer; +#X obj 91 30 t b a; +#X obj 282 128 import iemlib; +#X connect 0 0 1 0; +#X connect 0 0 28 0; +#X connect 1 0 0 1; +#X connect 2 0 0 0; +#X connect 3 0 13 0; +#X connect 4 0 7 1; +#X connect 5 0 8 0; +#X connect 6 0 21 0; +#X connect 7 0 18 0; +#X connect 8 0 7 0; +#X connect 9 0 45 0; +#X connect 10 0 15 1; +#X connect 10 0 16 1; +#X connect 12 0 0 1; +#X connect 14 0 34 0; +#X connect 14 1 26 0; +#X connect 15 0 5 0; +#X connect 16 0 5 1; +#X connect 17 0 36 0; +#X connect 17 1 6 0; +#X connect 18 0 3 0; +#X connect 18 1 19 0; +#X connect 20 0 2 1; +#X connect 21 0 35 0; +#X connect 21 1 23 0; +#X connect 21 2 4 0; +#X connect 22 0 7 0; +#X connect 23 0 22 0; +#X connect 24 0 23 1; +#X connect 25 0 33 0; +#X connect 25 1 41 0; +#X connect 27 0 35 1; +#X connect 27 0 36 1; +#X connect 28 0 30 0; +#X connect 28 1 17 0; +#X connect 29 0 32 0; +#X connect 29 1 31 0; +#X connect 30 0 17 0; +#X connect 30 1 29 0; +#X connect 32 0 3 0; +#X connect 33 0 13 0; +#X connect 34 0 25 0; +#X connect 35 0 37 0; +#X connect 36 0 38 0; +#X connect 37 0 16 0; +#X connect 38 0 15 0; +#X connect 41 0 3 0; +#X connect 41 1 2 0; +#X connect 41 2 12 0; +#X connect 41 3 24 0; +#X connect 41 4 40 0; +#X connect 42 0 3 1; +#X connect 43 0 44 1; +#X connect 44 0 14 0; +#X connect 45 0 44 0; +#X connect 45 1 11 0; diff --git a/ds-abs/ds-raise-help.pd b/ds-abs/ds-raise-help.pd new file mode 100644 index 0000000..224b183 --- /dev/null +++ b/ds-abs/ds-raise-help.pd @@ -0,0 +1,7 @@ +#N canvas 796 410 318 141 10; +#X obj 23 104 ds-raise pd-myData myTemplate; +#X text 7 4 [ds-raise] - hack to bring the first template in a datastructure +to the top; +#X obj 23 83 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X connect 2 0 0 0; diff --git a/ds-abs/ds-raise.pd b/ds-abs/ds-raise.pd new file mode 100644 index 0000000..c51b952 --- /dev/null +++ b/ds-abs/ds-raise.pd @@ -0,0 +1,11 @@ +#N canvas 814 246 126 152 10; +#X obj 12 58 t p p; +#X obj 12 34 ds-first \$1 \$2; +#X obj 12 82 get \$2 x; +#X obj 12 107 set \$2 x; +#X obj 12 10 inlet; +#X connect 0 0 2 0; +#X connect 0 1 3 1; +#X connect 1 0 0 0; +#X connect 2 0 3 0; +#X connect 4 0 1 0; diff --git a/ds-abs/ds-select-help.pd b/ds-abs/ds-select-help.pd new file mode 100644 index 0000000..1143418 --- /dev/null +++ b/ds-abs/ds-select-help.pd @@ -0,0 +1,39 @@ +#N canvas 1 22 450 300 10; +#N canvas 0 22 450 300 \$0data 0; +#X restore 313 163 pd \$0data; +#N canvas 535 125 450 300 createdata 0; +#X obj 212 101 \$0; +#X msg 212 125 traverse pd-\$1data \, bang; +#X obj 212 148 pointer; +#X obj 23 181 append \$0mytemplate x y velocity; +#X obj 23 23 loadbang; +#X obj 23 44 t b b; +#X msg 23 116 50 60 70; +#X connect 0 0 1 0; +#X connect 1 0 2 0; +#X connect 2 0 3 3; +#X connect 4 0 5 0; +#X connect 5 0 6 0; +#X connect 5 1 0 0; +#X connect 6 0 3 0; +#X restore 312 199 pd createdata; +#N canvas 479 22 359 135 \$0mytemplate 0; +#X obj 17 18 struct \$0mytemplate float x float y float velocity; +#X obj 17 48 drawpolygon 900 1 0 0 0 10 10 10 10 0 0 0; +#X restore 312 136 pd \$0mytemplate; +#X obj 19 129 ds-dump pd-\$0data; +#X obj 19 91 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1 +-1; +#X obj 19 163 ds-select \$0mytemplate velocity 52; +#X obj 19 188 get \$0mytemplate x y; +#X floatatom 19 218 5 0 0 0 - - -; +#X floatatom 136 218 5 0 0 0 - - -; +#X text 7 5 [ds-select] outputs pointers to elements whose attribute +value matches its arguments. Non-matching pointers are sent to the +right outlet. Call like [ds-select