giuliomoro@358: #N canvas 121 46 877 628 10; giuliomoro@358: #X obj 64 94 r bela_digitalIn11; giuliomoro@358: #X obj 219 94 r bela_digitalIn12; giuliomoro@358: #X obj 386 107 adc~ 13 14; giuliomoro@358: #X text 49 64 Digital in \, message rate; giuliomoro@358: #X text 214 69 Digital in \, message rate; giuliomoro@358: #X text 394 85 Digital ins \, signal rate; giuliomoro@358: #X obj 32 283 s bela_digitalOut15; giuliomoro@358: #X text 13 309 Digital out \, message rate; giuliomoro@358: #X obj 396 593 s bela_setDigital; giuliomoro@358: #X obj 396 533 loadbang; giuliomoro@358: #X msg 431 401 in 11; giuliomoro@358: #X text 524 390 First argument is the pin direction Second argument giuliomoro@358: is the pin number Third argument is the rate \, can be "~" or "sig" giuliomoro@358: for signal-rate or "message" for message-rate. Defaults to message-rate. giuliomoro@358: ; giuliomoro@358: #X msg 431 458 in 13 ~; giuliomoro@358: #X msg 432 429 in 12 message; giuliomoro@358: #X msg 517 506 disable 17; giuliomoro@358: #X obj 386 139 snapshot~; giuliomoro@358: #X obj 500 134 snapshot~; giuliomoro@358: #X obj 529 56 loadbang; giuliomoro@358: #X obj 384 181 print digitalIn13; giuliomoro@358: #X obj 500 183 print digitalIn14; giuliomoro@358: #X obj 497 105 metro 200; giuliomoro@358: #X text 525 474 To stop using a pin (e.g.: to save CPU) \, send a disable giuliomoro@358: message containing the pin number; giuliomoro@358: #X obj 224 280 dac~ 16; giuliomoro@358: #X obj 22 232 metro 500; giuliomoro@358: #X obj 32 257 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 giuliomoro@358: 1; giuliomoro@358: #X obj 224 253 phasor~ 300; giuliomoro@358: #X text 160 234 Nice \, anti-aliased square wave; giuliomoro@358: #X obj 22 207 loadbang; giuliomoro@358: #X text 15 181 Blink that LED!; giuliomoro@358: #X obj 411 306 dac~ 17; giuliomoro@358: #X obj 405 248 osc~ 300; giuliomoro@358: #X obj 470 248 phasor~ 169; giuliomoro@358: #X obj 457 278 -~ 0.5; giuliomoro@358: #X text 403 210 Sum signals together for unpredictable effects; giuliomoro@358: #X obj 612 303 dac~ 18; giuliomoro@358: #X text 198 305 Digital out \, signal rate; giuliomoro@358: #X text 378 325 Digital out \, signal rate; giuliomoro@358: #X text 588 325 Digital out \, signal rate; giuliomoro@358: #X obj 608 222 adc~; giuliomoro@358: #X obj 612 249 *~ 0.5; giuliomoro@358: #X obj 612 276 +~ 0.5; giuliomoro@358: #X text 585 203 The ultimate bit-crusher; giuliomoro@358: #X msg 426 555 in 11 \, in 12 \, in 13 ~ \, in 14 ~ \, out 15 \, out giuliomoro@358: 16 ~ \, out 17 ~ \, out 18 ~; giuliomoro@358: #X text 23 377 Each digital channel can be configured as either an giuliomoro@358: input or an output. Send messages to bela_setDigital to configure the giuliomoro@358: digitalPins (needed before using them). Pins settings can be modified giuliomoro@358: at will during execution. Message-rate input pins receive messages giuliomoro@358: only when the input changes. Message-rate output pins will write to giuliomoro@358: the output the most recent value you send them. Signal-rate inputs giuliomoro@358: and outputs are handled as regular audio channels. Outputs are thresholded giuliomoro@358: to 0.5 before being written to the actual output. Note that each pin giuliomoro@358: that is managed adds to the CPU usage \, so only activate the pins giuliomoro@358: you actually need.; giuliomoro@358: #X text 34 19 Digital channels are numbered 11 to 26 \, which corresponds giuliomoro@358: to Bela's 0 to 15 digital channels. They can be set to respond at message giuliomoro@358: rate or at signal rate; giuliomoro@358: #X obj 415 271 osc~ 1; giuliomoro@358: #X obj 385 157 change; giuliomoro@358: #X obj 500 158 change; giuliomoro@358: #X obj 64 116 print digitalIn11; giuliomoro@358: #X obj 219 117 print digitalIn12; giuliomoro@358: #X connect 0 0 48 0; giuliomoro@358: #X connect 1 0 49 0; giuliomoro@358: #X connect 2 0 15 0; giuliomoro@358: #X connect 2 1 16 0; giuliomoro@358: #X connect 9 0 42 0; giuliomoro@358: #X connect 10 0 8 0; giuliomoro@358: #X connect 12 0 8 0; giuliomoro@358: #X connect 13 0 8 0; giuliomoro@358: #X connect 14 0 8 0; giuliomoro@358: #X connect 15 0 46 0; giuliomoro@358: #X connect 16 0 47 0; giuliomoro@358: #X connect 17 0 20 0; giuliomoro@358: #X connect 20 0 16 0; giuliomoro@358: #X connect 20 0 15 0; giuliomoro@358: #X connect 23 0 24 0; giuliomoro@358: #X connect 24 0 6 0; giuliomoro@358: #X connect 25 0 22 0; giuliomoro@358: #X connect 27 0 23 0; giuliomoro@358: #X connect 30 0 29 0; giuliomoro@358: #X connect 31 0 32 0; giuliomoro@358: #X connect 32 0 29 0; giuliomoro@358: #X connect 38 0 39 0; giuliomoro@358: #X connect 38 1 39 0; giuliomoro@358: #X connect 39 0 40 0; giuliomoro@358: #X connect 40 0 34 0; giuliomoro@358: #X connect 42 0 8 0; giuliomoro@358: #X connect 45 0 29 0; giuliomoro@358: #X connect 46 0 18 0; giuliomoro@358: #X connect 47 0 19 0;