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 TypeMethodDescriptionvoid
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()
Starts the generatorvoid
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 oscillatorvoid
set
(float freq, float amp, float pos) Set multiple parameters at oncevoid
set
(float freq, float amp, float add, float pos) Deprecated.void
stop()
Stop the oscillator from playing backMethods inherited from class processing.sound.SoundObject
add, amp, channels, getUnitGenerator, isPlaying, pan
-
Method Details
-
getModulator
- Specified by:
getModulator
in 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 staticfloat
value 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:SoundObject
Starts the generator- Overrides:
play
in 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:
stop
in classSoundObject
-