Oscillator (Javadocs: Processing Sound)
- All Implemented Interfaces:
Modulator
For advanced users: common superclass of all oscillator sound sources
-
Method Summary
voidvoidfreq(float freq) Sets the frequency of the oscillator.
voidModulates the frequency of this oscillator using another generator, typically a (low frequency) oscillator.
voidplay()voidplay(float freq, float amp) voidplay(float freq, float amp, float add) voidplay(float freq, float amp, float add, float pos) voidset(float freq, float amp, float pos) Set multiple parameters at once
voidset(float freq, float amp, float add, float pos) voidstop()Stop the oscillator from playing back
-
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
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
floatvalue 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()
Starts 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
-