The delay module

Author: Rob Hordijk

Introduction

The delay module is used to delay an audiosignal in time. It has one red audio input and two audio outputs. One has a fixed delay of about 2.65 milliseconds and the delay of the other output is variable between 0 millisecond and 2.65 milliseconds. The delaytime of the variable timedelay output can also be controlled by a blue control input. This control input has a very fine resolution, much finer that the 127 steps of the delay controlknob suggests. Now 2.65 milliseconds is a very short time, so you might be wondering what use this module could possibly have. Well, we will see there are plenty very interesting uses for it.

Vibrato

If we route an audiosignal through the module the delay is so short we will not hear any effect, but if we modulate the delaytime by a low frequency sinewave we will hear a distinct vibrato as in the following example.

As you can see the controlknob of the blue delaytime control input needs to be only slightly open to give a very distinct vibrato effect. If we open this knob halfways at knobsetting 64 the delaytime is swept smoothly over the maximum possible range. If we open the knob fully we hear the vibrato stop at the peaks of the controlling LFO sinewave. This is because the range of the input controlvalue is between 0 units and 64 units, corresponding to no delay and 2.65 milliseconds. The control input does not react to negative control values, the module does not have something like a negative time delay, it can not predict the future, it only stores the recent past 2.65 msecs of sound. So if the preset delaytime is set to 1.33 msec, its default value, the amplitude of the modulating LFO should be between -32 and 32 units, half of the standard output of an LFO module. And that's why the blue input controlknob should only be halfway open to sweep over the maximum range.

We could also decide to feed only positive controlvalues to the blue input. Then we should set the default delaytime to zero and open the controlknob fully. Now we can feed a signal with a value between 0 and 64 units like in the following example, that sounds exactly like the previous example.

You see we added a Level Shifter / Inverter module from the audiomodules tab to shift the output of the LFO to a range between 0 and 64 units. The blue input controlknob on the delay module can now be opened twice as far as the previous example for the same vibratodepth and we actually increased the resolution of the controlknob by a factor two.

One of the things that can immediately be heard is that there is no zippery sound at all in the vibrato. This is a result of the very fine resolution of the delaytime controlinput. The resolution is actually 2^21 frequencydivisions in the 2.65 msec delaytime range. If the resolution would be only 127 steps as the default delaytime knob suggests we would hear a zippery sound in the vibrato. This can be demonstrated if we add a Digitizer module set to a resolution of 7 bits (2^7=128 steps).

A strong zippery sound is heard in this patch, but if we press the Quant button on the digitizer module, the vibrato is immediately smooth again. It is very important to realize this fact as later we will tune the delaytime to track the keyboard.

If we use the delay module in this way we actually create a phasemodulation (PM) in the signal. Phasemodulation is almost similar to frequencymodulation (FM) but there is one important difference. PM is not sensitive to DC or constant levels on the control input but FM is, If we feed a constant (nonmodulated) signal of say 32 units to the controlinput we don't hear any difference in the sound, but with true FM the pitch would have been shifted up by a constant interval. You might have noticed this difference on the FMA and FMB inputs on the oscillators. There it is the same, a constant value on the FMA inputs will raise the frequency of the oscillator but a constant value on a FMB input will have no effect. So for the sake of simplicity we can say that the control input of the delaymodule audibly reacts to changes in the controlling signal and not to levels.

Instead of a LFO to introduce vibrato we can also apply an audio signal. Due to the lower samplerate of the blue control input there will be more digital zippery sounds if we use deeper modulation and/or the modulating signal is brighter. Using a lowpass filter with a cutoff at around 1kHz and zero resonance at the blue control input can reduce the zippery distortion. But maybe it is that zippery effect what you're after.

Combfilter

If we combine the audio input signal with the variable delaytime output signal, by mixing them together in equal amounts, we will hear a change in timbre. Every harmonic in the input signal gets a phaseshift which is different from every other harmonic. The higher the harmonic, the more the phaseshift will be. Some harmonics will be shifted 180 degrees or multiples of 180 degrees. These are now in antiphase with the inputsignal and will be cancelled out when we add the delayed signal to the input signal. Other harmonics will be shifted 360 degrees or a multiple of 360 degrees and these will be exactly in phase so their energy amount will be doubled in the resulting signal. But most harmonics will have phaseshifts somewhere in between and will be slightly enhanced or attenuated. This setup is what we call a combfilter, as the frequencyresponse of this filter looks like a comb. We can literally comb a note out of a chord like in the next example.

In this example Knob1, assigned to the Constant1 module, controls the delaytime in a way that when fully opened the groundnote of the major chord is completely removed from the outputsignal. If Knob1 is fully closed the 5th disappeared completely and at a knobvalue of around 25 the 3th is removed.

If we swap the constantmodule for a LFO and a level shifter we can sweep exactly from the lowest note to the highest note and 'comb' them out of the chord in rhytm with the LFO, like in the next example.

If we replace the LFO by a control sequencer we can play a melody by alternatingly filtering out one of the notes.

Combfilters are especially popular with spies that use them to comb out strong ambient signals from long distance spy recordings. But musically they are mostly used for the phasing effect when sweeping the delaytime by a LFO. The combfilter here is however totally different from the Phaser module, the last used so called 'allpass' filters to get the phaser effect and can sound distinctly different. A simple combfilter like in the example does not have a resonance control. To add control we have to introduce feedback by adding a mixer just before the audioinput of the delayline and feed the output of the delayline back to the input. This results in a strong resonating phasing sound. If we apply to much feedback the delayline will start to resonate strongly. You can control the feedback with the third knob of the Mixer1 module.

 Flanger

The traditional flanging effect is achieved by having two taperecorders play the same recording and slowing down one or the other by slightly holding a finger to the flange of the tapereel. We can mimic this effect by having two delalylines that have the same inputsignal and their outputsignals mixed. Both delaylines are set to their default 1.33 msec setting and on the control input they receive an LFO signal but the LFO signal on one of the delaylines is inverted so it is in antiphase. This has the affect that as one delaytime is shortened the other is lengthened. Here is an example of a patch that makes the traditional tapeflanger sound.

With tapeflanging it was not possible to have feedback but with delaymodules you can feedback the output to the input to create resonance. In practice there is no difference between the phasing of the combfilter and the flanger, you can get the same effect with a combfilter and a rectified sinewave LFO waveform on the controlinput. This saves a delaymodule.

Phase stereo panning and leslie simulation.

The normal way to create panning in music is by altering the volumelevels for the left and right channels. But there is an alternative way which has the advantage that the signallevels on both channels still have full volume. On a wide stage this means that audiences at both ends of the stage will still hear the instrument as loud as on the other side, the audience in the middle will hear the stereo effect. The disadvantage is that this effect is not monocompatible so it is not advisable to use this on a recording that might be broadcasted on a radiostation that broadcasts in mono.

The way the ear hears stereo is by measuring the difference in time that a sound takes to reach the left ear or the right ear. If there is no phasedifference between the left and right signal the sound appears to be in front of you, but if one of the left and right channels is slightly delayed the sound seems to come from either left or right, actually the side with the least delay. We can achieve this effect if we take the flanger patch and don't mix the outputs signals of the delay modules but feed them directly to the left and the right outputs.

By turning knob1 you can hear this effect. By setting knob1 in the middle position and opening knob2 you hear the signal pan between left and right but on the VU meters of your mixer you will see they keep their volumelevels. This type of panning is very similar to the leslie effect and can be used to create a simple leslie or doppler simulator.

If the delaytimes are not modulated by a LFO the frequencies and levels of both the left and right signals will be exactly the same, only the phase differs so we get a panning effect. But if we start modulating the delaytime the frequencies start to raise and lower in the rhythm of the LFO. If we modulate the delaytimes very deep, the frequencydifference between the left and right signal will become so great that a so called beatfrequency will start to appear. This can add the perception of extra modulation in the rhythm of the beatfrequency. The beatfrequency has a frequency of the highest frequency minus the lowest frequency and changes all the time as the frequencydifference follows the momentary level of the LFO. This effect especially occurs at higher LFO frequencies as these will increase the perceived frequencyshifts. There is some math to prove this, but as promised we won't go into the complex math of FM and PM. Its just a thing to remember if you patch your own leslie and modulated phase stereo patches. Start with only little bits of modulation and increase the modulationdepth with care to get the smoothest results.

Here is a patch that sounds a bit like a tibetan bowl. It uses a slight delay on the modulating delaytime LFO to create the effect of rubbing the stick around the bowl.

So, how does the delayline actually work?

The delayline uses a memorybuffer in the DSP-chip. This buffer is located in the DSP's X-memory and Y-memory. In the patch settings panel in the editorprogram you can see how much of this memory is in use by your patch. A single delayline uses about 10% of this memory for each module. Another module that uses this memory is the Chorus module, about 19% X-memory and 11% Y-memory. If you use several chorus and delay modules it can happen that the DSP inducator gives a red warning "Mem" and the patch becomes silent, although you maybe used 70% DSP time. This is because to much X or Y-memory is requested. You can use up to ten delay modules or up to five chorus modules before you run out of memory.

