Name

OscSin

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());
}
//50% period of first one
Oscillator osc = new OscSin(30,50,50);

for(int i=0; i<100; i++){
  osc.update();
  point(i, osc.getValue());
}
//12.5 offset of period
Oscillator osc = new OscSin(30,100,50,12.5);

for(int i=0; i<100; i++){
  osc.update();
  point(i, osc.getValue());
}

Description

Oscillator that generates sin wave. This is subclass of Oscillator class.
All wave oscillators have compatibility with each other. You can generate cos(OscCos), triangle(OscTriangle), square(OscSquare), up-trend sawtooth(OscSawTooth), down-trend sawtooth(OscSawTooth2), in the same way

Methods

basic methods

intermediate methods

advanced methods

  • getAmplitudeOsc()
  • Returns current Oscillator subclass that controlls Amplitude
  • getAmpOffsetOsc()
  • Returns current Oscillator subclass that conrolls Offset of Amplitude
  • getPeriodOsc()
  • Returns current Oscillator subclass that controlls Period
  • getPerOffsetOsc()
  • Returns current Oscillator subclass that controlls Offset of Period

Constructors

  • OscSin(Amplitude, Period)
  • OscSin(Amplitude, Period, AmplitudeOffset)
  • OscSin(Amplitude, Period, AmplitudeOffset, PeriodOffset)

Parameters

  • Amplitude
  • int or float: Amplitude of this wave.
  • Period
  • int of float: Period of this wave.
  • AmplitudeOffset
  • int or float: Offset of amplitude.
  • PeriodOffset
  • int or float: Offset of period.

Usage

  • Web & Application