01 April 2007

monotraditionaldelay~

monotraditionaldelaybpm~

This block implements a traditional delay effect with feedback loop. Every parameter can be changed by the inlets, except the measure. It handles a mono signal and outputs a mono signal too. It is based on the parameter bpm and works on the tempo of the song. You can choose how much times the delayed signal is repeated between two beats.

version

v1.0: built 30/03/2007 with Pd v0.40-2 [pd][pdf]

interface

Input 1: the mono signal you want to delay
Input 2: the beats per minute parameter BPM
Input 3: the feedback parameter FBK

Input 4: the on/off switch for external control

Output 1: the delayed, wet mono signal

Controls:

params: These four number boxes show the current values of the respective parameters. There's also a small slider to display the DLY parameter physically (easier to compare the effect of the BPM on the DLY). The DLY value is the delay time between the current and the next signal samples. The BPM value is current tempo that is chosen. actFBK is the current feedback level, which indicates the attenuation of the next delayed signal compared to the current one. The memFBK is the value of FBK that will be used when the switch is turned to back on.

TO DO: find another name for this parameter, as the FBK is not really remembered. This is not a problem, because one has to be able to set a new value before turning it on again.
top number box and horizontal slider: adjust the beats per minute (BPM) parameter. One can choose a tempo for the delay. It ranges from 20bpm tot 250bpm. This equals a maximum delay value of 3000msec when a BPM value of 20bpm is chosen and the measure is 1/1.
bottom number box and horizontal slider: adjust the feedback (FBK) level parameter. The signal is attenuated with this value divided by 1000. In other words, you can vary the level from 0 (no delay audible) to 0.999 (maximum amplitude of the delayed signals, keeps on repeating as if it never ends) with steps of thousands.
switch button: is used to set the FBK parameter to 0 and thus turning of the delayed signal. When the switch is turned back on, the last chosen value of FBK or the new value if the controls are changed, will be reset.

measure: One can specify how many times the signal is sent back into the delayloop between two beats. A fraction of 1/2 will divide the DLY time by two, so that two delays are heard between two beats.

TODO: maybe also some fractions with a numerator greater than the denominator can be added to the effect.

implementation

The delay itself is pretty simple: the incoming signal is read by a delread~ object that writes the signal into a delay line called delay1 and with length 3000msec. Although there's no visible loop, this is how the loop is formed: after a delay time DLY the associated delread~ object reads what's in the delay line, outputs it and sends it back into the delwrite~ object. Before outputting the delayed signals they are attenuated every time by a factor FBK ranging between 0 and 0.999 (with 1 clipping is to easy), in steps of thousands. That's why the control parameter lies between 0.001 and 999.
A possibility is left in the implementation to also mix the wet output with the original, dry signal, by connecting the unconnected throw~ and catch~ objects.
TO DO: It's possible to also implement an HF DAMP function which simulates a retro analog delay effect. It's nothing more than adding a lowpass filter with fairly high cutoff frequency (or even adjustable) in the delayline.
A short calcultation is done to compute the delay time parameter from the BPM and the measure choice DIV. DLY=DIV*60000*BPM^-1. The bang and multiplication block have to be added to ensure direct reaction when another measure is chosen. Here also the default value of 1 is set by using it as a parameter in the multiplication lbock.

The initialisation is done mainly at the left of the canvas: The BPM is set to its maximum value 250 so that the DLY is as small as possible. FBK is set to zero and the switch is off too.

The switch functions because the value of the toggle (0 or 1) is used to multiply the current FBK with, resulting in a zero when the switch is off and the actual value if it is on.

No comments: