29 March 2007

monotraditionaldelaybpm~ bad try


monotraditionaldelaybpm~

bad try - discontinued

This block delays an incoming signal and outputs the wet signal on one channels. The original signal is not throughput. It works like the traditional delays, this means with a feedback loop, actually one per channel. Users can change all parameters with the visible controls, or they can vary them by using the three other inputs.
When varying the beats pet minute (BPM) parameter, one can choose what the division is of the time between two beats. Only the grey buttons will keep the delayed signal synchronized with the original signal.

version

v1.0: built 28/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
Input 3: the delay time parameter
Input 4: the feedback parameter

Output 1: the delayed, wet monosignal

Controls:
top number box and horizontal slider: adjust the beats per minute (BPM) parameter. It specifies the tempo that synchronizes the delayed signal. It ranges from 20bpm to 250bpm.
middle number box and horizontal slider: adjust the delay time (DLY) parameter. It specifies how long it takes in milliseconds before you hear the following repetition. It ranges from 0msec tot 3000msec (3 seconds). This is not only the maximum value of the slider and number box, but also the length of the delay line used in the implementation. When these are adjusted, the DLY controls are adjusted accordingly.
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. When these are adjusted, the value of the BPM controls are not adjusted accordingly (read the implementation to see why).
switch button: is used to reset the feedback parameter to 0 and thus turning of the delayed signal. When a cross is visible, the effect is turned on. The previous value is remembered and displayed in the number box above the FBK slider as long as one doesn't touch the number box. When turning the effect back on, the slider and the number box jump to the last value remembered.
16 measure buttons: choose the fraction of time between two beats. It resembles the measure of a musical piece, but it is not. It's more like a measure between two beats, as if between two beats a total measure takes places. The grey buttons will stay synchronized between two beats, but also the other ones can stay synchronized over different beats:

implementation

The implementation is the same as the monotraditionaldelay~ block. Only the new details will be described here.

For smoothing the signal when parameters are changed, a line block is implemented for the value.
Adjusting the BPM slider is the same as adjusting the delay time DLY parameter. The factor is: DLY = 60000*BPM^-1. This is then multiplied by a factor that expresses the measure as a fraction of time between two beats. The mechanism used for this is a message that is banged the moment you press the button on the display. This updates the factor (that has a default value of 1). To make sure it updates directly, a bang block is inserted to the hot input of the multiplication block. Inside the message the measure fractions (DIV for division) are set rounded to 5 numbers after the comma.

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.

TO DO: When adjusting DLY, the other one is not updated in the display. In the next version this is taken care of. For this update it would require an inverse recalculation. This consumes CPU time, so the effect of it must be researched first.

The switch toggle switches the effect off by setting the feedback level FBK to 0. The value is remembered and restored when turning the effect back on. In the number display you still see the remembered value. How this system functions can be seen in fig. 1: switch implementation above.

problems

There are some problems, although everything works.

When the output of the bpm slider is connected with the input of the number box above it, an error: stack overflow occurs and slows down the computation. Strange, because exactly the same thing is done with the delay_time controls. The same error shows up when it's adjusted although not connected to each other, but without really slowing things down. The latter happens also with the delay controls. It stops when the r dly block above the controls are uncoupled, for both controls: DLY and BPM.

When the feedback_level controls are adjusted an error: inlet: no method for 'list' occurs if the switch is turned of and an error: stack overflow occurs when the switch is turned on, without really slowing things down.

To make it possible to adjust the DLY control displays when changing the BPM controls the r dly block must stay attached to the delay_time number box. As a result these stack overflow errors keep appearing...




No comments: