NAME

TRANS - transposing instrument


SYNOPSIS

TRANS(outskip, inskip, outdur, ampmult, transposition [, inchan, stereoloc ])

Function table 1 gives amplitude curve.


DESCRIPTION

TRANS transposes the input for the specified output duration (outdur), starting at the input start time (inskip).

TRANS transposes by second-order polynomial interpolation. It does not maintain the input duration, so it's sort of like changing tape speed. To transpose down, it interpolates samples between existing ones; to transpose up, it discards some existing samples. When transposing up, then, it must consume more than outdur seconds of samples, and this means that it's possible to run off the end of the input file.

It also means that you can use this instrument only with input from a sound file, not with a real-time input (microphone or aux bus) -- at least not without hearing clicks. (That's because you can't read samples that haven't happened yet.)

TRANS uses the curve provided in function table 1 to scale the amplitudes of the input source. Use setline, setexp, or makegen to create function table 1. If this table has not been created, no amplitude scaling (other than that given by ampmult) will occur.

The output of TRANS can be either mono or stereo.


PFIELDS

p0 (outskip) output start time
p1 (inskip) input start time
p2 (outdur) output duration (if negative, output end time)
p3 (ampmult) amplitude multiplier
p4 (transposition) interval of transposition, in octave.pc
p5 (inchan) input channel [optional, default is 0]
p6 (stereoloc) percent (from 0 to 1) of input signal to place in left output channel [optional, default is 0.5 if output is stereo]


EXAMPLES

   rtinput("a_stereo_sound")
   trans = -0.02
   TRANS(outskip=1, inskip=2, dur=4, amp=1, trans, inchan=0, loc=0)

This transposes the left channel of the stereo input file down by two semitones, starting at a point 2 seconds from the beginning of the file and continuing for 4 seconds. It pans the sound hard right.


SEE ALSO

TRANS3, setline, setexp, makegen


AUTHOR

Douglas Scott <netdscott-at-netscape.net>