Mercurial > hg > beaglert
changeset 358:5c2f94105c58 prerelease
Added example/help patches for digital in pd
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Wed, 08 Jun 2016 22:04:21 +0100 |
parents | f3dd39be15e4 |
children | 58742af56d37 |
files | examples/pd/digital/bela_digital-help.pd examples/pd/digital/digital_example.pd |
diffstat | 2 files changed, 186 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/pd/digital/bela_digital-help.pd Wed Jun 08 22:04:21 2016 +0100 @@ -0,0 +1,97 @@ +#N canvas 121 46 877 628 10; +#X obj 64 94 r bela_digitalIn11; +#X obj 219 94 r bela_digitalIn12; +#X obj 386 107 adc~ 13 14; +#X text 49 64 Digital in \, message rate; +#X text 214 69 Digital in \, message rate; +#X text 394 85 Digital ins \, signal rate; +#X obj 32 283 s bela_digitalOut15; +#X text 13 309 Digital out \, message rate; +#X obj 396 593 s bela_setDigital; +#X obj 396 533 loadbang; +#X msg 431 401 in 11; +#X text 524 390 First argument is the pin direction Second argument +is the pin number Third argument is the rate \, can be "~" or "sig" +for signal-rate or "message" for message-rate. Defaults to message-rate. +; +#X msg 431 458 in 13 ~; +#X msg 432 429 in 12 message; +#X msg 517 506 disable 17; +#X obj 386 139 snapshot~; +#X obj 500 134 snapshot~; +#X obj 529 56 loadbang; +#X obj 384 181 print digitalIn13; +#X obj 500 183 print digitalIn14; +#X obj 497 105 metro 200; +#X text 525 474 To stop using a pin (e.g.: to save CPU) \, send a disable +message containing the pin number; +#X obj 224 280 dac~ 16; +#X obj 22 232 metro 500; +#X obj 32 257 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 +1; +#X obj 224 253 phasor~ 300; +#X text 160 234 Nice \, anti-aliased square wave; +#X obj 22 207 loadbang; +#X text 15 181 Blink that LED!; +#X obj 411 306 dac~ 17; +#X obj 405 248 osc~ 300; +#X obj 470 248 phasor~ 169; +#X obj 457 278 -~ 0.5; +#X text 403 210 Sum signals together for unpredictable effects; +#X obj 612 303 dac~ 18; +#X text 198 305 Digital out \, signal rate; +#X text 378 325 Digital out \, signal rate; +#X text 588 325 Digital out \, signal rate; +#X obj 608 222 adc~; +#X obj 612 249 *~ 0.5; +#X obj 612 276 +~ 0.5; +#X text 585 203 The ultimate bit-crusher; +#X msg 426 555 in 11 \, in 12 \, in 13 ~ \, in 14 ~ \, out 15 \, out +16 ~ \, out 17 ~ \, out 18 ~; +#X text 23 377 Each digital channel can be configured as either an +input or an output. Send messages to bela_setDigital to configure the +digitalPins (needed before using them). Pins settings can be modified +at will during execution. Message-rate input pins receive messages +only when the input changes. Message-rate output pins will write to +the output the most recent value you send them. Signal-rate inputs +and outputs are handled as regular audio channels. Outputs are thresholded +to 0.5 before being written to the actual output. Note that each pin +that is managed adds to the CPU usage \, so only activate the pins +you actually need.; +#X text 34 19 Digital channels are numbered 11 to 26 \, which corresponds +to Bela's 0 to 15 digital channels. They can be set to respond at message +rate or at signal rate; +#X obj 415 271 osc~ 1; +#X obj 385 157 change; +#X obj 500 158 change; +#X obj 64 116 print digitalIn11; +#X obj 219 117 print digitalIn12; +#X connect 0 0 48 0; +#X connect 1 0 49 0; +#X connect 2 0 15 0; +#X connect 2 1 16 0; +#X connect 9 0 42 0; +#X connect 10 0 8 0; +#X connect 12 0 8 0; +#X connect 13 0 8 0; +#X connect 14 0 8 0; +#X connect 15 0 46 0; +#X connect 16 0 47 0; +#X connect 17 0 20 0; +#X connect 20 0 16 0; +#X connect 20 0 15 0; +#X connect 23 0 24 0; +#X connect 24 0 6 0; +#X connect 25 0 22 0; +#X connect 27 0 23 0; +#X connect 30 0 29 0; +#X connect 31 0 32 0; +#X connect 32 0 29 0; +#X connect 38 0 39 0; +#X connect 38 1 39 0; +#X connect 39 0 40 0; +#X connect 40 0 34 0; +#X connect 42 0 8 0; +#X connect 45 0 29 0; +#X connect 46 0 18 0; +#X connect 47 0 19 0;
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/pd/digital/digital_example.pd Wed Jun 08 22:04:21 2016 +0100 @@ -0,0 +1,89 @@ +#N canvas 279 78 857 690 10; +#X obj 18 477 osc~ 200; +#X obj 57 522 *~; +#X obj 112 405 line~ 1; +#X msg 116 372 1 \, 0 200; +#X obj 205 472 line~ 1; +#X msg 209 439 1 \, 0 200; +#X obj 210 405 select 1; +#X obj 140 531 *~; +#X obj 484 601 s bela_setDigital; +#X obj 484 532 loadbang; +#X msg 65 445 0; +#X obj 116 332 r bela_digitalIn12; +#X obj 422 217 r bela_digitalIn14; +#X obj 422 243 s bela_digitalOut13; +#X obj 285 218 r bela_digitalIn12; +#X obj 285 243 s bela_digitalOut11; +#X obj 374 339 timer; +#X msg 404 304 bang; +#X msg 368 304 bang; +#X obj 555 184 metro 1000; +#X obj 575 304 s bela_digitalOut15; +#X obj 374 366 print sourceto12; +#X obj 488 351 timer; +#X msg 518 316 bang; +#X msg 482 316 bang; +#X obj 487 380 print sourceto14; +#X obj 663 15 r bela_digitalIn16; +#X msg 553 265 1; +#X obj 577 214 delay 500; +#X obj 480 275 select 1; +#X obj 346 268 select 1; +#X msg 584 281 0; +#X obj 634 251 select 1 0; +#X obj 80 622 dac~ 3 4; +#X obj 65 566 expr~ $v1*0.5 + 0.5; +#X obj 138 588 expr~ $v1*0.5 + 0.5; +#X obj 65 202 dac~ 11; +#X obj 114 83 osc~ 300; +#X obj 176 179 dac~ 1 3; +#X obj 34 136 adc~ 17; +#X obj 423 504 delay 3000; +#X msg 388 552 disable 12; +#X msg 484 552 out 11 ~ \, out 13 \, in 14 \, out 15 \, in 16 \, in +17 ~; +#X connect 0 0 1 0; +#X connect 0 0 7 0; +#X connect 1 0 34 0; +#X connect 2 0 1 1; +#X connect 3 0 2 0; +#X connect 4 0 7 1; +#X connect 5 0 4 0; +#X connect 6 0 5 0; +#X connect 6 0 10 0; +#X connect 7 0 35 0; +#X connect 9 0 42 0; +#X connect 9 0 40 0; +#X connect 10 0 0 1; +#X connect 11 0 3 0; +#X connect 12 0 13 0; +#X connect 12 0 29 0; +#X connect 14 0 15 0; +#X connect 14 0 30 0; +#X connect 16 0 21 0; +#X connect 17 0 16 1; +#X connect 18 0 16 0; +#X connect 19 0 27 0; +#X connect 19 0 28 0; +#X connect 22 0 25 0; +#X connect 23 0 22 1; +#X connect 24 0 22 0; +#X connect 26 0 32 0; +#X connect 27 0 20 0; +#X connect 27 0 24 0; +#X connect 27 0 18 0; +#X connect 28 0 31 0; +#X connect 29 0 23 0; +#X connect 30 0 17 0; +#X connect 31 0 20 0; +#X connect 32 0 27 0; +#X connect 32 1 31 0; +#X connect 34 0 33 0; +#X connect 35 0 33 1; +#X connect 37 0 38 0; +#X connect 37 0 38 1; +#X connect 39 0 36 0; +#X connect 40 0 41 0; +#X connect 41 0 8 0; +#X connect 42 0 8 0;