All Implemented Interfaces:
Modulator
Direct Known Subclasses:
Pulse, SawOsc, SinOsc, SqrOsc, TriOsc

For advanced users: common superclass of all oscillator sound sources

  • Method Summary

    void

    void

    freq(float freq)

    Sets the frequency of the oscillator.

    void

    Modulates the frequency of this oscillator using another generator, typically a (low frequency) oscillator.

    void

    play()

    void

    play(float freq, float amp)

    void

    play(float freq, float amp, float add)

    void

    play(float freq, float amp, float add, float pos)

    void

    set(float freq, float amp, float pos)

    Set multiple parameters at once

    void

    set(float freq, float amp, float add, float pos)

    void

    stop()

    Stop the oscillator from playing back

  • Method Details

    • getModulator

      Specified by:
      getModulator in interface Modulator
    • freq

      public void freq(float freq)

      Sets the frequency of the oscillator.

      Parameters:
      freq - the desired oscillator frequency in Hertz
    • freq

      public void freq(Modulator modulator)

      Modulates the frequency of this oscillator using another generator, typically a (low frequency) oscillator. The effective frequency of the oscillator will be the sum of the static float value passed to freq(), and the dynamic value produced by the modulator (which fluctuates around 0).

      Parameters:
      modulator - an oscillator or noise object
    • amp

    • play

      public void play()

      Starts the generator

      Overrides:
      play in class SoundObject
    • play

      public void play(float freq, float amp)

    • play

      public void play(float freq, float amp, float add)

      Deprecated.

    • play

      public void play(float freq, float amp, float add, float pos)

      Starts the oscillator

      Parameters:
      freq - The frequency value of the oscillator in Hz.
      amp - The amplitude of the oscillator as a value between 0.0 and 1.0.
      pos - The panoramic position of the oscillator as a float from -1.0 to 1.0.
    • set

      public void set(float freq, float amp, float pos)

      Set multiple parameters at once

      Parameters:
      freq - The frequency value of the oscillator in Hz.
      amp - The amplitude of the oscillator as a value between 0.0 and 1.0.
      pos - The panoramic position of the oscillator as a float from -1.0 to 1.0.
    • set

      public void set(float freq, float amp, float add, float pos)

      Deprecated.

    • stop

      public void stop()

      Stop the oscillator from playing back

      Overrides:
      stop in class SoundObject