comparison examples/08-PureData/gettingStarted/_main.pd @ 543:8f8809c77dda prerelease

updated basics, digital, instruments, extras examples
author chnrx <chris.heinrichs@gmail.com>
date Fri, 24 Jun 2016 13:19:52 +0100
parents 545087a05bc8
children
comparison
equal deleted inserted replaced
542:3016638b4da2 543:8f8809c77dda
1 #N canvas 736 167 442 1518 10; 1 #N canvas 736 167 442 1518 10;
2 #X text 32 20 Using Puredata (libpd) on Bela; 2 #X text 32 20 Using Puredata (libpd) on Bela;
3 #X text 32 30 ==============================; 3 #X text 32 30 ==============================;
4 #X obj 100 538 osc~ 440; 4 #X obj 100 598 osc~ 440;
5 #X obj 100 560 *~ 0.1; 5 #X obj 100 620 *~ 0.1;
6 #X obj 100 582 dac~; 6 #X obj 100 642 dac~;
7 #X text 33 501 Here's how you produce a sine wave out of Bela's stereo 7 #X text 33 561 Here's how you produce a sine wave out of Bela's stereo
8 output:; 8 output:;
9 #X text 33 611 Similarly \, Bela's stereo input can be addressed as 9 #X text 33 671 Similarly \, Bela's stereo input can be addressed as
10 follows:; 10 follows:;
11 #X obj 100 642 adc~; 11 #X obj 100 702 adc~;
12 #X obj 100 664 dac~; 12 #X obj 100 724 dac~;
13 #X text 177 653 Audio pass-through; 13 #X text 177 713 Audio pass-through;
14 #X text 33 1581 Supported objects; 14 #X text 33 1791 Supported objects;
15 #X text 33 1591 -----------------; 15 #X text 33 1801 -----------------;
16 #X text 33 1625 All native pd (vanilla) objects can be used.; 16 #X text 33 1835 All native pd (vanilla) objects can be used.;
17 #X text 33 1611 By default Bela uses libpd to run puredata patches. 17 #X text 33 1821 By default Bela uses libpd to run puredata patches.
18 ; 18 ;
19 #X text 33 1645 It is also possible to compile pd objects to optimised 19 #X text 33 1855 It is also possible to compile pd objects to optimised
20 ; 20 ;
21 #X text 33 1658 C code using the Heavy Cloud Compiler \, in which case 21 #X text 33 1868 C code using the Heavy Cloud Compiler \, in which case
22 ; 22 ;
23 #X text 33 1671 a different set of objects is supported (see below). 23 #X text 33 1881 a different set of objects is supported (see below).
24 ; 24 ;
25 #X text 33 701 Analog I/O; 25 #X text 33 761 Analog I/O;
26 #X text 33 711 ----------; 26 #X text 33 771 ----------;
27 #X text 33 731 Analog inputs and outputs are treated as audio signals 27 #X text 33 791 Analog inputs and outputs are treated as audio signals
28 and; 28 and;
29 #X text 33 745 are addressed using the next 8 channels of the [adc~] 29 #X text 33 805 are addressed using the next 8 channels of the [adc~]
30 and; 30 and;
31 #X text 33 759 [dac~] objects:; 31 #X text 33 819 [dac~] objects:;
32 #X obj 36 785 adc~ 3 4 5 6 7 8 9 10; 32 #X obj 36 845 adc~ 3 4 5 6 7 8 9 10;
33 #X text 191 785 Analog Inputs 0 \, 1 \, 2 \, 3 \, 4 \, 5 \, 6 \, 7 33 #X text 191 845 Analog Inputs 0 \, 1 \, 2 \, 3 \, 4 \, 5 \, 6 \, 7
34 ; 34 ;
35 #X text 191 815 Analog Outputs 0 \, 1 \, 2 \, 3 \, 4 \, 5 \, 6 \, 7 35 #X text 191 875 Analog Outputs 0 \, 1 \, 2 \, 3 \, 4 \, 5 \, 6 \, 7
36 ; 36 ;
37 #X obj 36 815 dac~ 3 4 5 6 7 8 9 10; 37 #X obj 36 875 dac~ 3 4 5 6 7 8 9 10;
38 #X text 33 853 examples.; 38 #X text 33 913 examples.;
39 #X text 33 891 MIDI; 39 #X text 33 1101 MIDI;
40 #X text 33 901 ----; 40 #X text 33 1111 ----;
41 #X text 99 921 and; 41 #X text 99 1131 and;
42 #X obj 36 920 notein; 42 #X obj 36 1130 notein;
43 #X obj 125 920 ctlin; 43 #X obj 125 1130 ctlin;
44 #X text 183 921 objects can be used to interface MIDI devices; 44 #X text 183 1131 objects can be used to interface MIDI devices;
45 #X text 33 939 with the patch.; 45 #X text 33 1149 with the patch.;
46 #X text 33 954 Most MIDI devices can be plugged into the Beaglebone's 46 #X text 33 1164 Most MIDI devices can be plugged into the Beaglebone's
47 USB; 47 USB;
48 #X text 33 968 port and can be used with these objects.; 48 #X text 33 1178 port and can be used with these objects.;
49 #X text 33 839 See the 'BasicAnalogIn' and 'BasicAnalogOut' projects 49 #X text 33 899 See the 'BasicAnalogIn' and 'BasicAnalogOut' projects
50 for; 50 for;
51 #X text 33 983 See the 'hello-midi' and 'midi-poly-synth' projects 51 #X text 33 1193 See the 'hello-midi' and 'midi-poly-synth' projects
52 for more; 52 for more;
53 #X text 33 997 for examples.; 53 #X text 33 1207 for examples.;
54 #X obj 57 1058 print; 54 #X obj 57 1268 print;
55 #X text 33 1058 The; 55 #X text 33 1268 The;
56 #X text 115 1058 object can be used to log messages directly to Bela's 56 #X text 115 1268 object can be used to log messages directly to Bela's
57 ; 57 ;
58 #X text 33 1076 terminal output (e.g. as viewable in the browser IDE). 58 #X text 33 1286 terminal output (e.g. as viewable in the browser IDE).
59 ; 59 ;
60 #X obj 100 1102 loadbang; 60 #X obj 100 1312 loadbang;
61 #X obj 100 1146 print; 61 #X obj 100 1356 print;
62 #X msg 100 1124 Puredata says: 'Hello Bela!'; 62 #X msg 100 1334 Puredata says: 'Hello Bela!';
63 #X text 33 1041 ----------------; 63 #X text 33 1251 ----------------;
64 #X text 33 1031 Debugging: print; 64 #X text 33 1241 Debugging: print;
65 #X text 33 1191 ----------------; 65 #X text 33 1401 ----------------;
66 #X text 33 1181 Debugging: scope; 66 #X text 33 1391 Debugging: scope;
67 #X text 33 1208 Any signal can be visualised using Bela's browser-based 67 #X text 33 1418 Any signal can be visualised using Bela's browser-based
68 ; 68 ;
69 #X text 33 1222 scope. DAC channels 27 \, 28 \, 29 \, 30 address four 69 #X text 33 1432 scope. DAC channels 27 \, 28 \, 29 \, 30 address four
70 separate; 70 separate;
71 #X text 33 1236 scope channels.; 71 #X text 33 1446 scope channels.;
72 #X obj 147 1309 dac~ 27 28 29 30; 72 #X obj 147 1519 dac~ 27 28 29 30;
73 #X obj 79 1261 osc~ 440; 73 #X obj 79 1471 osc~ 440;
74 #X obj 149 1261 noise~; 74 #X obj 149 1471 noise~;
75 #X obj 209 1261 osc~ 880; 75 #X obj 209 1471 osc~ 880;
76 #X obj 209 1283 *~; 76 #X obj 209 1493 *~;
77 #X text 33 1364 visualised.; 77 #X text 33 1574 visualised.;
78 #X text 33 1710 Compiling Puredata patches with Heavy; 78 #X text 33 1920 Compiling Puredata patches with Heavy;
79 #X text 33 1720 -------------------------------------; 79 #X text 33 1930 -------------------------------------;
80 #X text 33 1740 As an alternative to libpd \, Puredata patches can 80 #X text 33 1950 As an alternative to libpd \, Puredata patches can
81 be; 81 be;
82 #X text 33 1754 converted into optimised C code using the Heavy Cloud 82 #X text 33 1964 converted into optimised C code using the Heavy Cloud
83 ; 83 ;
84 #X text 33 1768 Compiler by Enzien Audio. The resulting code can result 84 #X text 33 1978 Compiler by Enzien Audio. The resulting code can result
85 ; 85 ;
86 #X text 33 1782 in large increases in performance and is therefore 86 #X text 33 1992 in large increases in performance and is therefore
87 well; 87 well;
88 #X text 33 1796 suited for complex patches and final stages of development. 88 #X text 33 2006 suited for complex patches and final stages of development.
89 ; 89 ;
90 #X text 33 1810 We recommend to use libpd for prototyping and less 90 #X text 33 2020 We recommend to use libpd for prototyping and less
91 CPU; 91 CPU;
92 #X text 33 1824 intensive patches.; 92 #X text 33 2034 intensive patches.;
93 #X text 33 1838 See our documentation to learn more about compiling 93 #X text 33 2048 See our documentation to learn more about compiling
94 patches; 94 patches;
95 #X text 33 1852 using Heavy \, and visit enzienaudio.com for more info 95 #X text 33 2061 using Heavy \, and visit enzienaudio.com for more info
96 and; 96 and;
97 #X text 33 1866 a list of currently supported objects.; 97 #X text 33 2075 a list of currently supported objects.;
98 #X text 33 1401 Combining Pd and C++; 98 #X text 33 1611 Combining Pd and C++;
99 #X text 33 1411 --------------------; 99 #X text 33 1621 --------------------;
100 #X text 33 1428 There are many cases where it is useful to combine 100 #X text 33 1638 There are many cases where it is useful to combine
101 Pd; 101 Pd;
102 #X text 33 1442 patches with C++ code \, for example when needing to 102 #X text 33 1652 patches with C++ code \, for example when needing to
103 ; 103 ;
104 #X text 33 1456 incorporate system calls (e.g. networking) or for; 104 #X text 33 1666 incorporate system calls (e.g. networking) or for;
105 #X text 33 1470 sample-accurate dsp processes that are inconvenient 105 #X text 33 1680 sample-accurate dsp processes that are inconvenient
106 ; 106 ;
107 #X text 33 1484 to program in Puredata.; 107 #X text 33 1694 to program in Puredata.;
108 #X text 33 1517 is used \, which functions as a libpd wrapper. It is 108 #X text 33 1727 is used \, which functions as a libpd wrapper. It is
109 ; 109 ;
110 #X text 33 1504 When running Puredata patches a template render.cpp 110 #X text 33 1714 When running Puredata patches a template render.cpp
111 file; 111 file;
112 #X text 33 1531 possible to modify this file when starting a new pd 112 #X text 33 1741 possible to modify this file when starting a new pd
113 project.; 113 project.;
114 #X text 33 1545 See the 'CustomRenderFile' example project for more 114 #X text 33 1755 See the 'CustomRenderFile' example project for more
115 info.; 115 info.;
116 #X text 177 560 Sine Wave; 116 #X text 177 620 Sine Wave;
117 #X obj 149 1283 *~ 0.1; 117 #X obj 149 1493 *~ 0.1;
118 #X obj 279 1261 osc~ 0.5; 118 #X obj 279 1471 osc~ 0.5;
119 #X text 33 1350 click the scope button to see the above signals being 119 #X text 33 1560 click the scope button to see the above signals being
120 ; 120 ;
121 #X text 33 1336 If you're viewing this patch using the Bela IDE you 121 #X text 33 1546 If you're viewing this patch using the Bela IDE you
122 can; 122 can;
123 #X text 33 221 Patches can be drag-and-dropped into the browser IDE 123 #X text 33 221 Patches can be drag-and-dropped into the browser IDE
124 ; 124 ;
125 #X text 33 235 and will be added to the current project that is open. 125 #X text 33 235 and will be added to the current project that is open.
126 ; 126 ;
149 #X text 33 137 however most of the functionality is compatible across 149 #X text 33 137 however most of the functionality is compatible across
150 both; 150 both;
151 #X text 33 151 solutions.; 151 #X text 33 151 solutions.;
152 #X text 33 191 Loading and running patches in the Bela IDE; 152 #X text 33 191 Loading and running patches in the Bela IDE;
153 #X text 33 201 -------------------------------------------; 153 #X text 33 201 -------------------------------------------;
154 #X text 33 471 Audio I/O; 154 #X text 33 531 Audio I/O;
155 #X text 33 481 ---------; 155 #X text 33 541 ---------;
156 #X text 33 392 If you're viewing this inside the Bela IDE \, then you've 156 #X text 33 392 If you're viewing this inside the Bela IDE \, then you've
157 ; 157 ;
158 #X text 33 406 noticed by now that all pd patches can be previewed 158 #X text 33 406 noticed by now that all pd patches can be previewed
159 within; 159 within;
160 #X text 33 420 the browser. Note \, however \, that patches cannot 160 #X text 33 420 the browser. Note \, however \, that patches cannot
161 currently; 161 currently;
162 #X text 33 434 be edited or interacted with inside this preview.; 162 #X text 33 434 be edited or interacted with inside this preview.;
163 #X text 33 464 To view the contents of abstractions supplied with a
164 ;
165 #X text 33 477 project in the IDE \, simply go to the project navigator
166 ;
167 #X text 33 490 and open the corresponding patches from there.;
168 #X text 33 951 Digital I/O;
169 #X text 33 961 -----------;
170 #X text 33 981 Digital pins can also be addressed from within a patch.
171 ;
172 #X text 33 994 Unlike analog pins \, digital pins can be set to work
173 as;
174 #X text 33 1007 inputs or outputs and can be read/written as signals
175 or;
176 #X text 33 1020 as messages.;
177 #X text 33 1033 See the 'digital' example for instructions on how to
178 ;
179 #X text 33 1047 initialise \, read and write to digital pins as well
180 as some;
181 #X text 33 1060 usage examples;
163 #X connect 2 0 3 0; 182 #X connect 2 0 3 0;
164 #X connect 3 0 4 0; 183 #X connect 3 0 4 0;
165 #X connect 3 0 4 1; 184 #X connect 3 0 4 1;
166 #X connect 7 0 8 0; 185 #X connect 7 0 8 0;
167 #X connect 7 1 8 1; 186 #X connect 7 1 8 1;