The intensity of sound is proportional to the square of its amplitude. So if we want to have a linear change in intensity as we go from 0 to 1 or 1 to 0, we need to use the square root of that linear change to calculate the amplitude. This example patch is exactly like "Linear amplitude panning", except that we consider the linearly changing signal from line~ to be the intensity rather than the amplitude, and we take the square root of that value to obtain the actual amplitude for each speaker.
The simplest and most common way to localize a sound in a stereo field is to vary the relative intensity between the two speakers. To make a sound seem to move from one side to the other, for example, you can start with the level of one speaker set to 1 and the other speaker set to 0, then gradually turn one down to 0 as you bring the other up to 1. This patch demonstrates a direct linear pan from one speaker to the other.
This pan~ subpatch takes one signal in the left inlet, and sends it out each of two outlets. The amplitude gain for each outlet is determined by a panning value supplied in the right inlet. This value can be supplied as a typed-in argument in the main patch, as a float value, or as a control signal.
There are several standard speaker configurations for 2-dimensional surround sound panning, such as quadraphonic (four speakers in a square or rectangular placement) and the 5.1 or 7.1 THX cinema surround specifications.
This patch requires the tapoutxfade~ abstraction in the example "Abstraction for crossfading delay times of a remote tapin~ object". When audio is turned on, the tapin~ object sends out the tapconnect message to the three subpatches, thus associating their internal tapout~ objects with the same tapin~.
This example shows the patch from “A subpatch suitable for use in poly~” being used as a subpatch inside the poly~ object. You will need to download the patch from that example and save it with the name "FMsynth~" in order for this example to work.
If we want to use the delay crossfading technique shown in "Abstraction for crossfading between delay times" for multiple different delays of the same sound, the simplest solution is just to make multiple copies of that abstraction and send the same audio signal to each one. However, that's a bit inefficient in terms of memory usage because each subpatch would have its own tapin~ object, each of which would be containing the same audio data.
This patch demonstrates how one might make an audio patch that can serve as a voice in a polyphonic synthesizer. It's quite similar to the FMtone~ patch shown in “Generating a simple 2-operator FM tone”, but with some modifications that make it suitable for use with the poly~ object so that it can be used polyphonically.
This example shows the patch from another example being used as a subpatch in a larger patch. You will need to download the patch from “Generating a simple 2-operator FM tone” and save it with the name "FMtone~" in order for this example to work.