From 224eb04557a0e96d21faa42ca92b4bf220a44f73 Mon Sep 17 00:00:00 2001 From: Nihilazo Date: Fri, 6 Aug 2021 15:36:57 +0100 Subject: [PATCH] pd stuff --- grid-help.pd | 41 +++++++++ grid.pd | 255 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 296 insertions(+) create mode 100644 grid-help.pd create mode 100644 grid.pd diff --git a/grid-help.pd b/grid-help.pd new file mode 100644 index 0000000..a873388 --- /dev/null +++ b/grid-help.pd @@ -0,0 +1,41 @@ +#N canvas 416 174 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 text 192 147 the set message sets a single LED at the position x +\, y in the first two arguments to either on (1 in the last argument) +or off (0 in the last argument); +#X floatatom 19 464 5 0 0 0 - - -; +#X floatatom 61 465 5 0 0 0 - - -; +#X floatatom 103 466 5 0 0 0 - - -; +#X text 19 489 the grid object's outlets are the x \, y \, and state +(press or release as 1 or 0) of grid button presses.; +#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 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 163 308 there are more messages than this \, with one for each +message "to device" in the monome osc docs: https://monome.org/docs/serialosc/osc/ +the "l" prefixed versions correspond to those with brightness \, others +not; +#X connect 3 0 10 0; +#X connect 3 1 11 0; +#X connect 3 2 12 0; +#X connect 4 0 3 0; +#X connect 5 0 3 0; +#X connect 6 0 3 0; +#X connect 14 0 3 0; +#X connect 15 0 3 0; +#X connect 17 0 3 0; +#X connect 18 0 3 0; diff --git a/grid.pd b/grid.pd new file mode 100644 index 0000000..b3f649c --- /dev/null +++ b/grid.pd @@ -0,0 +1,255 @@ +#N canvas 114 86 1518 875 12; +#X obj 435 446 netsend -b -u; +#X msg 743 296 listen 9999; +#X obj 743 365 oscparse; +#X obj 743 340 netreceive -b -u; +#X obj 435 413 oscformat sys info; +#X msg 435 382 list localhost 9999; +#X msg 577 415 connect localhost \$1; +#X obj 743 390 list split 1; +#X msg 361 360 disconnect; +#X obj 783 422 list trim; +#X msg 655 552 listen \$1; +#X obj 655 577 netreceive -b -u; +#X obj 655 602 oscparse; +#X text 840 388 get rid of the 'sys' prefix; +#X text 809 369 list sys [whatever] \, see monome osc docs; +#X text 732 549 if the message specifies the port; +#X text 778 574 connect to recieve messages; +#X obj 211 533 oscformat; +#X obj 211 558 netsend -b -u; +#X obj 551 239 t f b b f b; +#X msg 197 400 connect localhost \$1; +#X obj 655 637 unpack s s s f f f; +#X text 798 640 unpack for x \, y \, and state; +#X obj 684 698 outlet x; +#X obj 753 698 outlet y; +#X obj 824 698 outlet state; +#X obj 551 37 inlet; +#X obj 633 159 send disconnect; +#X msg 633 132 disconnect; +#X obj 551 100 t b b; +#X obj 477 357 receive disconnect; +#X obj 839 269 receive disconnect; +#X msg 839 294 listen 0; +#X obj 589 488 receive disconnect; +#X msg 589 513 listen 0; +#X obj 783 458 route port prefix; +#X obj 58 509 receive disconnect; +#X text 856 422 get rid of the "list" prefix; +#X obj 1003 557 list fromsymbol; +#X obj 1043 625 list tosymbol; +#X obj 1003 530 symbol; +#X obj 1003 586 list split 1; +#X text 1141 623 remove leading /; +#N canvas 149 141 1177 723 get-device-port 0; +#X obj 370 264 netreceive -b -u; +#X msg 370 204 listen 9999; +#X obj 115 375 netsend -b -u; +#X msg 192 288 connect localhost 12002; +#X msg 115 226 list localhost 9999; +#X obj 370 296 oscparse; +#X obj 370 328 list split 2; +#X obj 410 355 unpack s s f; +#X msg 28 225 disconnect; +#X obj 226 54 t b b b b; +#X obj 187 337 receive disconnect; +#X obj 542 143 receive disconnect; +#X msg 542 168 listen 0; +#X obj 226 28 inlet; +#X obj 491 391 outlet; +#X text 676 11 get-device-port \, on a bang \, connects to serialosc +\, gets the port of the first found monome device \, and returns it +to its outlet. It also will disconnect all ports on a "disconnect" +message sent to the "disconnect" s/r channel.; +#X text 471 327 get rid of the "serialosc/device" prefix; +#X text 510 359 id \, device name \, port; +#X text 442 295 parse serialosc list message; +#X text 673 90 serialosc device connection process: 1 create reciever +for device list \, 2 connect to serialosc \, 3 send serialosc/list +message \, 4 parse contents of message \, 5 disconnect from serialosc. +; +#X obj 115 260 oscformat serialosc list; +#X connect 0 0 5 0; +#X connect 1 0 0 0; +#X connect 3 0 2 0; +#X connect 4 0 20 0; +#X connect 5 0 6 0; +#X connect 6 1 7 0; +#X connect 7 2 14 0; +#X connect 8 0 2 0; +#X connect 9 0 8 0; +#X connect 9 1 4 0; +#X connect 9 2 3 0; +#X connect 9 3 1 0; +#X connect 10 0 2 0; +#X connect 11 0 12 0; +#X connect 12 0 0 0; +#X connect 13 0 9 0; +#X connect 20 0 2 0; +#X restore 551 193 pd get-device-port; +#X obj 551 72 route connect disconnect; +#X text 220 462 Sender for OSC messages; +#X obj 232 482 r grid-message; +#X obj 804 187 s grid-message; +#X obj 1043 693 symbol; +#X obj 1043 732 s grid-osc-prefix; +#N canvas 182 243 407 675 create-osc-messages 1; +#X obj 139 53 inlet; +#X msg 47 280 set \$1 grid led set; +#X obj 83 244 symbol monome; +#X obj 83 208 r grid-osc-prefix; +#X obj 139 96 route set all map row col lset lall lmap lrow lcol; +#X obj 967 559 outlet; +#X obj 29 184 t a b; +#X obj 261 242 symbol monome; +#X obj 261 206 r grid-osc-prefix; +#X obj 207 182 t a b; +#X msg 226 278 set \$1 grid led all; +#X obj 445 247 symbol monome; +#X obj 445 211 r grid-osc-prefix; +#X obj 391 187 t a b; +#X msg 410 283 set \$1 grid led map; +#X obj 634 246 symbol monome; +#X obj 634 210 r grid-osc-prefix; +#X obj 580 186 t a b; +#X msg 599 282 set \$1 grid led row; +#X obj 822 248 symbol monome; +#X obj 822 212 r grid-osc-prefix; +#X obj 768 188 t a b; +#X msg 787 284 set \$1 grid led col; +#X obj 1021 259 symbol monome; +#X obj 1021 223 r grid-osc-prefix; +#X obj 967 199 t a b; +#X obj 1199 257 symbol monome; +#X obj 1199 221 r grid-osc-prefix; +#X obj 1145 197 t a b; +#X obj 1383 262 symbol monome; +#X obj 1383 226 r grid-osc-prefix; +#X obj 1329 202 t a b; +#X obj 1572 261 symbol monome; +#X obj 1572 225 r grid-osc-prefix; +#X obj 1518 201 t a b; +#X obj 1760 263 symbol monome; +#X obj 1760 227 r grid-osc-prefix; +#X obj 1706 203 t a b; +#X msg 964 289 set \$1 grid led level set; +#X msg 1157 294 set \$1 grid led level all; +#X msg 1348 298 set \$1 grid led level map; +#X msg 1537 297 set \$1 grid led level row; +#X msg 1731 298 set \$1 grid led level col; +#X connect 0 0 4 0; +#X connect 1 0 5 0; +#X connect 2 0 1 0; +#X connect 3 0 2 0; +#X connect 4 0 6 0; +#X connect 4 1 9 0; +#X connect 4 2 13 0; +#X connect 4 3 17 0; +#X connect 4 4 21 0; +#X connect 4 5 25 0; +#X connect 4 6 28 0; +#X connect 4 7 31 0; +#X connect 4 9 34 0; +#X connect 4 10 37 0; +#X connect 6 0 5 0; +#X connect 6 1 2 0; +#X connect 7 0 10 0; +#X connect 8 0 7 0; +#X connect 9 0 5 0; +#X connect 9 1 7 0; +#X connect 10 0 5 0; +#X connect 11 0 14 0; +#X connect 12 0 11 0; +#X connect 13 0 5 0; +#X connect 13 1 11 0; +#X connect 14 0 5 0; +#X connect 15 0 18 0; +#X connect 16 0 15 0; +#X connect 17 0 5 0; +#X connect 17 1 15 0; +#X connect 18 0 5 0; +#X connect 19 0 22 0; +#X connect 20 0 19 0; +#X connect 21 0 5 0; +#X connect 21 1 19 0; +#X connect 22 0 5 0; +#X connect 23 0 38 0; +#X connect 24 0 23 0; +#X connect 25 0 5 0; +#X connect 25 1 23 0; +#X connect 26 0 39 0; +#X connect 27 0 26 0; +#X connect 28 0 5 0; +#X connect 28 1 26 0; +#X connect 29 0 40 0; +#X connect 30 0 29 0; +#X connect 31 0 5 0; +#X connect 31 1 29 0; +#X connect 32 0 41 0; +#X connect 33 0 32 0; +#X connect 34 0 5 0; +#X connect 34 1 32 0; +#X connect 35 0 42 0; +#X connect 36 0 35 0; +#X connect 37 0 5 0; +#X connect 37 1 35 0; +#X connect 38 0 5 0; +#X connect 39 0 5 0; +#X connect 40 0 5 0; +#X connect 41 0 5 0; +#X connect 42 0 5 0; +#X restore 804 156 pd create-osc-messages; +#X text 133 125 TODO clean up more \, put things into subpatches; +#X text 133 153 TODO make create-osc-messages not be stupid; +#X msg 720 129 all 0; +#X obj 633 102 t b b; +#X connect 1 0 3 0; +#X connect 2 0 7 0; +#X connect 3 0 2 0; +#X connect 4 0 0 0; +#X connect 5 0 4 0; +#X connect 6 0 0 0; +#X connect 7 1 9 0; +#X connect 8 0 0 0; +#X connect 9 0 35 0; +#X connect 10 0 11 0; +#X connect 11 0 12 0; +#X connect 12 0 21 0; +#X connect 17 0 18 0; +#X connect 19 0 20 0; +#X connect 19 1 8 0; +#X connect 19 2 5 0; +#X connect 19 3 6 0; +#X connect 19 4 1 0; +#X connect 20 0 18 0; +#X connect 21 3 23 0; +#X connect 21 4 24 0; +#X connect 21 5 25 0; +#X connect 26 0 44 0; +#X connect 28 0 27 0; +#X connect 29 0 43 0; +#X connect 29 1 28 0; +#X connect 30 0 0 0; +#X connect 31 0 32 0; +#X connect 32 0 3 0; +#X connect 33 0 34 0; +#X connect 34 0 11 0; +#X connect 35 0 10 0; +#X connect 35 1 40 0; +#X connect 36 0 18 0; +#X connect 38 0 41 0; +#X connect 39 0 48 0; +#X connect 40 0 38 0; +#X connect 41 1 39 0; +#X connect 43 0 19 0; +#X connect 44 0 29 0; +#X connect 44 1 54 0; +#X connect 44 2 50 0; +#X connect 46 0 17 0; +#X connect 48 0 49 0; +#X connect 50 0 47 0; +#X connect 53 0 50 0; +#X connect 54 0 28 0; +#X connect 54 1 53 0; +#X coords 0 875 1 874 85 60 0;