comparison examples/08-PureData/gettingStarted/_main.pd @ 521:545087a05bc8 prerelease

added pd getting-started patch
author chnrx <chris.heinrichs@gmail.com>
date Thu, 23 Jun 2016 00:15:51 +0100
parents
children 8f8809c77dda
comparison
equal deleted inserted replaced
520:45ddfcd0e417 521:545087a05bc8
1 #N canvas 736 167 442 1518 10;
2 #X text 32 20 Using Puredata (libpd) on Bela;
3 #X text 32 30 ==============================;
4 #X obj 100 538 osc~ 440;
5 #X obj 100 560 *~ 0.1;
6 #X obj 100 582 dac~;
7 #X text 33 501 Here's how you produce a sine wave out of Bela's stereo
8 output:;
9 #X text 33 611 Similarly \, Bela's stereo input can be addressed as
10 follows:;
11 #X obj 100 642 adc~;
12 #X obj 100 664 dac~;
13 #X text 177 653 Audio pass-through;
14 #X text 33 1581 Supported objects;
15 #X text 33 1591 -----------------;
16 #X text 33 1625 All native pd (vanilla) objects can be used.;
17 #X text 33 1611 By default Bela uses libpd to run puredata patches.
18 ;
19 #X text 33 1645 It is also possible to compile pd objects to optimised
20 ;
21 #X text 33 1658 C code using the Heavy Cloud Compiler \, in which case
22 ;
23 #X text 33 1671 a different set of objects is supported (see below).
24 ;
25 #X text 33 701 Analog I/O;
26 #X text 33 711 ----------;
27 #X text 33 731 Analog inputs and outputs are treated as audio signals
28 and;
29 #X text 33 745 are addressed using the next 8 channels of the [adc~]
30 and;
31 #X text 33 759 [dac~] objects:;
32 #X obj 36 785 adc~ 3 4 5 6 7 8 9 10;
33 #X text 191 785 Analog Inputs 0 \, 1 \, 2 \, 3 \, 4 \, 5 \, 6 \, 7
34 ;
35 #X text 191 815 Analog Outputs 0 \, 1 \, 2 \, 3 \, 4 \, 5 \, 6 \, 7
36 ;
37 #X obj 36 815 dac~ 3 4 5 6 7 8 9 10;
38 #X text 33 853 examples.;
39 #X text 33 891 MIDI;
40 #X text 33 901 ----;
41 #X text 99 921 and;
42 #X obj 36 920 notein;
43 #X obj 125 920 ctlin;
44 #X text 183 921 objects can be used to interface MIDI devices;
45 #X text 33 939 with the patch.;
46 #X text 33 954 Most MIDI devices can be plugged into the Beaglebone's
47 USB;
48 #X text 33 968 port and can be used with these objects.;
49 #X text 33 839 See the 'BasicAnalogIn' and 'BasicAnalogOut' projects
50 for;
51 #X text 33 983 See the 'hello-midi' and 'midi-poly-synth' projects
52 for more;
53 #X text 33 997 for examples.;
54 #X obj 57 1058 print;
55 #X text 33 1058 The;
56 #X text 115 1058 object can be used to log messages directly to Bela's
57 ;
58 #X text 33 1076 terminal output (e.g. as viewable in the browser IDE).
59 ;
60 #X obj 100 1102 loadbang;
61 #X obj 100 1146 print;
62 #X msg 100 1124 Puredata says: 'Hello Bela!';
63 #X text 33 1041 ----------------;
64 #X text 33 1031 Debugging: print;
65 #X text 33 1191 ----------------;
66 #X text 33 1181 Debugging: scope;
67 #X text 33 1208 Any signal can be visualised using Bela's browser-based
68 ;
69 #X text 33 1222 scope. DAC channels 27 \, 28 \, 29 \, 30 address four
70 separate;
71 #X text 33 1236 scope channels.;
72 #X obj 147 1309 dac~ 27 28 29 30;
73 #X obj 79 1261 osc~ 440;
74 #X obj 149 1261 noise~;
75 #X obj 209 1261 osc~ 880;
76 #X obj 209 1283 *~;
77 #X text 33 1364 visualised.;
78 #X text 33 1710 Compiling Puredata patches with Heavy;
79 #X text 33 1720 -------------------------------------;
80 #X text 33 1740 As an alternative to libpd \, Puredata patches can
81 be;
82 #X text 33 1754 converted into optimised C code using the Heavy Cloud
83 ;
84 #X text 33 1768 Compiler by Enzien Audio. The resulting code can result
85 ;
86 #X text 33 1782 in large increases in performance and is therefore
87 well;
88 #X text 33 1796 suited for complex patches and final stages of development.
89 ;
90 #X text 33 1810 We recommend to use libpd for prototyping and less
91 CPU;
92 #X text 33 1824 intensive patches.;
93 #X text 33 1838 See our documentation to learn more about compiling
94 patches;
95 #X text 33 1852 using Heavy \, and visit enzienaudio.com for more info
96 and;
97 #X text 33 1866 a list of currently supported objects.;
98 #X text 33 1401 Combining Pd and C++;
99 #X text 33 1411 --------------------;
100 #X text 33 1428 There are many cases where it is useful to combine
101 Pd;
102 #X text 33 1442 patches with C++ code \, for example when needing to
103 ;
104 #X text 33 1456 incorporate system calls (e.g. networking) or for;
105 #X text 33 1470 sample-accurate dsp processes that are inconvenient
106 ;
107 #X text 33 1484 to program in Puredata.;
108 #X text 33 1517 is used \, which functions as a libpd wrapper. It is
109 ;
110 #X text 33 1504 When running Puredata patches a template render.cpp
111 file;
112 #X text 33 1531 possible to modify this file when starting a new pd
113 project.;
114 #X text 33 1545 See the 'CustomRenderFile' example project for more
115 info.;
116 #X text 177 560 Sine Wave;
117 #X obj 149 1283 *~ 0.1;
118 #X obj 279 1261 osc~ 0.5;
119 #X text 33 1350 click the scope button to see the above signals being
120 ;
121 #X text 33 1336 If you're viewing this patch using the Bela IDE you
122 can;
123 #X text 33 221 Patches can be drag-and-dropped into the browser IDE
124 ;
125 #X text 33 235 and will be added to the current project that is open.
126 ;
127 #X text 33 249 In order for the patch to run you need to fulfill the
128 ;
129 #X text 33 263 following two requirements:;
130 #X text 59 285 a) The top-level patch needs to be named '_main.pd'
131 ;
132 #X text 77 298 (you can still use abstractions);
133 #X text 59 315 b) Make sure there is no 'render.cpp' file inside;
134 #X text 77 328 the project. A template file will be used instead;
135 #X text 77 342 which acts as a wrapper for libpd.;
136 #X text 77 355 Alternatively you can modify this wrapper and place
137 ;
138 #X text 77 368 it inside the project. See below for more information.
139 ;
140 #X text 33 61 Puredata patches can easily be run on Bela. There are
141 two;
142 #X text 33 75 ways of doing this: using libpd (which is compatible
143 with;
144 #X text 33 89 the browser-based IDE) or using the Heavy cloud compiler
145 ;
146 #X text 33 103 by Enzien Audio.;
147 #X text 33 123 This guide focuses mainly on using libpd via the browser
148 \,;
149 #X text 33 137 however most of the functionality is compatible across
150 both;
151 #X text 33 151 solutions.;
152 #X text 33 191 Loading and running patches in the Bela IDE;
153 #X text 33 201 -------------------------------------------;
154 #X text 33 471 Audio I/O;
155 #X text 33 481 ---------;
156 #X text 33 392 If you're viewing this inside the Bela IDE \, then you've
157 ;
158 #X text 33 406 noticed by now that all pd patches can be previewed
159 within;
160 #X text 33 420 the browser. Note \, however \, that patches cannot
161 currently;
162 #X text 33 434 be edited or interacted with inside this preview.;
163 #X connect 2 0 3 0;
164 #X connect 3 0 4 0;
165 #X connect 3 0 4 1;
166 #X connect 7 0 8 0;
167 #X connect 7 1 8 1;
168 #X connect 43 0 45 0;
169 #X connect 45 0 44 0;
170 #X connect 54 0 53 0;
171 #X connect 55 0 83 0;
172 #X connect 56 0 57 0;
173 #X connect 57 0 53 2;
174 #X connect 83 0 53 1;
175 #X connect 84 0 57 1;
176 #X connect 84 0 53 3;