22 May 2007

project sound examples

For now this project will rest a few months (exams). We made a few sound examples to let you hear some effects, and a few concrete things one can do with an intelligent effect patch as explained in the final written project report.
In the folder effects one finds several examples of DAFx.
In the folder iDAFx one finds the five basic tracks used to mix a song and then a showcase called song.

16 May 2007

tap

tap

This block outputs a bpm value when triggered by a bang that can come from a MIDI message (eg a drum pad). When it loses track because the trigger is not periodic enough, it restarts and for a moment (2 taps) holds the previous tempo.

version

v1.0: built 14/05/2007 with Pd v0.40-2 [pd][pdf]
based on http://www.parasitaere-kapazitaeten.net/Pd/pdpatches

interface

Input 1: the inlet that receives triggers, anything counts: a bang, a value,...
Input 2: a reset knob: resets the counting when tempo is lost. Also happens automatically.

Output 1: the tempo in beats per minute (bpm)
Output 2: a bang when tempo is lost. It's not necessary to connect this with the reset input. It's taken care of inside

implementation


To calculate the tempo, this algorithm uses three steps: it calculates the interval between the previous click and the current click, it calculates the mean inter-click interval time and it computes the bpm value of this. Then as an extra step the last value before losing the tempo and dropping to 0bpm is remembered by only updating the outlet if it's not 0 (0 can never be a tempo of a song, therefor it's allowed)
The time between the current and previous tap, beat or click is calculated by a timer object, which does just that. A simple counter is used to start this process only after two taps, each time the reset restarts the counter.

Then the mean is calculated by adding the new value to the sum of the previous values (this last sum is made by multiplying the last mean value by the last counter index, so a small backward recalculation is done). This is each time divided by the current counter value (indicating the number of terms of the sum).

Another step decides if the tempo is between the right values, that it doesn't deviate too much. If it does, the whole thing is reset.

15 May 2007

round

round

This block extends the integer calculations of Pure Data by allowing to use a rounding value of a float.

version

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

interface

Input 1: a float control signal input

Output 1: an integer control signal output signal

implementation

A floor operation is performed on the value. This floored value is subtracted from the original version, which gives a value between 0 and 1. If this value is greater than or equal to 0.5, then the int block which holds the floored value + 1 is banged, otherwise the int block with the floored value is banged. The last int block is just to collect signals, it's not necessary for the correct functioning of this algorithm.

dynamics

dynamics

This block is a versatile dynamics processing block that, depending on the parameters on its inlets is a limiter, compressor, expander or noise gate. It can compress, suppress and expand at the same time. Four regions can be chosen, each with their own behaviour. One has to use an argument when using multiple instances of this block in the same patch.

version

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

interface

Input 1: the (mono) audio signal input
Input 2, 3, 4: The different thresholds expressed in a dB scale ranging from 0dB to 100dB. (this means that a threshold of -20dB equals 80dB in this scaling)
Input 5, 6, 7, 8: The different ratios R that indicate the behaviour of what happens if the signal level reaches that part.
limiter
R = infinity
compressor
1 < R < infinity
linear
R = 1
expander
0 < R < 1
noise gate
R = 0

Output1: the output audio signal

Display:
In the abstraction itself one can see the input signal level compared to the output signal level and compared to the unity level 100dB (or 0dB). Also g(k) is displayed against unity.

implementation


We use a scheme based on DAFx (p37). The level of the signal is measured to obtain the instantaneous RMS in dB with the env~ block. We take an RMS over 2048 samples. Some moses blocks route X(dB) the right way. Then the following calculation is done:
g(k) = [th + ( X(dB)-th )/R] / X(dB)
The float object f does nothing else but collecting the four routes.
The delay on the original signal is meant to align the samples but is now set on 0, because we haven't made a method yet to discover how long the delay in the other leg is. There is a certain drift anyway, because the gain factor g(k) is often greater than 1 even when all ratios R are 1. TODO

09 May 2007

pitchShifter~

pitchShifter~

This block shifts the pitch over some halftones, up or down according to the sign of the first inlet. There is a variable delay between the minimum delay,
corresponding to the third inlet and the the minimum delay + the size of the window, corresponding to the second inlet.

version

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

interface

Input1: incoming mono audio signal
Input2: number of halftones up or down depending on sign of the input
Input3: the size of the window in ms
Input4: the minimum delay in ms

Output 1: original signal shifted over a number of halftones specified by input2

implementation

The desired pitch shift in halftones(num) is converted into a transposition factor t= 2^(num/12)= e^(num*log(2)/12) = e^(0.05776*num).
In the tape head rotation speed part f is calculated with f = [(t-1)*Fs]/s (Fs= samplerate and s= size window). This f is used to calculate
the saw tooth signals and corresponding envelopes.
The minimum delay (input3) is added to both sawtooth signals to make the delay input for the vd~ blocks.
The fact that two copies are made (one is shifted in phase with respect to the other one --> 0.5 correspondig to 180 degrees)
is to avoid discontinuities due to sampling.
Finally both vd~ block outputs are then multiplied by the corresponding envelopes and summed.

