1 #N canvas 283 179 627 567 10;
2 #X obj 160 958 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
5 #X obj 258 973 karplus~;
10 #X obj 467 189 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
15 #X msg 467 409 pitch 220;
16 #X msg 467 431 pitch 440;
17 #X msg 467 319 vol 0.3;
19 #X msg 258 915 freq \$1;
20 #X text 24 374 5 Sending just the control name reports the current
21 value of the control on the first outlet.;
22 #X text 24 417 6 Use these to change the pitch (frequency) of the tone.
24 #X text 23 9 1 This is a simple test patch which demonstrates how you
25 work with Faust DSPs in Pd. As with any other Pd external \, you need
26 to compile the Faust DSPs before you can use them in Pd. The accompanying
27 GNU Makefile has the rules to do this. So if you haven't done this
28 already \, use "make" now to compile the plugins using the faust compiler
29 and gcc \, which will make all the "can't create" messages go away.
31 #X obj 498 587 loadbang;
32 #X obj 469 27 loadbang;
33 #X obj 88 866 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1
35 #X obj 148 892 del 100;
36 #X text 110 864 <-- bang to play a note;
37 #X text 333 892 <-- change the pitch here;
38 #X text 29 1139 Albert Graef \, Sep 2006;
39 #X obj 253 1008 freeverb~;
40 #X text 23 958 print controls -->;
41 #X text 24 186 3 You can bang the leftmost \, "control" inlet to get
42 the control parameters of the DSP. The descriptions of the controls
43 are then sent to the first outlet to which we have connected a print
44 object below so that the results are printed in Pd's main window. For
45 each control the description contains the type of control (as defined
46 by the Faust source) \, the (fully qualified) name of the control \,
47 its current value \, its initial value \, its range (from..to) and
49 #X msg 356 972 active \$1;
50 #X obj 356 950 tgl 15 0 empty active empty 0 -6 0 8 -262144 -1 -1 1
52 #X msg 467 483 active \$1;
53 #X obj 467 461 tgl 15 0 empty active empty 0 -6 0 8 -262144 -1 -1 1
55 #X text 375 950 <-- enable/disable freeverb here;
56 #X text 25 584 8 Hit the "vol 0" message when you've heard enough.
57 (We've also attached a loadbang to this message so that the unit is
59 #X text 25 740 10 Our final example is a slightly improved version
60 of the Karplus-Strong synth from the Faust distribution (karplus.dsp).
61 It can be played by changing the pitch with the number box and sending
62 gate 1/gate 0 messages to start and end a note \, respectively. In
63 this patch we've added a bang and a delay to automate this process.
64 We've also attached a little freeverb~ unit (freeverb.dsp) to illustrate
65 how you can build a simple synth/effect chain.;
66 #X text 489 461 <-- enable/disable;
67 #X obj 258 893 nbx 5 14 20 20000 0 0 empty freq empty 0 -6 0 10 -262144
69 #X msg 469 60 \; pd dsp 1 \; active 1 \; freq 440;
70 #X text 23 120 2 Ok \, if you've successfully compiled the DSPs then
71 this patch should load without errors now. So let's take a look at
72 our first example \, a simple sine tone generator. You can find the
73 Faust source for this unit in tone.dsp.;
74 #X text 25 314 4 You can change a control value by sending a message
75 with the control name and value to the first inlet. E.g. \, let's hit
76 the "vol 0.3" message to crank up the volume so that we can listen
78 #X text 24 456 7 There's also a special control named "active" which
79 lets you turn a Faust DSP on and off. This control is added automatically
80 for your convenience so that you do not have to define it yourself.
81 The default behaviour of the control \, when the value is 0 \, is to
82 pass through the input signal if the number of audio inputs and outputs
83 match \, and to generate silence otherwise. (You can also give your
84 own custom definition of the active control in the Faust source if
85 the default behaviour is not appropriate.);
86 #X text 28 1077 More examples of useful Faust DSPs can be found in
87 the other examples subdirectories. In particular \, take a look at
88 examples/synth/synth.pd which contains a full-blown polyphonic synth
89 based on different Faust units. Enjoy! :);
90 #X text 24 634 9 Here's the object itself \, with a print attached
91 so that the results of control messages sent to the leftmost inlet
92 are printed in Pd's main window. The remaining outlets are the audio
93 outputs which can be routed to a dac~. In general Faust DSPs may also
94 have audio inputs \, of course \, these will then be available as additional
95 audio inlets (see \, e.g. \, the freeverb~ object below as an example).
114 #X connect 19 0 14 0;
115 #X connect 20 0 38 0;
117 #X connect 21 0 22 0;
122 #X connect 29 0 26 0;
123 #X connect 30 0 29 0;
125 #X connect 32 0 31 0;
126 #X connect 37 0 15 0;