The memorybuffer is 256 locations (2^8) long. To visualize what happens in this buffer, imagine an endless train of waggons that enters a tunnel. In the tunnel there's room for exactly 256 waggons. When a waggon enters the tunnel the contents of the waggon are replaced by a parcel. This parcel contains the value of the signal of the delayline's input at the moment the waggon enters the tunnel. The waggons enter the tunnel at a fixed speed, 96000 waggons a second (these are virtual waggons, of course). This means that a waggon is in the tunnel for about 2.65 msec (1 / 96000 * 256).

In the tunnel there is a crane hanging on the roof that can move from the entry of the tunnel to the exit of the tunnel and so is able to get a parcel from a waggon at any position in the tunnel. The parcel is taken from the waggon at exactly the same moment a parcel is dropped in the waggon that enters the tunnel and its value is passed on to the output of the delayline. By setting the position of the crane in the tunnel we can define a variable delaytime for every parcel that enters the tunnel.

This way we would have the possibility of having a maximum of 256 distinct delaytime settings, but we have seen that the timing resolution is much higher. The crane at the roof is actually a bit more intelligent. If the crane finds itself in a position halfway two waggons and it has to lift out a parcel it actually takes half of the parcel from one waggon and half of the parcel of the other and adds those half parcels together before passing it to the output. So it takes the average of the two parcels in the two waggons. If the crane is closer to one waggon it will take a bit more from that waggon and a bit less from the other. Actually there are thousands of possible intermediate positions between two waggons.

When working with the delayline module it is good to keep this "train of waggons" picture in our mind. What we have to remember is that the parcels can contain both positive and negative values. The sum of all the values between the entrance and the crane divided by the position of the crane is the total energy stored in the tunnel. When a normal audiosignal is put in the delayline, the average energy in the delayline will normally be zero over a somewhat longer timeperiod. But if we input a slightly asymmetrical signal like e.g. a pulsewave of 25% pulselength the average energy will be nonzero. Now there is a so called DC-component in the signal. If we feedback such a signal from the output to the input of the delayline, the average energy will increase and the audiosignal will shift up to the point of overload. This is a bad situation and when applying feedback of the delayline we must take care this doesn't happen. There are simple ways to avoid this overload, as we will soon see.

More on applying feedback to the combfilter

In the combfilter example we added the output of the delayline and the input of the delayline together to cancel out specific frequencies and enhance other frequencies. By applying feedback we increased the sonic effect, in the same way that the resonance control on a filter increases its sonic effect. The principle is simple, if we feed back the energy that leaves a combfilter back into the combfilter the energy remains there longer and so logic predicts that we will get stronger sonic effects. But only the enhanced frequencies leave the combfilter, the suppressed frequencies will of course not be present in the feedback signal. A strong ringing of the enhanced frequencies will occur and the delayline will behave more or less like a simple acoustic resonant body. A feedback combfilter is also known as a resonator, very similar to a filter with a high Q-setting. But in contrast to a filter, the resonance will occur on a particular frequency AND all the harmonics of that frequency.

Instead of mixing the signals at the output of the delaymodule we moved the mixer before the delay module and mix the signals as in the example above. Mixer2 is now placed before the delaymodule, the output of the mixer is both the output of the resonator and the input to the delayline. When tweaking the mixer module knobs we soon find out that if we make the feedback 100% the resonator starts to oscillate, which is logical as all the energy that leaves the delayline is fed back in. Also, if we set the feedback close to 100% the resonator produces a heavy overloaded signal if the input signal has a high level. A delaysetting of 0 msec, so no delay, also easily produces overload.

The signalboost at zero delaytime and overload caused by asymmetrical inputsignals can be reduced if we put a 6dB highpass filter in the feedback loop and set it to something like 55Hz.

Another way to reduce overload is to apply a 180 degree phaseshift to the feedback signal with an audio inverter module.

Using an inverter changes the characteristic of the resonance as the resonator will now only resonate on the odd harmonics.

To make the resonator more versatile we can add a bandpassfilter before the input to make it resonate on only a single particle from the input signal. For this we have to add an additinal mixer and a bandpassfilter. In the next example a versatile bandpassfilter with center frequency control and bandwidth control is added.

You can hear that the resonance has a slightly longer decay than the original sounds input. By routing the resonators output through an envelope follower / gain controller or a gain controller used as a ringmodulator we can add a distinct metallic ringing to percussive sounds. Using extra envelopes and modulating the various controls makes the fun start.

Physical models of real world instruments and objects

