setline - create function table 1 with straight line segments
setline(time1, value1, time2, value2, ... timeN, valueN)
Call setline from a script to make function table 1 with straight line segments. Most RTcmix instruments require function table 1 to contain the amplitude envelope, and setline is a convenient way to do this.
Arguments are any number of time,amplitude pairs. These define points through which straight line segments are drawn.
Think of the duration of the function table as the difference between the first time and the last time. The shape created by the table is scaled to fit the duration of each note that follows.
Successive times must be in ascending order. To make an instantaneous change of amplitude, use the same time for two adjacent pairs.
setline(0, 0, 1, 1, 2, 0)
draws a triangular shape, from 0 to 1 to 0. If the next note were to last 1 second, it would reach full amplitude at a half second.
setline is an alias for a makegen call using gen 18, so
setline(0, 0, 1, 1, 2, 0)
is exactly equivalent to
makegen(1, 18, 1000, 0, 0, 1, 1, 2, 0)
The table size for setline is 1000, unless you first call setline_size to change it.