You are on page 1of 1

1.6 Practi ce Paragraph 1.

6 - Introduction to panning

In th is patch, the slider is conf igu red (via the inspector) to produce decimal
values that run from 0.0 to 1.0; w ith these values we wil l control th e positi on
of the sound. For the left channel, the values are subtracted from t he number
1 using the object ! -, which subtracts t he number that it receives on its left
inlet fro m its argument. (We will have more detail abo ut t his object in Interlude
A). For t he right channel, the value doesn't need modif ication. The higher the
outp ut on the left, t he lower the output on the right, and vice versa. If the left
is 0.75, for example, we wil l have 1-0.75=0.25 on the right; if the value on the
right is 0.15, the left wi ll be 1-0.15=0.85.
Next, we calculate t he square root of the number using the s qrt object,
specifically designed to perfo rm square roots, and the results of this calculation
is placed into lists using append (which was already seen in Section 1.4) and
passed to the line- object, which smooths the gaps between one value and
the next using a 20 millisecond "s lew value" furn ished by the append object.
Finally, the values output by l ine- are used to mult iply t he amplitudes of the
sig nals on both channels. Moving the slider, eit her left or right, wi ll move the
sound in th e corresponding direction .
It is also possible to automa ti cally move a sound along a stereo f ield under the
control of an algorith m, as we now see in the f ile 01_ 18_pa n_function.ma xpa t
(shown in f igure 1.60):

J select a preset and click


C' on the bang button
clear
controlling panning using the function object

line.:"

··..·····...···········:····
T -

1 minus the
:···············
f'..'- 1'."'
· 0.06 1 : [
control value •
':" envelope oscillator : sound position :
L------ -..~ ;ct-"440 : 0 = left
: ~· 1 10 1 42Q90 507 • -- 0.5 = centered
: l- • 1=righ l
square root ;'qrt- 1:e.: .: sqrt- square root

the multiplication
.:
..
,,,..
••111 •
•- -.
...

factor is applied to : ...... • " • •• · . : unlike the previous patch,
the amplitude of .;... .., • • • • · " " • • • • • • .. ., .:. there is no need here for
the oscillator
....
l'._:-
... •- smoothing using line-

·····.. ....•· panning


········~ ~-···· algo rithm

Fig. 1.60 The file 01_ 18_pan_funct ion.maxpat


106

You might also like