Class Oscillator<JSynOscillator extends UnitOscillator>

java.lang.Object
processing.sound.SoundObject
processing.sound.Oscillator<JSynOscillator>
All Implemented Interfaces:
Modulator
Direct Known Subclasses:
Pulse, SawOsc, SinOsc, SqrOsc, TriOsc

public abstract class Oscillator<JSynOscillator extends UnitOscillator> extends SoundObject implements Modulator
For advanced users: common superclass of all oscillator sound sources
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    amp(Modulator modulator)
     
    void
    freq(float freq)
    Sets the frequency of the oscillator.
    void
    freq(Modulator modulator)
    Modulates the frequency of this oscillator using another generator, typically a (low frequency) oscillator.
     
    void
    Starts the generator
    void
    play(float freq, float amp)
     
    void
    play(float freq, float amp, float add)
    Deprecated. 
    void
    play(float freq, float amp, float add, float pos)
    Starts the oscillator
    void
    set(float freq, float amp, float pos)
    Set multiple parameters at once
    void
    set(float freq, float amp, float add, float pos)
    Deprecated. 
    void
    Stop the oscillator from playing back

    Methods inherited from class processing.sound.SoundObject

    add, amp, channels, getUnitGenerator, isPlaying, pan

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getModulator

      public UnitOutputPort 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

      public void amp(Modulator modulator)
    • play

      public void play()
      Description copied from class: SoundObject
      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