diff options
-rw-r--r-- | Pd_firmware/Pd_firmware.pde | 49 | ||||
-rw-r--r-- | arduino-help.pd | 400 | ||||
-rw-r--r-- | arduino.pd | 183 |
3 files changed, 348 insertions, 284 deletions
diff --git a/Pd_firmware/Pd_firmware.pde b/Pd_firmware/Pd_firmware.pde index 367a6e8..acf96dc 100644 --- a/Pd_firmware/Pd_firmware.pde +++ b/Pd_firmware/Pd_firmware.pde @@ -1,14 +1,15 @@ -/* Pd_firmware
+/* Pd_firmware aka Pduino
* ------------------
+ *
+ * It was designed to work with the Pd object [arduino]
+ * which is included in Pd-extended. This firmware could
+ * easily be used with other programs like Max/MSP, Processing,
+ * or whatever can do serial communications.
*
- *
- * It was designed to work with the Pd patch of the same
- * name in: Help -> Browser -> examples -> hardware
- *
- * (cleft) 2006 Hans-Christoph Steiner
+ * (copyleft) 2006 Hans-Christoph Steiner <hans@at.or.at>
* @author: Hans-Christoph Steiner
- * @date: 2006-03-10
- * @location: Polytechnic University, Brooklyn, New York, USA
+ * @date: 2006-05-19
+ * @location: STEIM, Amsterdam, Netherlands
*/
/*
@@ -57,11 +58,6 @@ * 12 analogIn5 byte0
* 13 analogIn5 byte1
* 14 cycle marker (255/11111111)
- *
- *
- * TX RX
- * -----------------------
- *
*/
/*
@@ -118,8 +114,7 @@ void transmitDigitalInput(byte startPin) { }
else {
// TODO: get digital in working
- // digitalData = digitalRead(digitalPin);
- digitalData = pwmStatus;
+ digitalData = digitalRead(digitalPin);
}
transmitByte = transmitByte + (2^(i+1-startPin)*digitalData);
}
@@ -149,6 +144,9 @@ void setPinMode(int pin, int mode) { }
// -------------------------------------------------------------------------
+/* this function checks to see if there is data waiting on the serial port
+ * then processes all of the stored data
+ */
void checkForInput() {
if(serialAvailable()) {
while(serialAvailable()) {
@@ -243,22 +241,22 @@ void processInput(byte inputData) { waitForPWMData = inputData - 221; // set waitForPWMData to the PWM pin number
setPinMode(waitForPWMData, PWM);
break;
- case 238:
+ case 238: // all digital inputs off
digitalInputsEnabled = false;
break;
- case 239:
+ case 239: // all digital inputs on
digitalInputsEnabled = true;
break;
- case 240:
- case 241:
- case 242:
- case 243:
- case 244:
- case 245:
- case 246:
+ case 240: // analog input off
+ case 241: // analog 0 on
+ case 242: // analog 0,1 on
+ case 243: // analog 0-2 on
+ case 244: // analog 0-3 on
+ case 245: // analog 0-4 on
+ case 246: // analog 0-5 on
analogInputsEnabled = inputData - 240;
break;
- case 255:
+ case 255: // incoming digital output bytes
firstInputByte = true;
break;
}
@@ -292,6 +290,7 @@ void loop() { // filler bytes, since the first thing sent is always the digitalInputs
printByte(0);
printByte(0);
+ checkForInput();
}
/* get analog in, for the number enabled
diff --git a/arduino-help.pd b/arduino-help.pd index bbf0526..c339284 100644 --- a/arduino-help.pd +++ b/arduino-help.pd @@ -1,8 +1,7 @@ -#N canvas 374 0 654 608 10;
-#X obj 478 -14 import cyclone zexy;
-#X msg 200 183 open \$1;
-#N canvas 162 133 530 380 serin 0;
-#X obj 120 61 cnv 15 15 15 empty \$0-number-canvas 2 4 7 0 14 -233017
+#N canvas 302 28 640 574 10;
+#X msg 156 146 open \$1;
+#N canvas 162 133 534 384 serin 0;
+#X obj 120 61 cnv 15 15 15 empty \$0-number-canvas 3 4 8 0 14 -233017
-1 0;
#X obj 200 225 s \$0-number-canvas;
#X obj 60 61 hradio 15 1 0 4 empty empty empty 0 -6 0 8 -225271 -1
@@ -11,7 +10,7 @@ #X obj 60 13 inlet;
#X msg 200 202 label \$1;
#X obj 200 180 makefilename %d;
-#X obj 59 108 float;
+#X obj 59 108 int;
#X connect 2 0 7 0;
#X connect 4 0 2 0;
#X connect 5 0 1 0;
@@ -19,49 +18,37 @@ #X connect 7 0 3 0;
#X connect 7 0 6 0;
#X coords 0 -1 1 1 76 17 1 60 60;
-#X restore 200 160 pd serin;
-#X text 197 142 serial port #;
-#X text 259 552 released under the GNU GPL;
-#X text 45 537 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
+#X restore 156 123 pd serin;
+#X text 153 105 serial port #;
+#X text 400 510 released under the GNU GPL;
+#X text 45 510 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
;
-#X obj 21 394 nbx 4 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X msg 260 183 close;
-#X obj 83 513 print --------------------;
-#X obj 519 330 spigot;
-#X obj 550 312 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-1;
-#X obj 516 355 select 255;
-#X obj 395 29 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -262144 -1
+#X msg 216 146 close;
+#X obj 63 478 print --------------------;
+#X obj 408 289 tgl 15 0 empty empty changes 0 -6 0 8 -262144 -1 -1
+0 1;
+#X obj 293 29 hradio 15 1 0 14 empty empty empty 0 -6 0 8 -262131 -1
-1 0;
-#X obj 372 30 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+#X obj 270 30 tgl 15 0 empty empty empty 0 -6 0 8 -262131 -1 -1 0 1
;
-#X obj 391 102 +;
-#X obj 372 76 * 14;
-#X obj 391 123 + 200;
-#X floatatom 397 146 5 0 0 0 - - -;
-#X obj 395 48 t b f;
-#X obj 538 387 tolist;
-#X obj 541 495 print;
-#X obj 541 476 list;
-#X obj 565 409 list-len;
-#X obj 565 429 change;
-#X obj 456 360 spigot;
-#X obj 489 342 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-1;
-#X obj 567 450 bang;
-#N canvas 295 269 594 315 decode 0;
+#X obj 289 102 +;
+#X obj 270 76 * 14;
+#X obj 289 123 + 200;
+#X floatatom 295 146 5 0 0 0 - - -;
+#X obj 293 48 t b f;
+#X obj 355 292 tgl 15 0 empty empty all 0 -6 0 8 -262144 -1 -1 0 1
+;
+#N canvas 100 289 614 333 decode 0;
#X obj 241 26 inlet;
#X obj 46 189 & 1;
#X obj 72 189 & 2;
#X obj 98 189 & 4;
-#X obj 46 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+#X obj 46 213 tgl 15 0 empty empty 0 4 25 1 12 -262144 -1 -1 0 1;
+#X obj 72 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 2
;
-#X obj 72 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 2 2
+#X obj 98 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 4
;
-#X obj 98 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 4 4
-;
-#X obj 124 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 8
+#X obj 124 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
8;
#X obj 150 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
16;
@@ -71,16 +58,16 @@ 64;
#X obj 248 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
128;
-#X obj 287 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 256
+#X obj 287 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
256;
-#X obj 326 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 512
+#X obj 326 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
512;
-#X obj 365 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 1024
-1024;
+#X obj 365 213 tgl 15 0 empty empty 10 -1 25 1 12 -262144 -1 -1 0 1024
+;
#X obj 409 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
2048;
#X obj 453 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-2;
+4096;
#X obj 499 213 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
4;
#X obj 124 189 & 8;
@@ -123,130 +110,213 @@ #X connect 26 0 15 0;
#X connect 27 0 16 0;
#X connect 28 0 17 0;
-#X restore 344 479 pd decode buttons;
-#X obj 57 10 hsl 128 15 0 1 0 0 empty empty PWM_control_(0-1) -2 -6
+#X restore 473 488 pd decode buttons;
+#X obj 57 23 hsl 128 15 0 1 0 0 empty empty PWM_control_(0-1) -2 -6
1 10 -225271 -1 -1 0 0;
-#X msg 82 473 bang;
-#X obj 255 261 arduino 3;
-#X floatatom 434 50 5 0 0 0 - - -;
-#X text 504 2 7;
-#X text 399 12 0;
-#X text 547 3 10;
-#X msg 54 94 \$2 \$1;
-#X obj 54 72 pack float symbol;
-#X obj 151 53 symbol;
-#X msg 165 31 PWM2;
-#X msg 129 31 PWM1;
-#X msg 94 31 PWM0;
-#X text 357 1 turn on output mode;
-#X obj 259 -11 bng 80 250 50 0 empty empty empty 0 -6 0 8 -258699 -1
--1;
-#X msg 14 122 255 \, 127 \, 127;
-#X obj 203 31 bng 35 250 50 0 empty empty empty 0 -6 0 8 -24198 -1
--1;
-#X obj 195 76 t b b;
-#X text 504 12 0;
-#X text 547 13 3;
-#X msg 13 249 231 \, 1 \, 223 \, 255 \, 0 \, 12;
-#X msg 18 217 255 \, \$1;
-#X obj 17 200 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 64
+#X msg 64 453 bang;
+#X obj 255 274 arduino 3;
+#X floatatom 332 50 5 0 0 0 - - -;
+#X text 402 15 7;
+#X text 297 15 0;
+#X text 443 15 10;
+#X msg 54 107 \$2 \$1;
+#X obj 54 85 pack float symbol;
+#X msg 165 44 PWM2;
+#X msg 129 44 PWM1;
+#X msg 94 44 PWM0;
+#X obj 67 215 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 16383
;
-#X obj 20 179 metro 500;
-#X obj 14 155 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
+#X obj 67 196 metro 500;
+#X obj 67 178 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
-#X msg 114 116 230 \, 1 \, 231 \, 1 \, 220;
-#X obj 456 381 print;
-#X obj 217 314 spigot 0;
-#X obj 260 295 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
-1;
-#X obj 48 365 route analog0 analog1 analog2 analog3 analog4 analog5
+#X obj 21 336 spigot 0;
+#X obj 64 307 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
;
-#X obj 340 435 route digital;
-#X obj 413 455 print GARBAGE;
-#X obj 84 394 nbx 4 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X obj 336 394 nbx 4 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X obj 273 394 nbx 4 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X obj 210 394 nbx 4 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X obj 147 394 nbx 4 16 -1e+037 1e+037 0 0 empty empty empty 0 -6 0
-14 -3754 -1 -1 0 256;
-#X floatatom 287 491 6 0 0 0 - - -;
-#X msg 219 95 3;
-#X obj 373 184 hradio 15 1 1 7 empty empty empty 0 -6 0 8 -262144 -1
+#X obj 21 358 route analog0 analog1 analog2 analog3 analog4 analog5
+;
+#X obj 414 408 route digital;
+#X obj 487 428 print GARBAGE;
+#X floatatom 430 488 6 0 0 0 - - -;
+#X text 393 56 how many analogIns to enable:;
+#X obj 405 117 tgl 15 1 empty empty empty 0 -6 0 8 -257472 -1 -1 1
+1;
+#X text 428 116 enable/disable digitalIns;
+#X msg 405 135 digitalIns \$1;
+#X msg 394 90 analogIns \$1;
+#N canvas 162 133 542 392 serin 0;
+#X obj 165 61 cnv 15 15 15 empty \$0-analog-number-canvas 6 4 8 0 14
+-233017 -1 0;
+#X obj 60 61 hradio 15 1 0 7 empty empty empty 0 -6 0 8 -225280 -1
-1 0;
-#X text 371 168 how many analogIns to enable:;
-#X obj 372 203 + 240;
-#X obj 419 205 tgl 15 1 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+#X obj 59 147 outlet;
+#X obj 60 13 inlet;
+#X msg 200 202 label \$1;
+#X obj 200 180 makefilename %d;
+#X obj 59 108 int;
+#X obj 200 225 send \$0-analog-number-canvas;
+#X connect 1 0 6 0;
+#X connect 3 0 1 0;
+#X connect 4 0 7 0;
+#X connect 5 0 4 0;
+#X connect 6 0 2 0;
+#X connect 6 0 5 0;
+#X coords 0 -1 1 1 121 17 1 60 60;
+#X restore 394 70 pd serin;
+#X text 488 15 13;
+#X text 245 1 turn on output mode for each pin (off = input);
+#X obj 367 462 spigot;
+#X obj 400 444 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
1;
-#X obj 419 223 + 238;
-#X text 442 204 enable/disable digitalIns;
-#X floatatom 359 184 1 0 0 0 - - -;
-#X obj 218 337 speedlim 5;
-#X connect 1 0 30 0;
-#X connect 2 0 1 0;
-#X connect 7 0 30 0;
-#X connect 9 0 11 0;
-#X connect 10 0 9 1;
-#X connect 11 0 19 1;
-#X connect 11 1 19 0;
-#X connect 12 0 18 0;
-#X connect 12 0 31 0;
-#X connect 13 0 15 0;
-#X connect 14 0 16 0;
-#X connect 15 0 14 0;
+#X obj 367 483 print;
+#X msg 381 225 231 \, 20 \, 226 \, 213;
+#X text 5 229 this will flash any pin set to output;
+#N canvas 0 0 261 248 speed 0;
+#X obj 21 41 inlet;
+#X obj 21 62 maxlib/speedlim 100;
+#X obj 21 84 outlet;
+#X obj 82 125 inlet;
+#X obj 82 146 maxlib/speedlim 100;
+#X obj 82 168 outlet;
+#X obj 92 135 inlet;
+#X obj 92 156 maxlib/speedlim 100;
+#X obj 92 178 outlet;
+#X obj 102 145 inlet;
+#X obj 102 166 maxlib/speedlim 100;
+#X obj 102 188 outlet;
+#X obj 112 155 inlet;
+#X obj 112 176 maxlib/speedlim 100;
+#X obj 112 198 outlet;
+#X obj 122 165 inlet;
+#X obj 122 186 maxlib/speedlim 100;
+#X obj 122 208 outlet;
+#X obj 132 175 inlet;
+#X obj 132 196 maxlib/speedlim 100;
+#X obj 132 218 outlet;
+#X connect 0 0 1 0;
+#X connect 1 0 2 0;
+#X connect 3 0 4 0;
+#X connect 4 0 5 0;
+#X connect 6 0 7 0;
+#X connect 7 0 8 0;
+#X connect 9 0 10 0;
+#X connect 10 0 11 0;
+#X connect 12 0 13 0;
+#X connect 13 0 14 0;
+#X connect 15 0 16 0;
#X connect 16 0 17 0;
-#X connect 16 0 30 0;
-#X connect 18 0 15 0;
-#X connect 18 1 14 1;
-#X connect 19 0 21 1;
-#X connect 19 0 22 0;
-#X connect 21 0 20 0;
-#X connect 22 0 23 0;
-#X connect 23 0 26 0;
-#X connect 24 0 54 0;
-#X connect 25 0 24 1;
-#X connect 26 0 21 0;
-#X connect 28 0 36 0;
-#X connect 29 0 8 0;
-#X connect 30 0 55 0;
-#X connect 30 1 9 0;
-#X connect 30 1 24 0;
-#X connect 35 0 30 0;
-#X connect 36 0 35 0;
-#X connect 37 0 36 1;
-#X connect 38 0 37 0;
-#X connect 39 0 37 0;
-#X connect 40 0 37 0;
-#X connect 42 0 7 0;
-#X connect 43 0 30 0;
-#X connect 44 0 45 0;
-#X connect 45 0 53 0;
-#X connect 45 1 66 0;
-#X connect 48 0 30 0;
-#X connect 49 0 30 0;
-#X connect 50 0 49 0;
-#X connect 51 0 50 0;
-#X connect 52 0 51 0;
-#X connect 53 0 30 0;
-#X connect 55 0 74 0;
-#X connect 56 0 55 1;
-#X connect 57 0 6 0;
-#X connect 57 1 60 0;
-#X connect 57 2 64 0;
-#X connect 57 3 63 0;
-#X connect 57 4 62 0;
-#X connect 57 5 61 0;
-#X connect 57 6 58 0;
-#X connect 58 0 27 0;
-#X connect 58 0 65 0;
-#X connect 58 1 59 0;
-#X connect 66 0 2 0;
-#X connect 67 0 69 0;
-#X connect 67 0 73 0;
-#X connect 69 0 30 0;
-#X connect 70 0 71 0;
-#X connect 71 0 30 0;
-#X connect 74 0 57 0;
+#X connect 18 0 19 0;
+#X connect 19 0 20 0;
+#X restore 21 380 pd speed limiting for displaying values with pegging
+the CPU;
+#N canvas 77 268 454 304 debugging 0;
+#X obj 136 31 inlet;
+#X obj 324 29 inlet;
+#X obj 27 31 inlet;
+#X obj 162 81 spigot;
+#X obj 159 106 select 255;
+#X obj 184 246 print;
+#X obj 184 227 list;
+#X obj 96 80 spigot;
+#X obj 210 201 bang;
+#X obj 96 101 print;
+#X obj 181 138 mapping/tolist;
+#X obj 208 181 change;
+#X obj 208 159 list-abs/list-len;
+#X connect 0 0 7 1;
+#X connect 1 0 3 1;
+#X connect 2 0 7 0;
+#X connect 2 0 3 0;
+#X connect 3 0 4 0;
+#X connect 4 0 10 1;
+#X connect 4 1 10 0;
+#X connect 6 0 5 0;
+#X connect 7 0 9 0;
+#X connect 8 0 6 0;
+#X connect 10 0 6 1;
+#X connect 10 0 12 0;
+#X connect 11 0 8 0;
+#X connect 12 0 11 0;
+#X restore 304 311 pd debugging stuff;
+#X text 334 209 use raw data to save settings more compactly;
+#X floatatom 21 405 5 0 0 0 - - -;
+#X floatatom 80 405 5 0 0 0 - - -;
+#X floatatom 139 405 5 0 0 0 - - -;
+#X floatatom 198 405 5 0 0 0 - - -;
+#X floatatom 257 405 5 0 0 0 - - -;
+#X floatatom 316 405 5 0 0 0 - - -;
+#X obj 151 66 symbol;
+#N canvas 0 0 478 328 stress 0;
+#X obj 83 28 inlet;
+#X obj 83 257 outlet;
+#X obj 100 101 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0
+1;
+#X obj 74 130 spigot;
+#X obj 74 154 bang;
+#X obj 74 181 random 2;
+#X obj 19 215 * 16383;
+#X msg 111 216 PWM1 \$1;
+#X connect 0 0 3 0;
+#X connect 2 0 3 1;
+#X connect 3 0 4 0;
+#X connect 4 0 5 0;
+#X connect 5 0 6 0;
+#X connect 6 0 1 0;
+#X connect 7 0 1 0;
+#X coords 0 -1 1 1 85 17 1 100 100;
+#X restore 154 276 pd stress test;
+#X connect 0 0 19 0;
+#X connect 1 0 0 0;
+#X connect 5 0 19 0;
+#X connect 7 0 52 2;
+#X connect 8 0 14 0;
+#X connect 8 0 20 0;
+#X connect 9 0 11 0;
+#X connect 10 0 12 0;
+#X connect 11 0 10 0;
+#X connect 12 0 13 0;
+#X connect 12 0 19 0;
+#X connect 14 0 11 0;
+#X connect 14 1 10 1;
+#X connect 15 0 52 1;
+#X connect 17 0 25 0;
+#X connect 18 0 6 0;
+#X connect 19 0 32 0;
+#X connect 19 0 61 0;
+#X connect 19 1 52 0;
+#X connect 24 0 19 0;
+#X connect 25 0 24 0;
+#X connect 26 0 60 0;
+#X connect 27 0 60 0;
+#X connect 28 0 60 0;
+#X connect 29 0 19 0;
+#X connect 30 0 29 0;
+#X connect 31 0 30 0;
+#X connect 32 0 34 0;
+#X connect 33 0 32 1;
+#X connect 34 0 51 0;
+#X connect 34 1 51 1;
+#X connect 34 2 51 2;
+#X connect 34 3 51 3;
+#X connect 34 4 51 4;
+#X connect 34 5 51 5;
+#X connect 34 6 51 6;
+#X connect 35 0 16 0;
+#X connect 35 0 37 0;
+#X connect 35 0 46 0;
+#X connect 35 1 36 0;
+#X connect 39 0 41 0;
+#X connect 41 0 19 0;
+#X connect 42 0 19 0;
+#X connect 43 0 42 0;
+#X connect 46 0 48 0;
+#X connect 47 0 46 1;
+#X connect 49 0 19 1;
+#X connect 51 0 54 0;
+#X connect 51 1 55 0;
+#X connect 51 2 56 0;
+#X connect 51 3 57 0;
+#X connect 51 4 58 0;
+#X connect 51 5 59 0;
+#X connect 51 6 35 0;
+#X connect 60 0 25 1;
+#X connect 61 0 19 0;
@@ -1,9 +1,8 @@ -#N canvas 81 0 600 527 10;
-#X obj 388 -14 import cyclone zexy;
+#N canvas 81 0 605 522 10;
#X text 390 446 released under the GNU GPL;
-#X text 17 448 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
+#X text 12 446 (C) Copyright 2006 Hans-Christoph Steiner <hans@at.or.at>
;
-#N canvas 630 546 462 312 alternate 0;
+#N canvas 562 456 466 316 alternate 0;
#X obj 87 8 inlet;
#X obj 151 244 outlet;
#X obj 319 247 outlet;
@@ -48,41 +47,21 @@ #X connect 16 0 17 0;
#X connect 17 0 14 1;
#X connect 18 0 13 1;
-#X restore 67 131 pd alternate;
-#X msg 11 100 reset;
-#X obj 121 173 +;
-#X obj 121 194 trigger bang float;
-#X obj 127 345 pack symbol float;
-#X msg 125 228 0;
-#X obj 349 135 gate 4;
-#X obj 340 159 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 358 159 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 377 159 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 396 159 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 387 114 metro 400;
-#X obj 388 94 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1
-;
-#X obj 316 61 float;
-#X obj 359 61 + 1;
-#X obj 316 27 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
--1;
-#X obj 402 59 bang;
-#X msg 335 27 1;
-#X obj 316 83 moses 5;
-#X obj 11 58 select 255;
-#X obj 134 152 * 128;
+#X restore 66 161 pd alternate;
+#X msg 11 130 reset;
+#X obj 120 203 +;
+#X obj 120 224 trigger bang float;
+#X obj 126 375 pack symbol float;
+#X msg 124 258 0;
+#X obj 11 108 select 255;
+#X obj 133 182 * 128;
#X obj 11 -9 inlet;
-#X obj 127 395 outlet;
-#X obj 492 396 outlet;
-#X obj 11 36 comport \$1 9600;
-#N canvas 0 0 466 316 command 0;
+#X obj 126 425 outlet;
+#X obj 494 241 outlet;
+#X obj 11 66 comport \$1 9600;
+#N canvas 240 282 603 439 command 0;
#X obj 79 8 inlet;
-#X obj 313 267 outlet;
-#X obj 79 53 route PWM0 PWM1 PWM2;
+#X obj 55 378 outlet;
#X obj 155 114 * 255;
#X obj 100 114 * 255;
#X obj 45 114 * 255;
@@ -92,67 +71,83 @@ #X msg 155 135 232 \, \$1;
#X msg 100 135 231 \, \$1;
#X msg 45 135 230 \, \$1;
-#X connect 0 0 2 0;
+#X obj 210 94 clip 0 6;
+#X obj 210 135 + 240;
+#X obj 263 94 clip 0 1;
+#X obj 263 115 int;
+#X obj 263 137 + 238;
+#X obj 79 53 route PWM0 PWM1 PWM2 analogIns digitalIns;
+#X obj 322 93 route float;
+#X obj 439 152 & 127;
+#X obj 370 173 & 127;
+#X obj 370 129 trigger float float bang;
+#X msg 494 154 255;
+#X text 337 56 break up digital-out bitmask;
+#X floatatom 321 194 5 0 0 0 - - -;
+#X connect 0 0 16 0;
#X connect 2 0 8 0;
-#X connect 2 1 7 0;
-#X connect 2 2 6 0;
-#X connect 2 3 1 0;
#X connect 3 0 9 0;
#X connect 4 0 10 0;
-#X connect 5 0 11 0;
+#X connect 5 0 2 0;
#X connect 6 0 3 0;
#X connect 7 0 4 0;
-#X connect 8 0 5 0;
+#X connect 8 0 1 0;
#X connect 9 0 1 0;
#X connect 10 0 1 0;
-#X connect 11 0 1 0;
-#X restore 11 12 pd command processing;
-#X obj 67 94 moses 128;
-#X msg 48 316 symbol digital;
-#X obj 143 315 makefilename analog%c;
-#X obj 100 249 float;
-#X obj 139 249 + 1;
-#X obj 127 370 list trim;
-#X obj 100 271 select 0;
-#X text 373 418 DEBUG/RAW data (this will change);
-#X obj 143 293 + 47;
-#X connect 3 0 5 0;
-#X connect 3 1 23 0;
-#X connect 4 0 3 0;
-#X connect 4 0 8 0;
-#X connect 5 0 6 0;
-#X connect 6 0 32 0;
-#X connect 6 1 7 1;
-#X connect 7 0 34 0;
-#X connect 8 0 32 1;
-#X connect 9 0 10 0;
-#X connect 9 1 11 0;
-#X connect 9 2 12 0;
-#X connect 9 3 13 0;
-#X connect 14 0 9 1;
-#X connect 15 0 14 0;
-#X connect 16 0 21 0;
-#X connect 17 0 16 1;
-#X connect 18 0 16 0;
-#X connect 19 0 20 0;
-#X connect 20 0 16 0;
-#X connect 21 0 17 0;
-#X connect 21 0 9 0;
-#X connect 21 1 19 0;
-#X connect 22 0 4 0;
-#X connect 22 1 29 0;
-#X connect 23 0 5 1;
-#X connect 24 0 28 0;
-#X connect 27 0 22 0;
-#X connect 27 0 26 0;
-#X connect 28 0 27 0;
-#X connect 29 0 3 0;
-#X connect 30 0 7 0;
-#X connect 31 0 7 0;
-#X connect 32 0 33 0;
-#X connect 32 0 35 0;
-#X connect 33 0 32 1;
-#X connect 34 0 25 0;
-#X connect 35 0 30 0;
-#X connect 35 1 37 0;
-#X connect 37 0 31 0;
+#X connect 11 0 12 0;
+#X connect 12 0 1 0;
+#X connect 13 0 14 0;
+#X connect 14 0 15 0;
+#X connect 15 0 1 0;
+#X connect 16 0 7 0;
+#X connect 16 1 6 0;
+#X connect 16 2 5 0;
+#X connect 16 3 11 0;
+#X connect 16 4 13 0;
+#X connect 16 5 17 0;
+#X connect 17 0 20 0;
+#X connect 17 1 1 0;
+#X connect 18 0 1 0;
+#X connect 19 0 1 0;
+#X connect 20 2 21 0;
+#X connect 21 0 1 0;
+#X restore 11 22 pd command processing;
+#X obj 66 132 moses 128;
+#X msg 47 346 symbol digital;
+#X obj 142 345 makefilename analog%c;
+#X obj 99 279 float;
+#X obj 138 279 + 1;
+#X obj 126 400 list trim;
+#X obj 99 301 select 0;
+#X text 291 241 DEBUG/RAW data (this will change);
+#X obj 142 323 + 47;
+#X obj 443 -5 inlet;
+#X text 382 -10 raw input;
+#X text 48 -11 processed input;
+#X connect 2 0 4 0;
+#X connect 2 1 9 0;
+#X connect 3 0 2 0;
+#X connect 3 0 7 0;
+#X connect 4 0 5 0;
+#X connect 5 0 18 0;
+#X connect 5 1 6 1;
+#X connect 6 0 20 0;
+#X connect 7 0 18 1;
+#X connect 8 0 3 0;
+#X connect 8 1 15 0;
+#X connect 9 0 4 1;
+#X connect 10 0 14 0;
+#X connect 13 0 8 0;
+#X connect 13 0 12 0;
+#X connect 14 0 13 0;
+#X connect 15 0 2 0;
+#X connect 16 0 6 0;
+#X connect 17 0 6 0;
+#X connect 18 0 19 0;
+#X connect 18 0 21 0;
+#X connect 19 0 18 1;
+#X connect 20 0 11 0;
+#X connect 21 0 16 0;
+#X connect 21 1 23 0;
+#X connect 23 0 17 0;
+#X connect 24 0 13 0;
|