SCULPT


SCULPT is an instrument which does a time-based resynthesis of frequency / amplitude pairs that have been parsed into makegens. This is useful if you want to do a quick resynthesis of output from, oh, say, AudioSculpt, et vous n'avez pas de CSOUND. Ou quelque chose comme ça. Inspired by Stanko Juzbasic, wherever he may be.

Syntax:


makegen(1, 24, 1000, t0, a0, t1, a1...) /* amplitude curve for the output signal in time/amplitude pairs */
makegen(2, 10, 1000, p0, p1...) /* waveform for the resynthesis, usually a sine wave */

infile("filename", fileno) /* reads in a space/tab/return delimited set of numbers to use as data -- fileno is the number assigned to the file (note -- input and output soundfiles are habitually assigned to filenumbers 0 and 1, so watch out) */
makegen(3, 2, points, fileno) /* reads the first points numbers from open data file fileno into a makegen for frequency positions */
infile("filename", fileno+1)
makegen(4, 2, points, fileno+1) /* does the same thing for amplitude positions which correspond to the frequencies in makegen 3 */

if you're feeling masochistic, you can also fill the gen tables manually:

makegen(3, 2, points, 0) /* 0 in fileno means look on the line below */
freq0, freq1... freqN */ N must equal the number of points-1 */
makegen(4, 2, points, 0)
amp0, amp1... ampN */ same for amplitude values */

SCULPT(outskip, pointdur, amplitude, numpoints, spread) /* pointdur is the lenght of each point in the gens */

in comment form:

/* SCULPT: instrument for tracking audiosculpt data placed in makegens
*
*  p0 = start time
*  p1 = duration of each point
*  p2 = overall amplitude
*  p3 = number of points
*  p4 = stereo spread (0-1) 
*  function slot 1 is overall amp envelope, slot 2 is waveform
*  function slot 3 is frequency points, slot 4 is amplitude points
*/

An example score:

rtsetparams(44100, 2)
load("SCULPT")
makegen(1, 24, 1000, 0, 1, 1, 1)
makegen(2, 10, 1000, 1)
makegen(3, 2, 10, 0)
149.0 159.0 169.0 179.0 189.0 199.0 214.0 215.0 234.0 314.0
makegen(4, 2, 10, 0)
0.0 -7.0 -10.0 -3.0 0.0 -10.0 -20.0 -15.0 -2.1 -1.1

SCULPT(0, 0.5, 10, 10)