NAME

gen5 - make a function with any number of exponential line segments


SYNOPSIS

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


DESCRIPTION

Call makegen from a script with a function_type of 5 to make a function table with any number of exponential line segments, where the ratio between successive values is equal.

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 setexp more convenient.

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

NOTE: Much of the functionality of gen 5 has been duplicated and extended by the "expbrk" 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.

A value of 0 will be converted internally to 0.00001.

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, 5, 1000, 0.01, 1000, 1)

makes an exponential ramp from 0.01 to 1.


   makegen(1, 5, 1000, 0, 700, 1, 300, 0.01)

makes an exponential ramp from 0.00001 to 1 over 700 table elements, followed by an exponential ramp from 1 to 0.01 over 300 table elements. The first segment is steeper, because the ratio between its values, 0.00001 and 1, is greater. (Remember, a 0 value is converted internally to 0.00001.)



SEE ALSO

makegen, setexp, gen7