comparison examples/08-PureData/digital/_main.pd @ 531:ddb86944e138 prerelease

cleaned up all pd examples (and removed some). added polysynth and vangelisiser to instruments examples
author chnrx <chris.heinrichs@gmail.com>
date Thu, 23 Jun 2016 20:40:05 +0100
parents 4d5edf7ee953
children f8bb6186498d
comparison
equal deleted inserted replaced
525:1ca196e35105 531:ddb86944e138
1 #N canvas 272 16 857 690 10; 1 #N canvas 1059 41 685 1592 10;
2 #X obj 18 477 osc~ 200; 2 #X obj 60 800 r bela_digitalIn11;
3 #X obj 57 522 *~; 3 #X obj 272 800 r bela_digitalIn12;
4 #X obj 112 405 line~ 1; 4 #X obj 60 897 adc~ 13 14;
5 #X msg 116 372 1 \, 0 200; 5 #X text 56 869 Digital ins \, signal rate;
6 #X obj 205 472 line~ 1; 6 #X obj 58 1144 s bela_digitalOut15;
7 #X msg 209 439 1 \, 0 200; 7 #X text 56 1040 Digital out \, message rate;
8 #X obj 210 405 select 1; 8 #X obj 59 695 s bela_setDigital;
9 #X obj 140 531 *~; 9 #X obj 82 618 loadbang;
10 #X obj 534 622 s bela_setDigital; 10 #X msg 83 473 in 11;
11 #X obj 534 553 loadbang; 11 #X msg 83 530 in 13 ~;
12 #X msg 65 445 0; 12 #X msg 83 501 in 12 message;
13 #X obj 116 332 r bela_digitalIn12; 13 #X msg 83 567 disable 17;
14 #X obj 422 217 r bela_digitalIn14; 14 #X obj 60 943 snapshot~;
15 #X obj 422 243 s bela_digitalOut13; 15 #X obj 194 944 snapshot~;
16 #X obj 285 218 r bela_digitalIn12; 16 #X obj 194 896 loadbang;
17 #X obj 285 243 s bela_digitalOut11; 17 #X obj 60 991 print digitalIn13;
18 #X obj 374 339 timer; 18 #X obj 194 991 print digitalIn14;
19 #X msg 404 304 bang; 19 #X obj 194 917 metro 200;
20 #X msg 368 304 bang; 20 #X obj 60 1245 dac~ 16;
21 #X obj 556 160 metro 1000; 21 #X obj 58 1093 metro 500;
22 #X obj 575 304 s bela_digitalOut15; 22 #X obj 58 1118 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
23 #X obj 354 380 print sourceto12; 23 1;
24 #X obj 488 351 timer; 24 #X obj 60 1218 phasor~ 300;
25 #X msg 518 316 bang; 25 #X text 126 1246 Nice \, anti-aliased square wave;
26 #X msg 482 316 bang; 26 #X obj 58 1068 loadbang;
27 #X obj 487 380 print sourceto14; 27 #X obj 60 1379 dac~ 17;
28 #X obj 650 146 r bela_digitalIn16; 28 #X obj 60 1321 osc~ 300;
29 #X msg 553 265 1; 29 #X obj 205 1321 phasor~ 169;
30 #X obj 577 214 delay 500; 30 #X obj 205 1351 -~ 0.5;
31 #X obj 480 275 select 1; 31 #X text 56 1290 Sum signals together for unpredictable effects;
32 #X obj 346 268 select 1; 32 #X obj 61 1537 dac~ 18;
33 #X msg 584 281 0; 33 #X text 56 1190 Digital out \, signal rate;
34 #X obj 637 221 select 1 0; 34 #X obj 61 1456 adc~;
35 #X obj 80 663 dac~ 3 4; 35 #X obj 61 1483 *~ 0.5;
36 #X msg 458 576 disable 12; 36 #X obj 61 1510 +~ 0.5;
37 #X obj 158 595 *~ 0.5; 37 #X text 58 1426 The ultimate bit-crusher;
38 #X obj 157 622 +~ 0.5; 38 #X msg 82 640 in 11 \, in 12 \, in 13 ~ \, in 14 ~ \, out 15 \, out
39 #X obj 53 584 *~ 0.5; 39 16 ~ \, out 17 ~ \, out 18 ~;
40 #X obj 52 611 +~ 0.5; 40 #X obj 136 1321 osc~ 1;
41 #X text 183 37 This is just a stub ...; 41 #X obj 60 967 change;
42 #X obj 308 643 dac~ 1 2; 42 #X obj 194 968 change;
43 #X obj 311 606 *~ 0.1; 43 #X obj 60 822 print digitalIn11;
44 #X obj 337 550 osc~ 120; 44 #X obj 272 823 print digitalIn12;
45 #X msg 585 438 0; 45 #X text 42 234 Each digital channel can be configured as either an
46 #X obj 649 185 print digitalIn16; 46 input or;
47 #X obj 672 373 print digitalIn14; 47 #X text 42 247 an output. Send messages to bela_setDigital to configure
48 #X text 185 103 This section requires some hardware loopback between 48 the;
49 15 and 14 \, 13 and 12 Have fun figuring out the pins on P8 (or P9 49 #X text 42 260 digitalPins (needed before using them). Pins settings
50 ???) If you do it properly \, you can measure roundtrip latency with 50 can be;
51 multiple digital/analog feed-forward networs; 51 #X text 42 273 modified at will during execution. Message-rate input
52 #X obj 552 112 loadbang; 52 pins;
53 #X obj 206 291 print digitalIn12; 53 #X text 42 286 receive messages only when the input changes. Message-rate
54 #X text 548 130 connect a switch to digitalIn16 or turn on the metro 54 ;
55 here; 55 #X text 42 299 output pins will write to the output the most recent
56 #X obj 287 449 adc~ 17; 56 value;
57 #X obj 299 506 phasor~ 300; 57 #X text 42 312 you send them. Signal-rate inputs and outputs are handled
58 #X obj 293 539 *~; 58 as;
59 #X obj 409 622 dac~ 26; 59 #X text 42 325 regular audio channels. Outputs are thresholded to 0.5
60 #X msg 534 584 out 11 \, in 12 \, out 13 \, in 14 \, out 15 \, in 16 60 ;
61 \, in 17 ~ \, out 26 ~; 61 #X text 42 338 before being written to the actual output. Note that
62 #X obj 378 427 phasor~ 0.2; 62 each;
63 #X obj 373 455 *~ 1000; 63 #X text 42 351 pin that is managed adds to the CPU usage \, so only
64 #X obj 620 524 dac~ 27 28 29 30; 64 activate;
65 #X obj 621 466 osc~ 30; 65 #X text 42 364 the pins you actually need.;
66 #X connect 0 0 1 0; 66 #X text 43 119 Digital channels are numbered 11 to 26 \, which corresponds
67 #X connect 0 0 7 0; 67 to;
68 #X connect 1 0 37 0; 68 #X text 43 132 Bela's 0 to 15 digital channels. They can be set to
69 #X connect 2 0 1 1; 69 respond;
70 #X connect 3 0 2 0; 70 #X text 43 394 First argument is the pin direction Second argument
71 #X connect 4 0 7 1; 71 is the;
72 #X connect 5 0 4 0; 72 #X text 43 407 pin number Third argument is the rate \, can be "~"
73 #X connect 6 0 5 0; 73 or "sig";
74 #X connect 6 0 10 0; 74 #X text 43 420 for signal-rate or "message" for message-rate. Defaults
75 to;
76 #X text 43 433 message-rate.;
77 #X text 182 577 message containing the pin number;
78 #X text 44 20 Digital I/O;
79 #X text 44 30 ===========;
80 #X text 43 62 Bela's digital inputs and outputs can be addressed from
81 ;
82 #X text 43 88 rate or as signals. Input/output modes and rate need
83 ;
84 #X text 43 101 to be initialised first.;
85 #X text 43 75 pd. They can either be received as messages at message
86 ;
87 #X text 182 530 set digital in 2 to input at signal rate;
88 #X text 182 564 to stop using a pin (e.g.: to save CPU) \, send a disable
89 ;
90 #X text 182 617 use loadbang to initalise multiple digital pins at
91 startup;
92 #X text 43 145 at message rate or at signal rate.;
93 #X text 42 194 Initialising digital pins;
94 #X text 42 204 -------------------------;
95 #X text 42 744 Usage examples;
96 #X text 42 754 --------------;
97 #X text 58 780 Digital in pin 0 \, control rate;
98 #X text 270 780 Digital in pin 1 \, control rate;
99 #X text 182 499 set digital in 1 to input explicitly specifying message
100 rate;
101 #X text 182 472 set digital in 0 to input (default message rate);
102 #X text 86 1117 Blink that LED!;
103 #X text 463 11 ............................;
104 #X text 463 21 . ____ ._____ _ .......___ .;
105 #X text 463 31 .| __ )| ____| |....../ _ |.;
106 #X text 463 51 .| |_) | |___| |___ / ___ |.;
107 #X text 463 61 .|____/|_____|_____/_/..._|.io;
108 #X text 463 71 ............................;
109 #X text 463 41 .| __ || __|.| |...../ _| |.;
110 #X connect 0 0 39 0;
111 #X connect 1 0 40 0;
112 #X connect 2 0 12 0;
113 #X connect 2 1 13 0;
75 #X connect 7 0 35 0; 114 #X connect 7 0 35 0;
76 #X connect 9 0 54 0; 115 #X connect 8 0 6 0;
77 #X connect 10 0 0 1; 116 #X connect 9 0 6 0;
78 #X connect 11 0 3 0; 117 #X connect 10 0 6 0;
79 #X connect 12 0 13 0; 118 #X connect 11 0 6 0;
80 #X connect 12 0 29 0; 119 #X connect 12 0 37 0;
81 #X connect 12 0 45 0; 120 #X connect 13 0 38 0;
82 #X connect 14 0 15 0; 121 #X connect 14 0 17 0;
83 #X connect 14 0 30 0; 122 #X connect 17 0 13 0;
84 #X connect 14 0 48 0; 123 #X connect 17 0 12 0;
85 #X connect 16 0 21 0; 124 #X connect 19 0 20 0;
86 #X connect 17 0 16 1; 125 #X connect 20 0 4 0;
87 #X connect 18 0 16 0; 126 #X connect 21 0 18 0;
88 #X connect 19 0 27 0; 127 #X connect 23 0 19 0;
89 #X connect 19 0 28 0; 128 #X connect 25 0 24 0;
90 #X connect 22 0 25 0; 129 #X connect 26 0 27 0;
91 #X connect 23 0 22 1;
92 #X connect 24 0 22 0;
93 #X connect 26 0 32 0;
94 #X connect 26 0 43 0;
95 #X connect 26 0 44 0;
96 #X connect 27 0 20 0;
97 #X connect 27 0 24 0; 130 #X connect 27 0 24 0;
98 #X connect 27 0 18 0; 131 #X connect 31 0 32 0;
99 #X connect 28 0 31 0; 132 #X connect 31 1 32 0;
100 #X connect 29 0 23 0; 133 #X connect 32 0 33 0;
101 #X connect 30 0 17 0; 134 #X connect 33 0 29 0;
102 #X connect 31 0 20 0; 135 #X connect 35 0 6 0;
103 #X connect 32 0 27 0; 136 #X connect 36 0 24 0;
104 #X connect 32 1 31 0; 137 #X connect 37 0 15 0;
105 #X connect 34 0 8 0; 138 #X connect 38 0 16 0;
106 #X connect 35 0 36 0;
107 #X connect 36 0 33 1;
108 #X connect 37 0 38 0;
109 #X connect 38 0 33 0;
110 #X connect 41 0 40 0;
111 #X connect 42 0 41 0;
112 #X connect 42 0 53 0;
113 #X connect 42 0 57 3;
114 #X connect 43 0 42 1;
115 #X connect 50 0 52 0;
116 #X connect 51 0 52 1;
117 #X connect 52 0 40 1;
118 #X connect 54 0 8 0;
119 #X connect 55 0 56 0;
120 #X connect 56 0 42 0;
121 #X connect 58 0 57 0;