pd/grid-help.pd

94 lines
3.3 KiB
Plaintext

#N canvas 476 252 912 698 12;
#X obj 18 17 grid;
#X text 60 16 - simple I/O for the monome grid;
#X text 18 43 The grid object connects to a running instance of serialosc
and communicates with the first serialosc device as a monome (or compatible)
grid controller.;
#X obj 19 437 grid;
#X msg 21 100 connect;
#X msg 30 124 disconnect;
#X msg 118 148 set 0 0 0;
#X text 76 101 the connect message connects to the grid;
#X text 109 123 the disconnect message disconnects from the grid;
#X msg 114 214 all 1;
#X msg 159 214 all 0;
#X text 203 208 the all message sets all the LEDs on or off;
#X msg 45 148 set 0 0 1;
#X msg 161 275 lset 0 0 5;
#X obj 19 462 unpack f f f;
#X floatatom 19 505 5 0 0 0 - - -;
#X floatatom 59 505 5 0 0 0 - - -;
#X floatatom 100 505 5 0 0 0 - - -;
#N canvas 699 297 690 443 all-messages 0;
#X text 4 3 the [grid] abstraction supports almost all the messages
that the grid supports. Here they all are in pd-form:;
#X msg 8 53 connect;
#X msg 8 78 disconnect;
#X msg 8 103 set x y s;
#X msg 8 128 all s;
#X msg 8 178 col x y b;
#X msg 8 153 row x y b;
#X msg 8 203 map x y b1 b2 [...] b8;
#X msg 8 238 lset x y l;
#X msg 8 263 lall l;
#X msg 8 288 lrow x y l1 l2 [...] l8;
#X msg 8 313 lcol x y l1 l2 [...] l8;
#X msg 8 338 lmap x y l1 l2 [...] l64;
#X text 66 52 connects to a grid;
#X text 91 77 disconnects from a grid;
#X text 80 102 sets the light at x \, y to state s (0=off \, 1=on)
;
#X text 52 127 sets all lights to state s;
#X text 82 152 sets a row with the offset x \, y to the bitmask b;
#X text 82 177 sets a column with the offset x \, y to the bitmask
b;
#X text 174 202 sets a quad with the offset x \, y to the bitmask specified
by b1 through b8 (which all must be specified);
#X text 89 237 sets the light at x \, y to brightness level l (0-15)
;
#X text 58 262 sets all lights to brightness level l;
#X text 180 287 sets a row at the offset x \, y to the levels l1 to
l8;
#X text 184 312 sets a column at the offset x \, y to the levels l1
to l8;
#X text 189 337 sets a quad at the offset x \, y to the levels l1 to
l64;
#X text 6 361 these mostly directly map to the grid's osc messages
\, see https://monome.org/docs/serialosc/osc/ for more docs;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 4 0 6 0;
#X connect 5 0 7 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 10 0 11 0;
#X connect 11 0 12 0;
#X restore 588 305 pd all-messages;
#X text 191 147 the set message sets a single LED at the position x
\, y (the first two arguments) to either on (1 in the last argument)
or off (0 in the last argument);
#X text 245 252 messages prefixed with "l" act like their non-l counterparts
\, but set the brightness level (0-15) rather than just on or off.
;
#X text 109 462 the grid object's outlet is a list of state \, x \,
and y \, every time a button is pressed;
#X text 16 530 KNOWN BUGS: unusual behavior with multiple grid objects
in a patch. Can only use the first serialosc device. May only work
on my machine.;
#X text 245 306 there are more messages than this supported \, see
;
#X connect 3 0 14 0;
#X connect 4 0 3 0;
#X connect 5 0 3 0;
#X connect 6 0 3 0;
#X connect 9 0 3 0;
#X connect 10 0 3 0;
#X connect 12 0 3 0;
#X connect 13 0 3 0;
#X connect 14 0 15 0;
#X connect 14 1 16 0;
#X connect 14 2 17 0;