PeriodTable class public functions

PeriodTable
~PeriodTable
add
flip
leftShift
print
ramp
reverse
rightShift
subtract
sine
square
triangle

Functions inherited from LookupTable:
doLinearInterpolation
doConstantInterpolation
operator=
Functions inherited from LookupTableCI:
base
borrow
borrowQ
getSize
operator[]
operator+=
operator-=
operator*=
setSize
zero

PeriodTable(int size = 0);
Sets the interpolation type to linear and creates an internal lookup table to store one period of a waveform.
PeriodTable(sampleType* aTable, int size);
Sets the interpolation type to linear and borrows the given array as the lookup table for the object.
PeriodTable(sampleType* aTable, int size);
Sets the interpolation type to linear and borrows the given array as the lookup table for the object.
PeriodTable(char* oscString, int size=1024);
Sets the interpolation type to linear and creates a wavetable according to the oscString harmonic envelope.

~PeriodTable();
Deletes the table array if not borrowed.

void add(int periods, double amp, double phase = 0);
Adds a sinewave with the specified number of periods fitting into the lookup table. Phase is specified in radians. A negative number of periods will shift the phase by π.
void add(char* oscString);
Adds the set of sinewaves specified in the harmonic envelope string. Example: (1 0.1; 2 0.01 0.34) puts two harmonics in the lookup table: (1) one period, amplitude 0.1, phase = 0; (2) two periods, amplitude 0.01, phase 0.34.

void flip(void);
Flips the lookup table values. Similar to reverse, but the first element in the lookup table is not moved. Equivalent to reversing the sound in time. Also equivalent to shifting all of the harmonic component phases each by π.

void leftShift(int amount);
Shift the lookup table to the left by amount. Make sure you know what you are doing when you leftShift a borrowed table!

void print(void);
Prints the data in the table as a Mathematica ListPlot.

void ramp(double amplitude = 1);
Replaces the contents of the lookup table with a linear ramp starting at -amplitude and going to +amplitude inclusive.

void reverse(void);
Reverses the lookup table. Make sure you know what you ar doing if you reverse a borrowed table!

void rightShift(int amount);
Shift the lookup table to the right by amount. Make sure you know what you are doing when you rightShift a borrowed table!

void subtract(int periods, double amp, double phase = 0);
Subtracts a sinewave with the given number of periods/amp/phase in the lookuptable.
void subtract(char* oscString);
Subtracts the set of sinewaves given in the input harmonic envelope.

void sine(double amplitude = 1);
Replaces the contents of the lookup table with a sinewave with amplitude 1 and fitting one period into the table.

void square(double amplitude = 1);
Replaces the contents of the lookup table with a square wave with one period fitting in the table. If the table has an odd length, then the middle value of the square wave will be 0.

void triangle(double amplitude = 1);
Replaces the contents of the lookup table with a triangle wave with one period fitting in the table.