public class Oscil extends UGen
UGen.InputType, UGen.UGenInput
Modifier and Type | Field and Description |
---|---|
UGen.UGenInput |
amplitude
Patch to this to control the amplitude of the oscillator with another UGen.
|
UGen.UGenInput |
frequency
Patch to this to control the frequency of the oscillator with another UGen.
|
UGen.UGenInput |
offset
Patch to this to control the DC offset of the Oscil.
|
UGen.UGenInput |
phase
Patch to this to control the phase of the oscillator with another UGen.
|
Constructor and Description |
---|
Oscil(float frequencyInHertz,
float amplitude)
Constructs an Oscil UGen given frequency in Hz and amplitude.
|
Oscil(float frequencyInHertz,
float amplitude,
Waveform waveform)
Constructs an Oscil UGen given frequency in Hz, amplitude, and a waveform
|
Oscil(Frequency frequency,
float amplitude)
Constructs an Oscil UGen given a Frequency and amplitude.
|
Oscil(Frequency freq,
float amp,
Waveform waveform)
Constructs an Oscil UGen given a Frequency, amplitude, and a waveform
|
Modifier and Type | Method and Description |
---|---|
void |
reset()
Resets the time-step used by the oscillator to be equal to the
current phase value.
|
protected void |
sampleRateChanged()
This routine will be called any time the sample rate changes.
|
void |
setAmplitude(float newAmp)
Sets the amplitude of this Oscil.
|
void |
setFrequency(float hz)
Sets the frequency of this Oscil.
|
void |
setFrequency(Frequency newFreq)
Sets the frequency of this Oscil.
|
void |
setPhase(float newPhase)
Set the amount that the phase will be offset by.
|
protected void |
uGenerate(float[] channels)
Implement this method when you extend UGen.
|
addInput, getLastValues, patch, patch, patch, printInputs, removeInput, sampleRate, setAudioChannelCount, setSampleRate, tick, unpatch, unpatch
public UGen.UGenInput amplitude
public UGen.UGenInput frequency
public UGen.UGenInput phase
public UGen.UGenInput offset
public Oscil(float frequencyInHertz, float amplitude, Waveform waveform)
frequencyInHertz
- the frequency this should oscillate atamplitude
- the base amplitudewaveform
- the waveform we will oscillate overpublic Oscil(float frequencyInHertz, float amplitude)
frequencyInHertz
- the frequency this should oscillate atamplitude
- the amplitudepublic Oscil(Frequency frequency, float amplitude)
frequency
- the frequency this should oscillate atamplitude
- the amplitudeprotected void sampleRateChanged()
sampleRateChanged
in class UGen
public void setFrequency(float hz)
hz
- the frequency, in Hertz, to set this Oscil topublic void setFrequency(Frequency newFreq)
freq
- the Frequency to set this Oscil topublic void setAmplitude(float newAmp)
newAmp
- amplitude to set this Oscil topublic void setPhase(float newPhase)
newPhase
- public void reset()
protected void uGenerate(float[] channels)
UGen
getLastValues
method of your audio UGenInput to
retrieve the audio you want to modify, which you will then modify however
you need to, assigning the result to the values in channels
.