The way we commonly avoid clicks when changing the amplitude of a sound is to interpolate smoothly sample-by-sample from one gain factor to another, using an object such as line~. Does that same technique work well for making a smooth change from one delay time to another? As it turns out, that's not the best way to get a seamless unnoticeable change from one delay time to another, because changing the delay time gradually will actually cause a pitch shift in the sound.
Max can interface with other applications via ReWire. Max can act as either a ReWire host or a ReWire client. Max can be a client to an open host application just by choosing "ad_rewire" as the MSP audio driver in the DSP Status window. Alternatively, you can use Max as the host (mixer) application by including the rewire~ object in your program.
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.
You can assign input data to have a different function at different times, simply by sending it to different parts of your program. For example, if you have a control device such as a MIDI keyboard or other MIDI controller with a limited number of keys, buttons, knobs, or faders, you can assign one control element to be the mode selector that changes the functionality of all the other elements.
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.
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.
This example shows the patch from “Phase distortion synthesis in a poly~ subpatch” 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 "kinkpoly~" in order for this example to work.
This shows an implementation of phase distortion synthesis in MSP—using the phasor~, kink~, and cycle~ objects—in a patch that is designed to be used inside the poly~ object. For an explanation of this sort of phase distortion synthesis, see “A demonstration of phase distortion synthesis.” The main point of this example, though, is to show how a synthesis patch can be designed to respond directly to MIDI input.