.TH ZDELAY 1carl CARL
.SH NAME
zdelay \- variable index interpolating delay
.SH SYNOPSIS
.B zdelay
[
.B -DN
] [
.B -zN
] [
.B -fX
] [
.B -dN
] [
.B -RN
]
< floatsams > output
.SH DESCRIPTION
flags: (default)
.TP
.B -DN
set maximum delay to be used to N
.TP
.B -zN
set initial delay to N
.TP
.B -fX
read floatsam function file X
.TP
.B -dN
set duration of run to N
.TP
.B -RN
set sample rate to N
.PP
.B zdelay
can delay a signal on its standard input by a variable function of time
specified with the
.I -fX
flag, where file 
.I X 
contains a delay function.
The values of delay can specify non-integral indexes.  The output sample
is then derived from the two adjacent actual samples by linear interpolation.
.PP
The delay function must consist of floating point binary data (floatsams)
of Y values only (x values are automatically assumed to go from 
0 incrementally).  Suitable functions can be created with any 
.I cmusic
.I gen
program.
The function is interpolated over the number of samples specified with the
.I -dN
flag, where 
.I N
is the duration in seconds.
The function specifies the derivative of the ratio of the
output sample increment rate to the input sample increment rate.
So for example,
values of the function are interpreted as follows:
.EQ
f(x) = 1.0, 
.EN
output rate = input rate, frequency of signal is unshifted;
.EQ
f(x) < 1.0,
.EN
frequency drops;
.EQ
f(x) > 1.0,
.EN
frequency rises.
For
.EQ
f(x) = .5,
.EN
the frequency drops 1 octave, for
.EQ
f(x) = 2.0,
.EN
it rises an octave.
This makes the zdelay very suited for implementing doppler shift.
.PP
Care must be exercised that the delay does not become positive (i.e.,
attempts to read future inputs) or too negative (i.e., exceeds the
length of the delay line specified with the
.I -D
flag).  In both cases, the sample algorithm ``wraps around'' in time to
the oldest or newest samples, respectively.
The 
.I -z
flag can be used to position the initial delay time (effectively a constant
time offset) in a place within the delay line by hand.  Otherwise, the
offset is automatically set to 1/2 the delay line length.
.PP
Other (among numerous) uses of a zdelay are 
.I flanging 
and
.I phasing.
.SH AUTHOR
Gareth Loy
.SH BUGS
This program is virtually obsolete. See the \fIzdelay\fR unit
generator in \fIcmusic\fR.
