Name

Oscillator

Examples

import net.fladdict.oscillator.*;

Oscillator osc = new OscSin(30,100,50);

for(int i=0; i<100; i++){
  osc.update();
  point(i, osc.getValue());
}
//using with array
Oscillator[] osc = new Oscillator[2];

osc[0] = new OscSin(30,50,50);
osc[1] = new OscCos(50,100,50);

for(int i=0; i<100; i++){
  osc[0].update();
  osc[1].update();
  stroke(255,0,0);
  point(i, osc[0].getValue());
  stroke(0,0,255);
  point(i, osc[1].getValue());
}

Description

Oscillator is used as a data type that contains all kinds of oscillators.
Syntax
  • Oscillator var;
  • Oscillator var = value;
Parameters
  • var
  • variable name referencing the oscillator subclasses
  • value
  • Oscillator: all sub class of Oscillator class
Usage
  • Web & Application