gen4 - make a function from line segments with adjustable curvatures
makegen(table_number, 4, table_size, time1, value1, alpha1, [ timeN-1, valueN-1, alphaN-1, ] timeN, valueN)
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.
Normally the table will be rescaled to fit between -1 and 1. Put a negative sign before the number to prevent this.
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).