Specifications

3.5 Input and output 31
Pd is the Ar duino b oard which gives a number of buffered analog and digital
lines, serial and parallel, for robotics and control applications. Nearly all of this
is quite beyond the scope of this boo k. The way you set up your DAW and build
your sound design studio is an individual matter, but Pd sho uld not disappoint
you when it comes to I/O co nnectivity. We will now look at a few c ommon
input and output channels.
The print object
Where would we be without a
print
object? Not much use for making sound,
but vital for debugging patches. Message domain data is dumped to the console
so you can see what is going on. You can give it a non-numerical arg ument
which will pr efix any output and make it easier to find in a long printout.
MIDI
When working with musical keyboar ds there are objects to help integrate these
devices so you can build patches with traditional synthesiser and sampler be-
haviours. For sound design this is great for attaching MIDI fader boards to con-
trol parameters, and of course musical interface devices like breath controllers
and MIDI guitars can be used. Hook up any MIDI source to Pd by activating a
MIDI device from the Media->MIDI menu (you can check this is working from
Media->Test Audio and MIDI).
Notes in
You can create single events to trigger from individual keys, or have layers and
velocity fades by adding extra logic.
notein
60 note
127 velocity
1 channel
fig 3.21: MIDI note in
The
notein
object produces note number, velocity and
channel values on its left, middle and right o utlets. You
may assign an object to listen to only one channel by g iv -
ing it an argument from 1 to 15 . Remember that note-o
messages are equivalent to a note-on with zero velocity in
many MIDI implementations and Pd follows this method.
You therefore need to add extra logic before connecting an oscillator or s ample
player to
notein
so that zero valued MIDI notes are no t played.
Notes out
makenote
metro 200
+ 48
random 3
* 12
t b b
random 127
notelength
984.1
noteout
fig 3.22: MIDI
note generation
Another o bject
noteout
sends MIDI to ex ternal devices . The
first, seco nd and third inlets set note number, velocity and
channel r e spectively. The channel is 1 by default. Make
sure you have something connected that can play back MIDI
and set the patch shown in Fig. 3.22 running with its toggle
switch. Every 200ms it produces a C on a random octave
with a random velocity value between 0 and 127. Without
further ado these could be sent to
noteout
, but it would cause
each MIDI note to “hang”, since we never send a note-off
message. To properly construct MIDI notes you need
makenote