NAME

gen7 - make a function with any number of straight line segments


SYNOPSIS

makegen(table_number, 7, table_size, value1, num_elements1 [, valueN-1, num_elementsN-1, ... ] valueN)


DESCRIPTION

Call makegen from a script with a function_type of 7 to make a function table with any number of straight line segments.

The num_elements arguments control how many table elements a line segment spans, as it connects two successive value arguments.

If you want to use this to make table number 1 -- for an amplitude envelope, for example -- you may find setline more convenient.

Gen 5 works just like gen 7, except that it uses exponential line segments.

NOTE: Much of the functionality of gen 7 has been duplicated and extended by the "linebrk" table-type in maketable and the new (in RTcmix 4.0) table-handle scheme.


ARGUMENTS

table_number
The numeric ID for the function table.

Normally the table will be rescaled to fit between -1 and 1. Put a negative sign before the number to prevent this.

table_size
The size of the function table: how many values it stores.

value
The value at the start or end point of a line segment.

num_elements
The number of table elements connecting the previous value to the next value.

The sum of all the num_elements arguments must equal table_size.


EXAMPLES

   makegen(1, 7, 1000, 0, 200, 1, 600, 0.5, 200, 0)

makes a straight-line ramp from 0 to 1 over 200 table elements, followed by another ramp from 1 to 0.5 over 600 table elements, and then a ramp from 0.5 to 0 over 200 table elements.



SEE ALSO

makegen, setexp, gen5