NAME

copygen - copy a function table, with optional size and interpolation change


SYNOPSIS

copygen(new_table, old_table [, new_size [, interpolation_type ]])


DESCRIPTION

Call copygen from a script to make a new function table by copying the elements of one table into a new one. The new table may have a different size, in which case an interpolation scheme may be employed.

NOTE: Much of the functionality of copygen has been duplicated and extended by the copytable in the new (in RTcmix 4.0) table-handle scheme.


ARGUMENTS

new_table
The numeric ID for the new function table. (This can be the same as old_table, if you want to overwrite the old one.)

old_table
The numeric ID for the existing function table.

new_size
If this argument is given and is non-zero, then the new function table will have this number of elements. If this argument is not given, then the new table will have the same number of elements as the old one.

interpolation_type
This optional argument specifies the type of interpolation to use when copying the table to a new one with a larger size. The types are:

  1. no interpolation

  2. linear interpolation

If this argument is not given, then linear interpolation will be used.


EXAMPLES

   /* Make a low-resolution sine wave (only 30 table elements). */
   makegen(1, 10, 30, 1)
   /* Copy sine wave to a larger table with no interpolation. */
   copygen(2, 1, 10000, 0)

Table number 2 will contain a sine wave with stair-steps. The reason you might want this is that most instruments using function tables will perform linear interpolation between adjacent table values, thus smoothing your low-resolution sine wave. If you really want a jagged sine wave, then you have to make a very large table that preserves the jagged shape.


SEE ALSO

makegen, addgens, multgens, offsetgen, scalegen, invertgen, reversegen, shiftgen, quantizegen


AUTHOR

John Gibson <johgibso at indiana edu>