COMBIT
A comb filter is a short feedbacking delay line of delay time t which, when applied to an incoming signal, causes the sound to ring at frequency 1/t for an amount of time which decays exponentially proportional to the percentage of feedback (adapted from Roads, 1997). COMBIT takes an input soundfile and makes it ring at the frequency specified in p4 of the instrument, with a decay time in seconds of p5. The efficacy of the comb filter is dependent on the amount of that frequency already present in the incoming signal (thus, a very low filter frequency applied to a high-pitched soundfile will not ring as well as it would applied to a low-sounding signal).
Syntax:
setline(t0,a0,t1,a1...) /* sets the envelope of the output sound in time/amplitude pairs */
COMBIT(inskip, outskip, duration, amplitude, pitch, reverb, inchan, spread)
in comment form:
/* COMBIT -- comb filter instrument
*
* p0 = output skip
* p1 = input skip
* p2 = input duration
* p3 = amplitude multiplier
* p4 = pitch (cps)
* p5 = reverb time
* p6 = input channel [optional]
* p7 = stereo spread [optional]
*
*/
An example score:
rtsetparams(44100, 2)
load("COMBIT")
rtinput("/sndh/bob.dole.mono")
COMBIT(0, 0, 3.5, 0.08, cpspch(7.09), .5, 0, 0)
COMBIT(0.2, 0, 3.5, 0.08, cpspch(7.07), .5, 0, 1)
Another score, using a looping structure:
rtsetparams(44100, 2)
load("COMBIT")
rtinput("/sndh/bob.dole.mono")
dur = 0.1
setline(0,0, 0.1,1, 1,0)
reset(1000)
for (outsk = 0; outsk < 14.0; outsk = outsk + 0.1) {
insk = random() * 7.0
pitch = random() * 500 + 100
COMBIT(outsk, insk, dur, 0.1, pitch, .5, 0, random());
}
A third score, taking input from the ADC:
set_option("full_duplex_on")
rtsetparams(44100, 2, 1024)
load("COMBIT")
rtinput("AUDIO")
COMBIT(0, 0, 3.5, 0.08, cpspch(7.09), .5, 0, 0)
COMBIT(0.2, 0, 3.5, 0.08, cpspch(7.07), .5, 0, 1)