Specifications

76 Pure Data essentials
crossfader , but in some situations crossfades may be better with cons tant power
fading done using sine o r square root trans fer functions.
Demultiplexer
*~
inlet routing
*~
sig~ sig~ sig~
0 0 0
1 0 0
0 1 0
0 0 1
*~
outlet~
unpack f f f
sel 0 1 2 3
lop~ 80
lop~ 80 lop~ 80
inlet~ s1 inlet~ s2 inlet~ s3
fig 7.13: demultiplex
A demultiplexer or signal source selector
is a multi-way switch that can choose be-
tween a number of signal source s. Fig. 7.13
is useful in synthesiser construction where
you want to select from a few different wave-
forms. In this design the choice is exclu-
sive so only one input channel can be sent
to the output a t any time. A number at
the control inlet causes
select
to choose one
of four possible messages to send to
unpack
.
The first turns off all channels, the s e c ond
switches on only channel one and so fo rth.
The Boolean values appearing in the
unpack
output a re converted to signals and then
lowpassed at 80 Hz to give a fast but click free transition.
SECTION 7.2
Audio file tools
Monophonic sampler
sig~
lop~ 2
*~
tabwrite~ $0-a1
tabplay~ $0-a1
inlet pinlet rinlet~
outlet~
inlet gain
table $0-a1 88200
fig 7.14: simple sampler
A useful object to have around is a simple sampler
that can grab a few seconds of audio input and play it
back. Audio arrives at the first inlet and is scaled by
a gain stage before b e ing fed to
tabwrite~
. It’s nice to
have a gain control so that you don’t have to mess
with the level of the signal you are re c ording else-
where. In Fig. 7.14 a table of 88200 samples is cre-
ated called $0-a1, so we have a couple of seconds
recording time. Obviously this can be changed in
the code or a control created to use the resize method. When it receives a
bang
tabwrite~
starts recording fro m the beginning of the table. To play back
the recording we issue a bang to
tabplay~
which connects directly to the outlet.
The use of dollar arguments means this patch can be abstracted and multiple
instances created, it’s not unusual to want a bunch of samplers when working
on a sound.