aboutsummaryrefslogtreecommitdiff
path: root/examples/sort.pd
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sort.pd')
-rw-r--r--examples/sort.pd77
1 files changed, 77 insertions, 0 deletions
diff --git a/examples/sort.pd b/examples/sort.pd
new file mode 100644
index 0000000..97729d3
--- /dev/null
+++ b/examples/sort.pd
@@ -0,0 +1,77 @@
+#N canvas 390 217 721 511 10;
+#X obj 86 231 print UNSORTED;
+#X msg 37 107 bang;
+#X obj 198 23 sort;
+#X text 314 87 any package-elements that are non-float will be interpreted as "0.0".;
+#X text 270 87 note :;
+#X obj 53 329 sort 1;
+#X obj 53 470 print ASCENDING;
+#X obj 37 347 sort -1;
+#X obj 37 487 print DESCENDING;
+#X text 278 297 creation : "sort [<dir>]";
+#X text 457 310 dir < 0 :: descending sort;
+#X text 456 297 dir >= 0 :: ascending sort;
+#X text 460 328 dir defaults to ascending;
+#N canvas 360 175 475 254 randompackage 0;
+#X obj 37 190 pack 0 0 0 0 0 0 0 0 0 0 0;
+#X obj 170 87 random 15;
+#X obj 156 104 random 15;
+#X obj 143 121 random 15;
+#X obj 130 138 random 15;
+#X obj 116 155 random 15;
+#X obj 103 172 random 15;
+#X obj 90 87 random 15;
+#X obj 76 104 random 15;
+#X obj 63 121 random 15;
+#X obj 50 138 random 15;
+#X obj 37 155 random 15;
+#X obj 37 52 inlet;
+#X obj 37 69 t b b b b b b b b b b b;
+#X obj 37 210 outlet;
+#X connect 0 0 14 0;
+#X connect 1 0 0 10;
+#X connect 2 0 0 9;
+#X connect 3 0 0 8;
+#X connect 4 0 0 7;
+#X connect 5 0 0 6;
+#X connect 6 0 0 5;
+#X connect 7 0 0 4;
+#X connect 8 0 0 3;
+#X connect 9 0 0 2;
+#X connect 10 0 0 1;
+#X connect 11 0 0 0;
+#X connect 12 0 13 0;
+#X connect 13 0 11 0;
+#X connect 13 1 10 0;
+#X connect 13 2 9 0;
+#X connect 13 3 8 0;
+#X connect 13 4 7 0;
+#X connect 13 5 6 0;
+#X connect 13 6 5 0;
+#X connect 13 7 4 0;
+#X connect 13 8 3 0;
+#X connect 13 9 2 0;
+#X connect 13 10 1 0;
+#X restore 37 195 pd randompackage;
+#X obj 72 177 print;
+#X msg 72 160 -----;
+#X obj 37 141 t b b;
+#X floatatom 88 293;
+#X text 122 295 direction;
+#X obj 37 213 t l l l l;
+#X obj 69 312 sort;
+#X obj 69 453 print SORTED;
+#X text 237 23 shell-sort a package of floats;
+#X connect 1 0 16 0;
+#X connect 5 0 6 0;
+#X connect 7 0 8 0;
+#X connect 13 0 19 0;
+#X connect 15 0 14 0;
+#X connect 16 0 13 0;
+#X connect 16 1 15 0;
+#X connect 17 0 20 1;
+#X connect 19 0 7 0;
+#X connect 19 1 5 0;
+#X connect 19 2 20 0;
+#X connect 19 3 0 0;
+#X connect 20 0 21 0;