Package processing.sound
Class Oscillator<JSynOscillator extends UnitOscillator>
java.lang.Object
processing.sound.SoundObject
processing.sound.Oscillator<JSynOscillator>
- All Implemented Interfaces:
Modulator
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 TypeMethodDescriptionvoidvoidfreq(float freq) Sets the frequency of the oscillator.voidModulates the frequency of this oscillator using another generator, typically a (low frequency) oscillator.voidplay()Starts the generatorvoidplay(float freq, float amp) voidplay(float freq, float amp, float add) Deprecated.voidplay(float freq, float amp, float add, float pos) Starts the oscillatorvoidset(float freq, float amp, float pos) Set multiple parameters at oncevoidset(float freq, float amp, float add, float pos) Deprecated.voidstop()Stop the oscillator from playing backMethods inherited from class processing.sound.SoundObject
add, amp, channels, getUnitGenerator, isPlaying, pan
-
Method Details
-
getModulator
- Specified by:
getModulatorin interfaceModulator
-
freq
public void freq(float freq) Sets the frequency of the oscillator.- Parameters:
freq- the desired oscillator frequency in Hertz
-
freq
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 staticfloatvalue passed tofreq(), and the dynamic value produced by the modulator (which fluctuates around 0).- Parameters:
modulator- an oscillator or noise object
-
amp
-
play
public void play()Description copied from class:SoundObjectStarts the generator- Overrides:
playin classSoundObject
-
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:
stopin classSoundObject
-