| I guess I should volunteer to explain this, since it's one of my examples
that you are asking about. The instrument demonstrates how to make a simple
flanger, using a delay line with a single, variable tap plus feedback.
The Csound delayr unit allocates memory for a delay line with a maximum
delay time of imaxdel seconds, and outputs the signal from the line delayed
by that fixed amount (adelsig). A delayr unit must be paired with a
subsequent delayw unit, which is used to input (write) an audio signal
(ainsig) into the line. A delayr/delayw pair are functionally equivalent to
a single csound delay unit. The csound delay unit is a closed circuit,
however, with a single fixed output (or tap). A delayr/delayw pair, on the
other hand, can have an arbitrary number of taps inserted between them, and
those taps can have variable delay times. In the example, a single deltapi
is used, as follows:
adelsig delayr imaxdel
avarsig deltapi avardel
delayw ainsig
deltapi is the interpolating version of deltap. It is almost always
preferable when the delay time will be varying dynamically, as it does in
this example. The delay time (avardel) is determined by the following lines:
avardel oscili ivary,ivarhz,ivarfn
avardel = ibase+avardel
The oscili is functioning like an LFO (Low Frequency Oscillator) in a
typical flanger, which sweeps the delay time of the tap slowly back and
forth around a fixed base delay time (ibase). I don't actually use the
output of the delayr unit, but Csound requires a result variable for the unit.
One other potentially confusing aspect of this example is the fact that
there is some feedback of the output for deltapi (avarsig) back into the
delay line. It takes place in the line...
ainsig = asource+avarsig*ifeed
...which takes the source signal coming from the soundin unit and adds in
(feeds back) a portion of avarsig. The amount of feedback is determined by
the factor ifeed, which should be somewhere between 0 and 1. (Anything
greater than 1 may cause uncontrolled growth in the signal's amplitude.) The
feedback tends to accentuate the flange effect.
I hope this helps to explain things. I've written a chapter on the use of
delay lines in Csound for the Boulanger book, but that won't be coming out
from MIT Press until sometime next summer.
Russell Pinkston
>Hi,
>
>Could someone explain me how delayr, delayw, deltap, deltapi work.
>Since I cannot find any books about it, I even do not know how to draw
>a flow chart when I read some instrument design using algorithm
>mentioned above. For example, the instrument below(It is downloaded
>from
>_ftp.maths.bath.ac.uk/pub/dream/documentation/orchestras+scores/instruments
/pinkston.1/delay.orc_):
>
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 1
>;==========================================================================;
>; Example Delay Line Instrument
> ;
>;
> ;
>; p4 = ampfac p5 = soundin# p6 = maxdel p7 = basedel
> ;
>; p8 = pkvardel p9 = vardelhz p10 = vardelfn p11 = feedfac
> ;
>;==========================================================================;
>
> instr 1
>
> iampfac = (p4 == 0 ? 1 : p4)
> imaxdel = p6
> ibase = p7
> ivary = p8
> ivarhz = p9
> ivarfn = p10
> ifeed = p11
> isrcfac = (p12 == 0 ? 1 : p12)
> idelfac = (p13 == 0 ? 1 : p13)
>
> avarsig init 0
> avardel oscili ivary,ivarhz,ivarfn
> avardel = ibase+avardel
> asource soundin p5
> ainsig = asource+avarsig*ifeed
> adelsig delayr imaxdel
> avarsig deltapi avardel
> delayw ainsig
> aoutsig = asource*isrcfac+avarsig*idelfac
> out aoutsig*iampfac
> endin
>
>Thanks & Regards
>==
>Qian Chen
>
>_________________________________________________________
>DO YOU YAHOO!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>
----------------------------------
Russell F. Pinkston, D.M.A.
Associate Professor of Composition
Director, Electronic Music Studios
School of Music
The University of Texas at Austin
Austin, TX 78712
[512-471-0865]
|