NAME

gen4 - make a function from line segments with adjustable curvatures


SYNOPSIS

makegen(table_number, 4, table_size, time1, value1, alpha1, [ timeN-1, valueN-1, alphaN-1, ] timeN, valueN)


DESCRIPTION

Call makegen from a script with a function_type of 4 to make a function table with any number of line segments. Each segment has an adjustable curvature.

Define the curve with triplets of time, value and alpha. time and value work the same way they do in setline: they define a point on the curve. alpha controls the curvature to the next point. The last point has no alpha, because it terminates the last line segment.

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

timeN
The time point at which the curve reaches valueN. The total duration of the table is scaled to fit the duration of each note it affects.

valueN
The value of the curve at timeN.

alphaN
Controls the curvature of the line segment from point N to point N+1.

alpha = 0
makes a straight line.

alpha < 0
makes a logarithmic (convex) shape.

alpha > 0
makes an exponential (concave) shape.


EXAMPLES

   makegen(1, 4, 1000, 0,0,2, 1,1)

makes a ramp from 0 to 1, with a slightly concave shape.


   makegen(1, 4, 1000, 0,0,-2, 1,1)

makes a ramp from 0 to 1, with a slightly convex shape.


   makegen(1, 4, 1000, 0,0,8, 1,1,-8, 2,0)

makes a ramp from 0 to 1 to 0, with steep curves between the three points.


   makegen(1, 4, 1000, 0,0,-6, 1,.5,2, 2,0,0, 4,1)

defines 4 points -- at 0,0, 1,.5, 2,0 and 4,1 -- and specifies a different shape for each of the three connecting line segments. The last segment is a straight line (with alpha = 0).



SEE ALSO

makegen