multitapdelay~ / reversedelay~

multitapdelay~ / reversedelay~

These blocks are derivatives of the very general stereomultitapdelay~ block. They represent specific cases that are nice to use in practice. The multitapdelay~ has 10 delay taps that each are DLY (delay time) delayed and the next tap is always FBK (feedback level) attenuated. One can choose which taps are played back. The new settings herefore work only when the FBK is touched again. An argument must be specified when one wants to use multiple delays in one patch. The reversedelay~ does exactly the same but each tap will incremently play louder.
For both effects one can choose to give a pingpong effect by adjusting the panning of all taps. The uneven taps evenly go left, the even taps evenly right for positive PAN values.

version

v1.0 [pdf]

pan~ v1.1 [pd]

v1.0: built 9/05/2007 with Pd v0.40-2 [multitapdelay~.pd] [reversedelay~.pd]

interface

Input 1: the signal you want to delay.
Input 2: the delay time parameter DLY. It specifies how long it takes in milliseconds before you hear the following repetition. It ranges from 0msec tot 3000msec (3 seconds). This is the length of the delay line used in the implementation and is thus an absolute maximum.
Input 3: the feedback parameter FBK. The first tap is attenuated (amplified) with this value divided by 100 (1000) for the multitapdelay~ (reversedelay~). 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 hundreds/thousands. The system can't get instable because there are no feedback loops involved. But when the FBK value is 100 (internally 0.1) for the reversedelay~, the last tap is at its maximum, being as loud as the original signal.
Input 4: the panorama parameter PAN. The value ranges between -127 and 127. They are applied evenly to each tap, but the uneven ones with a reversed value.

Output 1, 2, 3, 4, 5, 6, 7, 8, 9, 10: the delayed, wet taps
Output 11, 12: the delayed, wet stereo signal.

implementation


At the left the delay part is shown. Each tap will receive it's final DLY parameter here. The multiplication with 1 is a leftover from the general stereomultitapdelay~ implementation which also provided feedback loops here. At the bottom of this image the two main outlets are shown.
Everything is labeled with dollar arguments to ensure unique working when using multiple instance of delays.
In the image above the inlet is shown and also the section that calculates all the DLY and FBK parameters. For the multitapdelay~ here it is:
DLYi = SUMi(DLY)
FBKi = 1(or 0)*(FBK/100)^i
That means the DLY parameter is linearly raised and the FBK parameter is exponentially attenuated.
The next image shows this part for the reversedelay~ (it's the only section that differs for both effects). The feedback is now linearly raised.
DLYi = SUMi(DLY)
FBKi = 1(or 0)*SUMi(FBK/1000)

The next image shows the section that controls the on/off position of each tap and shows the position of each taps' parameters. The loadbang block and set 1 message are there to initialize the patch to all taps on.

The next section shows how the panning is controlled and shows also the rest of the taps.
The uneven taps get a reversed value of the PAN parameter. Each tap is connected to an outlet before entering the panning logic. After the panning logic the both channels are routed to the main outlets. For information of the pan~ function one must look at the respective documentation.
TO DO: put the outlets of each tap in a specific logical order

ringmod~

ringmod~

A type of audio mixer combining two audio signals, and outputting their sum and difference. The frequencies found in the original signals are not passed through to the output. For example, if two sine waves (single frequency waveforms containing no overtones) are inputted, one with a frequency of 1000 Hz, and the second at 400 Hz, the ring modulator will output two frequencies: 600 Hz and 1400 Hz. With more complex waveforms (which contain many more overtone frequencies) ring modulators produce a clangorous, "metallic" result often used for special effects, in synth programming, and so on. One popular use has been to process vocals, which produces sci-fi sounding "robotic" voices. [sw]

version

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

interface

Input 1: the (mono) audio signal input
Input 2: the modulation frequency, it's got no real boundaries but typical values are presented in the image on top.
Input 3: a reset inlet. When this is banged, the modulating wave is reset to it's beginning. Look at the documentation of the waves block.

Output1: the ring-modulated output audio signal

Controls:
MIDI commands for choosing different oscillators for modulation. View the documentation of the waves block.

implementation

Digital ring modulation is nothing more than a multiplication of a signal with another signal. The modulating signals' frequency is very low when one wants to hear the modulating envelope. For ring modulation it's faster. The multiplication is an arbitrary scaling of the modulation frequency input and can be left away. The outlet is high pass filtered to forbid the lowest frequencies (inaudible 5Hz and less) to slip through.