In signal processing, a "window" is a function (shape) that is nonzero for some period of time, and zero before and after that period. When multiplied by another signal, it produces an output of 0 except during the nonzero portion of the window, when it exposes the other signal. The simplest example is a rectangular window, which is 0, then briefly is 1, then reverts to 0. The windowed signal will be audible only when it is being multiplied by 1––i.e., during the time when the rectangular windowing occurs.
This patch is designed to be used as an abstraction (subpatch) in another patch, such as the example "Mixing multiple audio processes". In order for that example to work, you should download this example and save it with the filename "pinger.maxpat" somewhere in the Max file search path.
A stereo spatialization effect can be achieved using x,y coordinates to determine intensity and delay for the sound at each speaker at each moment. The hypothetical listener is placed at a point equidistant from the two speakers. The speakers are each assumed to be at some angle from the listener between 0 and pi radians, with 0 radians being straight to the right, pi/2 radians being directly in front of the listener, and pi radians being to the left.
This patch shows a simple way to control the balance between two sounds, and also illustrates the relationship between a) mixing two sounds to one location and b) panning one sound to two locations.
In electronic music parlance, the word "modulation" means change, specifically the continuous or cyclical change caused by using one signal to control another. The controlling signal, known as the modulator, is used to control some property of the sound signal we're listening to, called the carrier.
The line~ object is intended for use as a control signal for audio. You don't listen to line~ directly, but it's very effective as a controller/modifier/modulator of other signals. A pair of numbers (i.e. a two-item space-separated list of numbers) tells line~ a destination value and a time (in milliseconds) to get to that value.
As explained in MSP Tutorial 2, in order to avoid creating clicks in audio when you change the amplitude, you need to interpolate smoothly from one gain value to another. Example A in this patch shows how to use the line~ object to do that. The gain value from the number box is combined with a transition time in the pack object (10 ms in this case) and the two numbers are sent as a list to line~.
The line~ object is useful for providing a control signal. It interpolates linearly sample-by-sample to a new signal value over a specified period of time, then stays at that new value until it is instructed to change. It expects to receive a transition time in its right inlet (a ramp time), followed by a destination value in its left inlet. Alternatively, you can provide both values as a single two-item list. Its initial default value is 0.
Amplification of audio (turning the volume up or down) corresponds to the mathematical operation of multiplication in your program.