sndwarpst — Reads a stereo sound sample from a table and applies time-stretching and/or pitch modification.





ar1, ar2 [,ac1] [, ac2] sndwarpst xamp, xtimewarp, xresample, ifn1, \
      ibeg, iwsize, irandw, ioverlap, ifn2, itimemode


ifn1 -- the number of the table holding the sound samples which will be subjected to the sndwarpst processing. GEN01 is the appropriate function generator to use to store the sound samples from a pre-existing soundfile.




ioverlap -- determines the density of overlapping windows.

ifn2 -- a function used to shape the window. It is usually used to create a ramp of some kind from zero at the beginning and back down to zero at the end of each window. Try using a half a sine (i.e.: f1 0 16384 9 .5 1 0) which works quite well. Other shapes can also be used.


ar1, ar2 -- ar1 and ar2 are the stereo (left and right) outputs from sndwarpst. sndwarpst assumes that the function table holding the sampled signal is a stereo one. sndwarpst will index the table by a two-sample frame increment. The user must be aware then that if a mono signal is used with sndwarpst, time and pitch will be altered accordingly.

ac1, ac2 -- ac1 and ac2 are single-layer (no overlaps), unwindowed versions of the time and/or pitch altered signal. They are supplied in order to be able to balance the amplitude of the signal output, which typically contains many overlapping and windowed versions of the signal, with a clean version of the time-scaled and pitch-shifted signal. The sndwarpst process can cause noticeable changes in amplitude, (up and down), due to a time differential between the overlaps when time-shifting is being done. When used with a balance unit, ac1 and ac2 can greatly enhance the quality of sound. They are optional, but note that they must both be present in the syntax (use both or neither). An example of how to use this is given below.

xamp -- the value by which to scale the amplitude (see note on the use of this when using ac1 and ac2).




The below example shows a slowing down or stretching of the sound stored in the stored table (ifn1). Over the duration of the note, the stretching will grow from no change from the original to a sound which is ten times “slower” than the original. At the same time the overall pitch will move upward over the duration by an octave.

iwindfun = 1
isampfun = 2
ibeg = 0
iwindsize = 2000
iwindrand = 400
ioverlap = 10
awarp   line    1, p3, 1
aresamp line    1, p3, 2
kenv    line    1, p3, .1


itimemode     =         1
atime         line      0, p3, 10
                        iwindfun, itimemode



abal        balance asig, acmp
                                  iwindfun, itimemode
abal1       balance asig1, acmp1
abal2       balance asig2, acmp2


[Note] More Advice


See Also



Author: Richard Karpen
Seattle, WA USA