OscSin and other wave oscillator class
description
Series of oscillators that returns various waves.
OscSin, OscCos, OscTriangle, OscSquare, OscSawTooth, OscSawTooth2 has same API..
If you want to contain those object into one variable , use Oscillator as a data type.
example
Oscillator osc;
void setup(){
loop();
osc = new OscSin(100,100);
}
void draw(){
osc.update();
println( osc.getValue());
}
constractor
OscSin()
Syntax
OscSin(amplitude, period);
OscSin(amplitude, period, amplitudeOffset);
OscSin(amplitude, period, amplitudeOffset, periodOffset);
basic method
update()
update current wave status.
basically called every frame.
getAmplitude()
Returns current amplitude of wave.
getPeriod
Returns current total period(length) of wave.
getValue()
Returns current value of wave.
Value is between -amplitude and amplitude plus offset of amplitude;
SetAmplitude()
Sets amplitude of wave.
SetPeriod()
Set period of wave.
intermediate method
getAmpOffset()
Returns offset of amplitude.
getPerOffset()
Returns offset of period.
setAmpOffset(float or int)
Sets offset of amplitude.
setPerOffset(float or int)
Sets offset of period.
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.
setPeriodOsc(Oscillator)
Sets Oscillator Object instead of number to controll period.
setPerOffsetOsc(Oscillator)
Sets Oscillator Object instead of number to controll period 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.
getPeriodOsc()
Returns Oscillator Object that controlls period.
If you are using number to controll amplitude. It returns OscConstant Object that contains number.
getPerOffsetOsc()
Returns Oscillator Object that controlls period offset.
If you are using number to controll amplitude. It returns OscConstant Object that contains number.