4.1 CONTROL SIGNALS: STEREO PANNING
PREREQUISITES FOR THE CHAPTER
You can use the output of a normal cycle~ object as a sine wave control signal for positioning a signal within a stereo field, as described in Section 4.1T. The frequency of the cycle~ object, in this case, should be low enough to be below the threshold of human hearing. You learned how to parameterize stereo position in Section 1.6, and you can begin your work here by extracting the algorithm for positioning a sound in a stereo field from the file 01_18_pan_function.maxpat. (You’ll wind up with the parts of the original patch that were connected to the line~ object, as shown in Figure 4.1.)
Fig. 4.1 A panning algorithm
You need to replace the line~ object from the original patch (which modulated the position of the sound in space by using line segments) with a sine wave generator oscillating between 0 and 1. (A value of 0 will pan the sound left, while a value of 1 will pan the sound right.) The cycle~ object, however, generates a sine wave that oscillates between -1 and 1. You could modify this oscillation interval by using the pair of simple calculations that you learned about in the theory chapter, but this will be the subject of the next section. For now, employ the vs.kscale~ object, introduced in Section IB.8, to rescale the signal, completing the patch as shown in Figure 4.2.
Fig. 4.2 Stereo panning controlled by an LFO
In this patch, the line~ object has been replaced by the vs.kscale~ object, and a cycle~ object has been connected to it. As you know, the vs.kscale~ object takes four arguments, the first two specifying the range of the input signal, and the last two specifying the desired range of the output signal. In our case, the arguments [-1 1 0 1] indicate that we will be feeding the object an input signal that ranges from -1 to 1, and that we want to rescale this input to fit a signal that ranges from 0 to 1. The cycle~ object itself is set to generate a control signal of 1 Hz, which will make the sound travel from the left to the right and back again over the period of one second; by connecting a float number box to the cycle~ object, you can change the oscillation frequency.
At this point, you can simplify the patch by using the vs.pan~ object from the Virtual Sound Macros library, an object that implements a stereo panning algorithm; the object takes the sound to be positioned on its left inlet, and the positioning control signal on its right inlet. (See Figure 4.3 for the simplified patch.)
Fig. 4.3 Stereo panning using the vs.pan~ object
You can see that the vs.pan~ object performs the same function as the algorithm in Figure 4.1. We are using it simply to free up room in the graphical display of our patch. Try this patch, substituting control signals made with other waveforms, such as the square wave shown in Figure 4.4.
Fig. 4.4 Controlling panning with a square wave LFO
Under the control of a square wave, the sound moves from channel to channel without passing through intermediate positions. The sudden discontinuity, however, generates an undesirable click in the output signal. Fortunately, this can be eliminated by filtering the control signal with a lowpass filter, which smooths the sharp corners of the square wave. (See Figure 4.5 for this modification.)
Fig. 4.5 Filtering an LFO
In this patch, we have set a cutoff frequency of 20 Hz, which means that the control signal can’t jump from one value to the other faster than 20 times a second. Try changing the cutoff frequency for the filter to better understand how it influences the path of the sound; the lower the cutoff frequency, the smoother the transitions between channels will be.
 If you don’t remember how to do this, refresh your memory by rereading the relevant sections of both theory and practice. top
4.3 CONTROL SIGNALS FOR FREQUENCY
Simulating a theremin
4.4 CONTROL SIGNALS FOR AMPLITUDE
4.5 MODULATION OF THE DUTY CYCLE (PULSE WIDTH MODULATION)
4.6 CONTROL SIGNALS FOR FILTERS
4.7 OTHER GENERATORS OF CONTROL SIGNALS
The modulation matrix
4.8 CONTROL SIGNALS: MULTI-CHANNEL PANNING
from “Electronic Music and Sound Design” Vol. 1 by Alessandro Cipriani and Maurizio Giri