MSP Delay Tutorial 1: Delay Lines
Effects achieved with delayed signals
One of the most basic yet versatile techniques of audio processing is to delay a signal and mix the delayed version with the original signal. The delay time can range from a few milliseconds to several seconds, limited only by the amount of RAM you have available to store the delayed signal.
When the delay time is just a few milliseconds, the original and delayed signals interfere and create a subtle filtering effect but not a discrete echo. When the delay time is about 100 ms we hear a ‘slapback’ echo effect in which the delayed copy follows closely behind the original. With longer delay times, we hear the two signals as discrete events, as if the delayed version were reflecting off a distant mountain.
This tutorial patch delays each channel of a stereo signal independently, and allows you to adjust the delay times and the balance between direct signal and delayed signal.
Creating a delay line: tapin~ and tapout~
The MSP object tapin~ is a buffer that is continuously updated so that it always stores the most recently received signal. The amount of signal it stores is determined by a typed-in argument. For example, a tapin~ object with a typed-in argument of stores the most recent one second of signal received in its inlet.
The only object to which the outlet of tapin~ should be connected is a tapout~ object. This connection links the tapout~ object to the buffer stored by tapin~. The tapout~ object ‘taps into’ the delayed signal at certain points in the past. In the above example, tapout~ gets the signal from tapin~ that occurred 500 ms ago and sends it out the left outlet; it also gets the signal delayed by 1000 ms and sends that out its right outlet. It should be obvious that tapout~ can't get signal delayed beyond the length of time stored in tapin~.
A patch for mixing original and delayed signals
The tutorial patch sends the sound coming into the computer to two places: directly to the output of the computer and to a tapin~-tapout~ delay pair. You can control how much signal you hear from each place for each of the stereo channels, mixing original and delayed signal in whatever proportion you want.
At this point you don't hear any delayed signal because the ‘Direct Level’ for each channel is set atand the ‘Delay Level’ for each channel is set at . The signal is being delayed, but you simply don't hear it because its amplitude is scaled to 0.
The slider in the left part of the Patcher window serves as a balance fader between a ‘Dry’ (all direct) output signal and a ‘Wet’ (fully processed) output signal.
Changing the parameters while the sound is playing can result in clicks in the sound because this patch does not protect against discontinuities. You could create a version of this patch that avoids this problem by interpolating between parameter values with line~ or number~ objects.
In future tutorial chapters, you will see how to create delay feedback, how to use continuously variable delay times for flanging and pitch effects, and other ways of altering sound using delays, filters, and other processing techniques.
The tapin~ object is a continuously updated buffer which always stores the most recently received signal. Any connected tapout~ object can use the signal stored in tapin~, and access the signal from any time in the past (up to the limits of the tapin~ object's storage). A signal delayed with tapin~ and tapout~ can be mixed with the undelayed signal to create discrete echoes, early reflections, or comb filtering effects.
|Sound Processing Techniques
|Sound Processing Techniques
|Input to a delay line
|Output from a delay line