Panning Techniques In Max Msp: A Guide To Spatial Control

how to control panning in max msp

Panning is a fundamental concept in audio engineering, referring to the process of adjusting the relative loudness of a sound source across different speakers or channels. In Max MSP, a powerful visual programming language for audio, panning can be controlled in several ways to achieve the desired stereo or multi-channel effects. This involves manipulating the balance and relative strength of the left and right channels, as well as considering localization and distance cues. The process of panning in Max MSP offers users a range of creative possibilities, from simple stereo panning to more advanced techniques like multi-channel panning and user-interactive soundscapes.

Characteristics Values
Panning Adjusting the relative loudness of a single sound coming from two (or more) speakers
Panning in Max MSP Controlled by a single value from 0 to 127
Panning for Localization and distance effects
Signal gain values Displayed by an MSP user interface object called number~
MIDI controller No. 10 (or any other MIDI data) can be used to pan a signal between output channels
Relative amplitude of the two channels Gives a localization cue for the direction of the sound source
Overall intensity of the sound Proportional to the sum of the squares of the amplitudes
Cue for perceived distance of the sound source Overall intensity of the sound
Mapping the MIDI data Perform a linear crossfade of the amplitudes of the two channels
Multi-channel panning Panning around four channels and blending four sound sources
Preferred controller for four-channel panning Joystick or a two-dimensional control such as pictslider
MS Width subpatch Uses the same stereo sources as the other patches, but converts them to MS format by adding both channels (Middle) and subtracting Right from Left (Side)
Width slider Controls the amount of side signal in a simple linear fashion
Stereo signals Cannot be panned in the sense of turning a camera left or right
Balance control Affects the impression that a source was more to the right or left

cycookery

Using the panning value to determine the angle of the sound source

Panning in Max MSP is concerned with the proper balance to suggest the direction of the sound source and controlling the perceived loudness of the combined speakers to suggest distance. The relative amplitude of the two channels gives a localization cue for the direction of the sound source. The overall intensity of the sound is proportional to the sum of the squares of the amplitudes and acts as a cue for the perceived distance of the sound source.

To use the panning value to determine the angle of the sound source, the panning value is mapped to an arc around the listener, ranging from 0° to 90°. The channel amplitudes are then set to be proportional to the cosine and sine of that angle. This keeps the intensity constant as the sound is panned. This is because the square of the cosine plus the square of the sine equals 1, which keeps the sum of the squares of the amplitudes constant.

The speaker angle, specified in degrees by the user in the main patch, is converted to a fraction of a cycle and then to radians (by multiplying by 2π, or 6.2832) for trigonometric operations. When the source reaches an angle greater than 90° from one speaker, that speaker's gain is set to 0. The pitch bend wheel can be used to understand these calculations.

The relative distance of the sound source can be calculated as it travels, and the amplitude of each channel can be modified accordingly to emulate straight-line movement.

cycookery

The relative amplitude of the two channels

In a standard stereo speaker setup, where two speakers are positioned in front of the listener at equal distances and angles, the relative amplitude of the channels becomes even more important. As a sound source moves from one speaker to the other, the relative amplitude values will change, indicating the direction of the sound.

To maintain a constant intensity while panning, the channel amplitudes can be set proportionally to the cosine and sine of the angle of the sound source on an arc around the listener. This method ensures that the intensity remains constant even when the sound is panned to the middle, avoiding a drop in intensity.

Additionally, the overall intensity of the sound, which is proportional to the sum of the squares of the amplitudes, provides a cue for the perceived distance of the sound source. By manipulating the amplitudes, the perceived distance of the sound source can be controlled, creating a sense of depth and space in the audio experience.

In summary, the relative amplitude of the two channels plays a crucial role in panning by providing localization cues for the direction of the sound source and allowing control over the perceived distance through manipulation of the overall intensity of the sound.

cycookery

Multi-channel panning

To set up multi-channel panning, you need to open the Quad_pan subpatcher and start the window audio. If you don't have a four-channel listening environment, you should open Audio Status in the Options menu and select I/O Mappings. Then, route channel 3 to output 1 and channel 4 to output 2. The signal_source subpatch contains three sources: a simple tone generator, a short audio file, and an adc~ object.

The pan function is linear and is derived by scaling the pictslider X output to 0-1 and taking the square root. This value is applied to the right channel, and the power of (1-x) is applied to the left channel. By moving the circle up in the pictslider, both values are multiplied by similar values derived from the Y-axis, panning the sound forward and back. Each of the four channels is controlled by some combination of X and Y or 1-X and 1-Y.

cycookery

Linear crossfade of the amplitudes of the two channels

The relative amplitude of the two channels gives a localization cue for the direction of the sound source. The overall intensity of the sound is proportional to the sum of the squares of the amplitudes and acts as a cue for the perceived distance of the sound source. Mapping the MIDI data to perform a linear crossfade of the amplitudes of the two channels is one method of panning. However, this causes a drop in intensity when the sound is panned to the middle.

To perform a linear crossfade, the range of MIDI values from 0 to 127 is mapped onto the amplitude range of 0 to 1. This value is then used as the amplitude for the right channel, while the left channel is set to 1 minus the amplitude of the left channel. This is the simplest type of panning to calculate.

The linear crossfade can be achieved using the 'Simple Linear Crossfade' option in the umenu. The user can then click on the ezdac~ to turn the audio on and use the 'Amplitude' number box to set the desired listening level. The pitch bend wheel of the MIDI keyboard can be moved to pan the sound slowly from one channel to the other.

While the linear crossfade is useful in some situations, it may be desirable to maintain a constant intensity as the sound is panned. This can be achieved by using the panning value to determine the angle of the sound source on an arc around the listener (mapped in a range from 0° to 90°), and setting the channel amplitudes proportional to the cosine and sine of that angle. This method ensures that the intensity remains constant as the sound is panned.

cycookery

Cosine panning

To achieve this effect, one can map the range of MIDI values from 0 to 127 onto the range 0 to 0.25 and use the result as an angle to look up the cosine and sine values. As the sound source travels on a hypothetical arc from 0° to 90° (a quarter circle with the listener at the centre), the cosine of its angle decreases from 1 to 0 while the sine of its angle increases from 0 to 1. This technique allows for the simulation of a sound source moving in an arc around the listener, maintaining a constant distance.

In some applications, such as Csound, users can implement cosine panning by putting a cosine wave in a table and indexing it so that 0 corresponds to the positive peak and 1 to the negative peak. This way, the user can choose a panning value between 0 and 1, and the corresponding part of the curve in the table will be looked up. This approach allows for more precise control over the panning process.

Frequently asked questions

Panning refers to adjusting the relative loudness of a single sound coming from two (or more) speakers.

In Max MSP, panning is generally controlled by a single value from 0 to 127. You can use MIDI controller No. 10 (or any other MIDI data) to pan a signal between output channels.

When panning a monaural signal, you are placing it in a stereo sound field. For stereo signals, you are concerned with balance, which adjusts the relative strength of the left and right channels.

The preferred controller for four-channel panning is a joystick or a two-dimensional control such as a pictslider.

Written by
Reviewed by
Share this post
Print
Did this article help you?

Leave a comment