TRANSBEND


TRANSBEND does the same thing as TRANS, except that you can change the transposition factor dynamically. Here is the syntax and a bit of explanation:
/* TRANSBEND - perform a time-varying transpose on a mono input signal 
   using cubic spline interpolation

   p0 = output start time
   p1 = input start time
   p2 = output duration (time to end if negative)
   p3 = amplitude multiplier
   p4 = function table slot # for pitch curve
   p5 = input channel [optional, default is 0]
   p6 = stereo spread (0.0-1.0) [optional, default is .5]

   Processes only one channel at a time.

   Assumes function table slot #1 is amplitude curve for the note.
   You can call setline for this.

   Uses the function table slot # specified by p4 as the transposition curve
   for the note.  The interval values in this table are expressed in
   linear octaves.  You can call makegen(2, ...) for this.  So if you
   want to gliss from a perfect 5th above to a perfect 5th below, use:
      makegen(-2, 18, 1000, 0,octpch(.07), 1,octpch(-.07))
*/
And here is a sample scorefile:
rtsetparams(44100, 2);
rtinput("/snd/sources/toot01.aifc");

load("TRANSBEND");

dur = DUR(0);
amp = 1;
pan = 0.5;

/* amplitude curve */
setline(0,0, 1, 1, 90, 1, 100, 0);

/* transpose from 4 semitones up to 8 down - stored in gen slot 2 */
makegen(-2, 18, 512, 1,.4, 512,-.8);

TRANSBEND(0, 0, dur, amp, 2, 0, pan);