A very exiting synthesis method is physical modelling, where a computer model of a specific instrument or object is used to calculate the sound this object makes when it is hit, plucked, bowed or whatever. Although making an accurate description of such an object is normally done in a regular computerlanguage or special sound description language like Csound, on the Modular we can still make use of the underlying principles of physical modelling to synthesize exiting new sounds that where hardly or simply not possible on pure analog modular systems. A key ingredient in most physical models is a timedelay as short as exactly one period of the waveform we want to generate. And this is where the delaymodule can be used. As an example we will look at what happens if we pluck a guitarstring. Plucking the string transfers energy to the string which makes it vibrate. The energy slowly dies out as a result of the tension in the string and the transfer of energy of the string to the body of the guitar. So let's consider the delayline as the string. We know that if we apply feedback the energy in the delayline is held for a while, in quite a similar way as the vibrating energy in a string. So what if we fill the delayline with a burst of energy and then let it die out. Filling the delayline with energy is simple, just input a short burst of noise, only a few msecs is enough. But the way we make the feedback is pretty important for how the sound will die out.

A first attempt of making a plucked string sound was made by Karplus and Strong. What they did was to average the last two samples in the delayline and feedback the result. Here's an example of the original KarplusStrong plucked string algoritm.

There are several enhancements we can make to the patch. We notice it's not properly tuned to the keyboard, so we need to look at a way to tune the delaylines to a chromatic tuning. The averaging uses an extra delayline, it would be nice if we could do that in a cheaper way that also gives more control over the decay time. Another point is that as the pluck energyburst is added to the energy already in the delayline which could result in overload at very fast play. Let's start with the last two points. We can replace the averaging delayline with a very simple 6dB lowpass filter. Such a filter internally does something very similar to averaging the last two samples of the delayline in the original algoritm. Overload we can prevent with the audio inverter module that as an extra bonus also makes the string sound twice as long, so we get a note an octave lower, saving us delaylines for low notes. Later on we will have an example where the feedback is gated.

If we disable the inverter the sound is more or less the same as the original algoritm, and if we start tweaking the filter's cutoff frequency you can hear the attackpluck getting shorter, the decay gets shorter as well. Enabling the inverter lowers the sound by one octave and gives it a bit the hollow character of an odd-harmonics waveform like a squarewave.

Tuning the delayline to a chromatic scale

The delayline's blue control input controls time in a relation thats inverse logaritmic to the keyboard value from the keyboard module. So we need to transform the keyboard value with such a curve. In practise this is much more simple than it sounds. The module that is able to do the job is the keyboardscaler module. If the curve set in this module is set to decrease with 6dB we have exactly what we need.

Additionally a logic processor is used to monitor if the release of the ADSR has completely died out. If so it empties the delayline by blocking the feedbackpath by closing the GainControl2 module, which now acts like a gate for the feedback signal.

Although the plucked string sound is now chromatically tuned, it is not yet in tune with other sounds on the keyboard and is also only able to play high notes. To get lower notes we have to add more delaylines. If we want to go as low as C2 we need six delay modules in a row.

So here is a properly tuned plucked string instrument, the red morph is connected to the keyboard value and compensates differences in decay time, burst time and detune over the keyboardrange.

Although using a noiseburst makes the sound very much like an acoustic string instrument, we are in no way limited to a noiseburst. Any audio will do actually, even audioinput from outside the Modular can be used. Nice thing is that the volume of the sounds is dependent of the volume of the input waveform. Here is a patch where FormantFM is used to generate the audioburst.

The partials control on the slave oscillator controls the brightness of the sound together with the basic frequency of the master oscillator.

Instead of the 6dB lowpass filter we can use other filters. One thing to keep in mind however, is that all other filtertypes have a slightly irregular gain over the frequencyrange, which easily leads to overload or unstable sounds at certain frequencies. You will find out that especially the resonance control can sometimes mess things up pretty badly. But again, that might be what you're after.

There are lot's more possibilities with these principles. When the audioburst is not gated with a pulse like in the previous examples, but an envelope is used, a bowed or brushed effect can be achieved if the attack is set to a somewhat longer time. Applying feedback FM to the feeding oscillator can also give very interesting results. Well, your imagination is the clearly the limit.

Blown tube example

Another way to use the delayline is to constantly feed it with a sinewave and use the contents of the delayline to build up harmonics that add to the energy already present in the delayline. This way we can create sounds like blown tube instruments. To build up the harmonics we use a ringmodulator (=gain controller module), as multiplying a sinewave with itself generates a sinewave twice the frequency, a useful principle to build up the harmonics.

This concludes uses of the delayline. By now I hope you are convinced that the delay module is a valuable addition to the Modular's already extensive set of modules.