NAME

gen10 - make a function with a waveform, composed of harmonic partials


SYNOPSIS

makegen(table_number, 10, table_size, harmonic1_amp [, harmonic2_amp, ... harmonicN_amp ])


DESCRIPTION

Call makegen from a script with a function_type of 10 to make a function table with a waveform. You define the waveform in terms of any number of harmonic partials, with specific amplitudes for each.

NOTE: Much of the functionality of gen 10 has been duplicated and extended by the "wave" 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. The larger the size, the less quantization noise you'll get when using this with a wavetable oscillator (as in WAVETABLE).

harmonicN_amp
The amplitude of harmonic partial number N.


EXAMPLES

   makegen(2, 10, 1000, 1)

makes one cycle of a sine wave, at full amplitude.

   makegen(2, 10, 1000, 1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8, 1/9, 1/10)

makes one cycle of a sawtooth wave, at full amplitude. (The amplitude of each partial is the inverse of its partial number.)

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

makes two cycles of a sine wave, at full amplitude. This works because the second partial has twice the frequency of the first partial, and the first partial has zero amplitude.

   makegen(2, 10, 1000,  1, 0, 1/3, 0, 1/5, 0, 1/7, 0, 1/9, 0, 1/11, 0,
            1/13, 0, 1/15, 0, 1/17, 0, 1/19, 0, 1/21, 0, 1/23, 0, 1/25)

makes one cycle of a square wave. (Only odd-numbered partials are present, and the amplitude of each is the inverse of its partial number.)


NOTES

Gen 9 lets you specify a waveform with inharmonic, as well as harmonic, partials, and lets you control the starting phase of each.


SEE ALSO

makegen, gen9