NAME

WAVETABLE - wavetable synthesis instrument


SYNOPSIS

WAVETABLE(outskip, dur, amp, freq [, stereoloc ])

Function table 1 gives amplitude curve.

Function table 2 gives waveform.


DESCRIPTION

WAVETABLE consults a wavetable -- a table that stores one cycle of an arbitrary waveform -- to construct a signal at a specified frequency. It scans the wavetable at a rate determined by the frequency and table size. (See Dodge and Jerse, or any other computer music text, for detailed explanation of this process.)

WAVETABLE uses the curve provided in function table 1 to scale the amplitude of the output. Use setline, setexp, or makegen to create function table 1. If this table has not been created, no amplitude scaling will occur.

WAVETABLE uses the waveform in function table 2. Use gen 9 or gen 10 to make this.

The output of WAVETABLE can be either stereo or mono.


PFIELDS

p0 (outskip) output start time
p1 (dur) duration
p2 (amp) peak amplitude
p3 (freq) frequency (or pitch in octave.pc if < 15)
p4 (stereoloc) percent (from 0 to 1) of signal to place in left output channel [optional, default is 0 if output is stereo]


EXAMPLES

The following plays a sine wave for 4 seconds, at a frequency of 440 Hz and peak amplitude of 10000.

   makegen(2, 10, 1000, 1)    /* sine wave */
   WAVETABLE(outskip = 0, dur = 4, amp = 10000, freq = 440)

The following plays a sawtooth wave for 2 seconds, starting at 3 seconds after the beginning of the score. The pitch is the G above middle C, the peak amplitude is 4500, and the stereo location is nearly hard right.

   makegen(2, 10, 1000, 1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9)
   WAVETABLE(outskip = 3, dur = 2, amp = 4500, pitch = 8.07, loc = 0.1)

Make the sound a little more interesting by using two WAVETABLE calls, each with slightly different pitch, to get a chorusing effect.

   dur = 10
   amp = 8000
   pitch = 8.00
   makegen(2, 10, 1000, 1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9)
   WAVETABLE(0, dur, amp, pitch, loc = 0.4)
   WAVETABLE(0, dur, amp, pitch + 0.0002, loc = 0.6)


SEE ALSO

setline, setexp, makegen, gen9, gen10, WIGGLE