aboutsummaryrefslogtreecommitdiff
path: root/experimental/meta-align-grid.pd
diff options
context:
space:
mode:
authorLuke Iannini <lukeiannini@users.sourceforge.net>2009-06-27 03:28:52 +0000
committerLuke Iannini <lukeiannini@users.sourceforge.net>2009-06-27 03:28:52 +0000
commita0372472d4edd03cffdfb4abf1fd2d562a3fd4d1 (patch)
tree862c9766942d9abf36b9e93727b79fc4a4c6f67d /experimental/meta-align-grid.pd
parent13aad8460777c1897b5ddadb616df6b794a0ddf4 (diff)
added some experimental alignment abstractions based on canvasobjectposition:
*meta-align-grid takes an optional gridsize argument (defaults to 10), and aligns all selected objects to the closest multiple of that gridsize (i.e. an object at 16 32 will be placed at 20 30 with the default gridsize of 10) *meta-align-top2leftmost and -left2topmost sort objects left-to-right or top-to-bottom and then line up their topmost or leftmost edges, respectively svn path=/trunk/abstractions/meta-abs/; revision=11822
Diffstat (limited to 'experimental/meta-align-grid.pd')
-rw-r--r--experimental/meta-align-grid.pd63
1 files changed, 63 insertions, 0 deletions
diff --git a/experimental/meta-align-grid.pd b/experimental/meta-align-grid.pd
new file mode 100644
index 0000000..9ad023e
--- /dev/null
+++ b/experimental/meta-align-grid.pd
@@ -0,0 +1,63 @@
+#N canvas 0 22 467 400 10;
+#X obj -211 131 list-drip;
+#X obj -211 247 list-map;
+#X obj -261 217 t a;
+#X obj -211 157 t b a;
+#X obj -211 187 canvasobjectposition 1;
+#X obj -211 107 canvasselect 1;
+#X obj -211 72 inlet;
+#X obj -33 166 loadbang;
+#X obj -33 186 \$1;
+#X obj -33 206 sel 0;
+#X msg -33 226 10;
+#N canvas 0 22 399 321 quantize 0;
+#X obj 170 172 / 2;
+#X obj 139 202 >;
+#X obj 57 219 +;
+#X obj 57 246 *;
+#X obj 207 202 t a;
+#X obj 57 119 t a a;
+#X obj 132 172 fmod;
+#X obj 57 172 /;
+#X obj 57 195 int;
+#X obj 136 120 t a a a a;
+#X obj 136 49 inlet;
+#X obj 57 49 inlet;
+#X obj 57 272 outlet;
+#X text 203 159 if remainder is > 1/2 \,;
+#X text 204 173 quantize to next snappoint;
+#X text 192 167 <;
+#X connect 0 0 1 1;
+#X connect 1 0 2 1;
+#X connect 2 0 3 0;
+#X connect 3 0 12 0;
+#X connect 4 0 3 1;
+#X connect 5 0 7 0;
+#X connect 5 1 6 0;
+#X connect 6 0 1 0;
+#X connect 7 0 8 0;
+#X connect 8 0 2 0;
+#X connect 9 0 7 1;
+#X connect 9 1 6 1;
+#X connect 9 2 0 0;
+#X connect 9 3 4 0;
+#X connect 10 0 9 0;
+#X connect 11 0 5 0;
+#X restore -152 247 pd quantize;
+#X obj -33 247 t a;
+#X connect 0 0 3 0;
+#X connect 1 0 2 0;
+#X connect 1 1 11 0;
+#X connect 2 0 4 0;
+#X connect 3 0 4 0;
+#X connect 3 1 4 1;
+#X connect 4 0 1 0;
+#X connect 5 0 0 0;
+#X connect 6 0 5 0;
+#X connect 7 0 8 0;
+#X connect 8 0 9 0;
+#X connect 9 0 10 0;
+#X connect 9 1 12 0;
+#X connect 10 0 12 0;
+#X connect 11 0 1 1;
+#X connect 12 0 11 1;