p0 = output start time (seconds) p1 = input start time (seconds) p2 = output duration (or endtime if negative) (seconds) p3 = amplitude multiplier (relative multiplier of input signal) p4 = speed multiplier p5 = sync width (samples) p6 = sync oversampling (samples) p7 = input channel [optional; default is 0] p8 = percent to left [optional; default is .5] p3 (amplitude), p4 (speed multiplier) can receive dynamic updates from a table or real-time control source Author: Doug Scott, based on interpolation and i/o code by Tobias Kunze-Briseno.
The "syncwidth" (p5) and "oversampling" (p6) parameters determine how the buffer used for scrubbing will be set up. These don't seem to have an obvious effect on the sound. It also seems that they should be < the buffer size set in rtsetparams.
The buffer size set in rtsetparams seems to have a significant effect on the sound.
The output of SCRUB can be either mono or stereo
Sample Scores
very basic:
rtsetparams(44100, 2) load("SCRUB") rtinput("mysound.aif") speed = 1 dur = DUR(0) skip = 0 // Play forward from time 0 SCRUB(0, skip, dur, 1, speed, 16, 40)
rtsetparams(44100, 2, 2048) load("SCRUB") rtinput("mysound.wav") speedchange = maketable("line", 8192, 0,1, 1,-1) dur = DUR(0) * 2 skip = 0 // Play file, moving from normal speed to reverse normal SCRUB(0, skip, dur, 1, speedchange, 16, 40)
rtsetparams(44100, 2, 256) load("SCRUB") rtinput("mysound.aif") speed = -1 skip = DUR(0) dur = skip // Play backwards from end to beginning in channel 0 SCRUB(0, skip, dur, 1, speed, 16, 40, 0, 0) speed = -0.5 skip = DUR(0) dur = DUR(0) * 2 // Play reversed at half-speed from end in channel 1 SCRUB(0, skip, dur, 1, speed, 16, 40, 0, 1)