OscComposite
description
Special kind of oscillator that contains series of oscillators, and returns mixed wave of them.
example
Oscillator osc;
void setup(){
loop();
Oscillator[] osc_array = { new OscSin(100,100), new OscCos(50,13), new OscTriangle(15,15)}
osc = new OscComposite( osc_array );
}
void draw(){
osc.update();
println( osc.getValue());
}
constractor
OscComposite()
Syntax
OscComposite( Oscillator[] );
basic method
update()
update current wave status.
basically called every frame.
getAmplitude()
Returns current amplitude of wave.
getValue()
Returns current value of wave.
Value is between -amplitude and amplitude plus offset of amplitude;
SetAmplitude()
Sets amplitude of wave.intermediate method
getAmpOffset()
Returns offset of amplitude.
setAmpOffset(float or int)
Sets offset of amplitude.
addOscillator(Oscillator)
Adds oscillator to this composite.
getChildOscillators()
Adds oscillator to this composite.
setChildOscillators(Oscillator[])
Adds oscillator to this composite.
advanced method
setAmplitudeOsc(Oscillator)
Sets Oscillator Object instead of number to controll amplitude.
setAmpOffsetOsc(Oscillator)
Sets Oscillator Object instead of number to controll amplitude offset.
getAmplitudeOsc()
Returns Oscillator Object that controlls amplitude.
If you are using number to controll amplitude. It returns OscConstant Object that contains number.
getAmpOffsetOsc()
Returns Oscillator Object that controlls amplitude offset.
If you are using number to controll amplitude. It returns OscConstant Object that contains number.