chris@552
|
1 #N canvas 1005 79 685 1592 10;
|
chris@531
|
2 #X obj 60 800 r bela_digitalIn11;
|
chris@531
|
3 #X obj 272 800 r bela_digitalIn12;
|
chris@531
|
4 #X obj 60 897 adc~ 13 14;
|
chris@531
|
5 #X text 56 869 Digital ins \, signal rate;
|
chris@531
|
6 #X obj 58 1144 s bela_digitalOut15;
|
chris@531
|
7 #X text 56 1040 Digital out \, message rate;
|
chris@531
|
8 #X obj 59 695 s bela_setDigital;
|
chris@531
|
9 #X obj 82 618 loadbang;
|
chris@531
|
10 #X msg 83 473 in 11;
|
chris@531
|
11 #X msg 83 530 in 13 ~;
|
chris@531
|
12 #X msg 83 501 in 12 message;
|
chris@531
|
13 #X msg 83 567 disable 17;
|
chris@531
|
14 #X obj 60 943 snapshot~;
|
chris@531
|
15 #X obj 194 944 snapshot~;
|
chris@531
|
16 #X obj 194 896 loadbang;
|
chris@531
|
17 #X obj 60 991 print digitalIn13;
|
chris@531
|
18 #X obj 194 991 print digitalIn14;
|
chris@531
|
19 #X obj 194 917 metro 200;
|
chris@531
|
20 #X obj 60 1245 dac~ 16;
|
chris@531
|
21 #X obj 58 1093 metro 500;
|
chris@531
|
22 #X obj 58 1118 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
|
chris@531
|
23 1;
|
chris@531
|
24 #X obj 60 1218 phasor~ 300;
|
chris@531
|
25 #X text 126 1246 Nice \, anti-aliased square wave;
|
chris@531
|
26 #X obj 58 1068 loadbang;
|
chris@531
|
27 #X obj 60 1379 dac~ 17;
|
chris@531
|
28 #X obj 60 1321 osc~ 300;
|
chris@531
|
29 #X obj 205 1321 phasor~ 169;
|
chris@531
|
30 #X obj 205 1351 -~ 0.5;
|
chris@531
|
31 #X text 56 1290 Sum signals together for unpredictable effects;
|
chris@531
|
32 #X obj 61 1537 dac~ 18;
|
chris@531
|
33 #X text 56 1190 Digital out \, signal rate;
|
chris@531
|
34 #X obj 61 1456 adc~;
|
chris@531
|
35 #X obj 61 1483 *~ 0.5;
|
chris@531
|
36 #X obj 61 1510 +~ 0.5;
|
chris@531
|
37 #X text 58 1426 The ultimate bit-crusher;
|
chris@531
|
38 #X msg 82 640 in 11 \, in 12 \, in 13 ~ \, in 14 ~ \, out 15 \, out
|
chris@531
|
39 16 ~ \, out 17 ~ \, out 18 ~;
|
chris@531
|
40 #X obj 136 1321 osc~ 1;
|
chris@531
|
41 #X obj 60 967 change;
|
chris@531
|
42 #X obj 194 968 change;
|
chris@531
|
43 #X obj 60 822 print digitalIn11;
|
chris@531
|
44 #X obj 272 823 print digitalIn12;
|
chris@531
|
45 #X text 42 234 Each digital channel can be configured as either an
|
chris@531
|
46 input or;
|
chris@531
|
47 #X text 42 247 an output. Send messages to bela_setDigital to configure
|
chris@531
|
48 the;
|
chris@531
|
49 #X text 42 260 digitalPins (needed before using them). Pins settings
|
chris@531
|
50 can be;
|
chris@531
|
51 #X text 42 273 modified at will during execution. Message-rate input
|
chris@531
|
52 pins;
|
chris@531
|
53 #X text 42 286 receive messages only when the input changes. Message-rate
|
chris@531
|
54 ;
|
chris@531
|
55 #X text 42 299 output pins will write to the output the most recent
|
chris@531
|
56 value;
|
chris@531
|
57 #X text 42 312 you send them. Signal-rate inputs and outputs are handled
|
chris@531
|
58 as;
|
chris@531
|
59 #X text 42 325 regular audio channels. Outputs are thresholded to 0.5
|
chris@531
|
60 ;
|
chris@531
|
61 #X text 42 338 before being written to the actual output. Note that
|
chris@531
|
62 each;
|
chris@531
|
63 #X text 42 351 pin that is managed adds to the CPU usage \, so only
|
chris@531
|
64 activate;
|
chris@531
|
65 #X text 42 364 the pins you actually need.;
|
chris@531
|
66 #X text 43 119 Digital channels are numbered 11 to 26 \, which corresponds
|
chris@531
|
67 to;
|
chris@531
|
68 #X text 43 132 Bela's 0 to 15 digital channels. They can be set to
|
chris@531
|
69 respond;
|
chris@531
|
70 #X text 43 394 First argument is the pin direction Second argument
|
chris@531
|
71 is the;
|
chris@531
|
72 #X text 43 407 pin number Third argument is the rate \, can be "~"
|
chris@531
|
73 or "sig";
|
chris@531
|
74 #X text 43 420 for signal-rate or "message" for message-rate. Defaults
|
chris@531
|
75 to;
|
chris@531
|
76 #X text 43 433 message-rate.;
|
chris@531
|
77 #X text 182 577 message containing the pin number;
|
chris@531
|
78 #X text 44 20 Digital I/O;
|
chris@531
|
79 #X text 44 30 ===========;
|
chris@531
|
80 #X text 43 62 Bela's digital inputs and outputs can be addressed from
|
chris@531
|
81 ;
|
chris@552
|
82 #X text 44 88 rate or as signals. Input/output modes and rate need
|
chris@531
|
83 ;
|
chris@531
|
84 #X text 43 101 to be initialised first.;
|
chris@531
|
85 #X text 43 75 pd. They can either be received as messages at message
|
chris@531
|
86 ;
|
chris@531
|
87 #X text 182 530 set digital in 2 to input at signal rate;
|
chris@531
|
88 #X text 182 564 to stop using a pin (e.g.: to save CPU) \, send a disable
|
chris@531
|
89 ;
|
chris@531
|
90 #X text 182 617 use loadbang to initalise multiple digital pins at
|
chris@531
|
91 startup;
|
chris@531
|
92 #X text 43 145 at message rate or at signal rate.;
|
chris@531
|
93 #X text 42 194 Initialising digital pins;
|
chris@531
|
94 #X text 42 204 -------------------------;
|
chris@531
|
95 #X text 42 744 Usage examples;
|
chris@531
|
96 #X text 42 754 --------------;
|
chris@531
|
97 #X text 58 780 Digital in pin 0 \, control rate;
|
chris@531
|
98 #X text 270 780 Digital in pin 1 \, control rate;
|
chris@531
|
99 #X text 182 499 set digital in 1 to input explicitly specifying message
|
chris@531
|
100 rate;
|
chris@531
|
101 #X text 182 472 set digital in 0 to input (default message rate);
|
chris@531
|
102 #X text 86 1117 Blink that LED!;
|
chris@531
|
103 #X text 463 11 ............................;
|
chris@531
|
104 #X text 463 21 . ____ ._____ _ .......___ .;
|
chris@531
|
105 #X text 463 31 .| __ )| ____| |....../ _ |.;
|
chris@531
|
106 #X text 463 51 .| |_) | |___| |___ / ___ |.;
|
chris@531
|
107 #X text 463 61 .|____/|_____|_____/_/..._|.io;
|
chris@531
|
108 #X text 463 71 ............................;
|
chris@531
|
109 #X text 463 41 .| __ || __|.| |...../ _| |.;
|
chris@531
|
110 #X connect 0 0 39 0;
|
chris@531
|
111 #X connect 1 0 40 0;
|
chris@531
|
112 #X connect 2 0 12 0;
|
chris@531
|
113 #X connect 2 1 13 0;
|
robert@464
|
114 #X connect 7 0 35 0;
|
chris@531
|
115 #X connect 8 0 6 0;
|
chris@531
|
116 #X connect 9 0 6 0;
|
chris@531
|
117 #X connect 10 0 6 0;
|
chris@531
|
118 #X connect 11 0 6 0;
|
chris@531
|
119 #X connect 12 0 37 0;
|
chris@531
|
120 #X connect 13 0 38 0;
|
chris@531
|
121 #X connect 14 0 17 0;
|
chris@531
|
122 #X connect 17 0 13 0;
|
chris@531
|
123 #X connect 17 0 12 0;
|
chris@531
|
124 #X connect 19 0 20 0;
|
chris@531
|
125 #X connect 20 0 4 0;
|
chris@531
|
126 #X connect 21 0 18 0;
|
chris@531
|
127 #X connect 23 0 19 0;
|
chris@531
|
128 #X connect 25 0 24 0;
|
chris@531
|
129 #X connect 26 0 27 0;
|
robert@464
|
130 #X connect 27 0 24 0;
|
chris@531
|
131 #X connect 31 0 32 0;
|
chris@531
|
132 #X connect 31 1 32 0;
|
chris@531
|
133 #X connect 32 0 33 0;
|
chris@531
|
134 #X connect 33 0 29 0;
|
chris@531
|
135 #X connect 35 0 6 0;
|
chris@531
|
136 #X connect 36 0 24 0;
|
chris@531
|
137 #X connect 37 0 15 0;
|
chris@531
|
138 #X connect 38 0 16 0;
|