rotate
The rotate instrument simulates the functionality of a vari-speed tape recorder, allowing for sample playback at different transposition levels.
Unlike
mrotate,
rotate only allows for a static transposition level.
Syntax:
makegen(1, 24, 1000, t0, a0, t1, a1...) /* amplitude curve in time/amp pairs */
makegen(2, 25, 1000, window) /* a hanning (1) or hamming (0) window for the windowing of the sound */
rotate(outskip, inskip, duration, amplitude, pitch_shift, window_size, inchan, spread) /* pitch_shift is in positive/negative 8ve.pc, and window_size, importantly, is in seconds, not samples */
in comment form:
/* rotate -- a pitch-shifting instrument based upon the idea
* of old rotating tape-head pitch shifters
*
* p0 = output skip
* p1 = input skip
* p2 = duration
* p3 = amplitude multiplier
* p4 = pitch shift up or down (oct.pc)
* p5 = window size IN SECONDS!!!!!!!!!!!!!!!!!!!
* p6 = input channel number
* p7 = stereo spread (0-1) [optional]
* assumes function table 1 is the amplitude envelope
* assumes function table 2 is the window envelope
*
*
*/
An example score:
load("rotate")
input("/sndh/bob.dole.mono.snd")
output("/sndh/rotate.snd")
makegen(1, 24, 1000, 0,0, 1,1, 8,1, 8.7,0)
makegen(2, 25, 1000, 1) /* hanning window */
rotate(0, 0, 8.7, 0.2, 0, 0.1)
rotate(0, 0, 8.7, 0.2, 0.02, 0.11)
rotate(0, 0, 8.7, 0.2, 0.07, 0.14)
rotate(0, 0, 8.7, 0.2, -0.03, 0.09)
Another score:
load("rotate")
input("/sndh/bob.dole.mono.snd")
output("/sndh/rotate.snd")
makegen(1, 24, 1000, 0,0, 1,1, 8,1, 8.7,0)
makegen(2, 25, 1000, 1) /* hanning window */
rotate(0, 0, 8.7, 0.2, 0, 0.1, 0, 0.5)
rotate(0, 0, 8.7, 0.2, 1.00, 0.11, 0, 0)
rotate(0, 0, 8.7, 0.2, -1.07, 0.14, 1, 0.99)
A third score, demonstrating different window types:
load("rotate")
input("/sndh/bob.dole.mono.snd")
output("/sndh/rotate.snd")
makegen(1, 24, 1000, 0,0, 1,1, 8,1, 8.7,0)
makegen(2, 25, 1000, 1) /* hanning window */
rotate(0, 0, 3.4, 0.2, 1, 0.1)
makegen(2, 25, 1000, 2) /* hamming window */
rotate(0, 3.5, 3.4, 0.2, 1, 0.1)