public class ADSR extends UGen
UGen.InputType, UGen.UGenInput
Modifier and Type | Field and Description |
---|---|
UGen.UGenInput |
audio
The default input is "audio."
You won't need to patch to this directly, since
simply patching to the ADSR itself will achieve
the same result.
|
Constructor and Description |
---|
ADSR()
Constructor for an ADSR envelope.
|
ADSR(float maxAmp)
Constructor for an ADSR envelope with maximum amplitude.
|
ADSR(float maxAmp,
float attTime)
Constructor for an ADSR envelope with maximum amplitude, attack Time.
|
ADSR(float maxAmp,
float attTime,
float decTime)
Constructor for an ADSR envelope with maximum amplitude, attack Time, and decay time.
|
ADSR(float maxAmp,
float attTime,
float decTime,
float susLvl)
Constructor for an ADSR envelope with maximum amplitude, attack Time, decay time, and sustain level.
|
ADSR(float maxAmp,
float attTime,
float decTime,
float susLvl,
float relTime)
Constructor for an ADSR envelope with maximum amplitude, attack Time, decay time, sustain level,
and release time.
|
ADSR(float maxAmp,
float attTime,
float decTime,
float susLvl,
float relTime,
float befAmp)
Constructor for an ADSR envelope with maximum amplitude, attack Time, decay time, sustain level,
release time, an amplitude before the envelope.
|
ADSR(float maxAmp,
float attTime,
float decTime,
float susLvl,
float relTime,
float befAmp,
float aftAmp)
Constructor for an ADSR envelope.
|
Modifier and Type | Method and Description |
---|---|
void |
noteOff()
Specifies that the ADSR envelope should start the release time.
|
void |
noteOn()
Specifies that the ADSR envelope should begin.
|
protected void |
sampleRateChanged()
Use this method to notify the ADSR that the sample rate has changed.
|
void |
setParameters(float maxAmp,
float attTime,
float decTime,
float susLvl,
float relTime,
float befAmp,
float aftAmp)
Permits the changing of the ADSR parameters.
|
protected void |
uGenerate(float[] channels)
Implement this method when you extend UGen.
|
void |
unpatchAfterRelease(AudioOutput output)
Tell the ADSR that it should unpatch itself from the output after the release time.
|
void |
unpatchAfterRelease(UGen ugen)
Tell the ADSR that it should unpatch itself from this UGen after the release time.
|
addAudio, addControl, addControl, addInput, channelCount, channelCountChanged, getLastValues, patch, patch, patch, printInputs, removeInput, sampleRate, setChannelCount, setSampleRate, tick, unpatch, unpatch
public UGen.UGenInput audio
public ADSR()
public ADSR(float maxAmp)
maxAmp
- float: the maximum amplitude for the envelopepublic ADSR(float maxAmp, float attTime)
maxAmp
- float: the maximum amplitude for the envelopeattTime
- float: the attack time, in secondspublic ADSR(float maxAmp, float attTime, float decTime)
maxAmp
- float: the maximum amplitude for the envelopeattTime
- float: the attack time, in secondsdecTime
- float: the decay time, in secondspublic ADSR(float maxAmp, float attTime, float decTime, float susLvl)
maxAmp
- float: the maximum amplitude for the envelopeattTime
- float: the attack time, in secondsdecTime
- float: the decay time, in secondssusLvl
- float: the percentage of the maximum amplitude to maintain after the decay completespublic ADSR(float maxAmp, float attTime, float decTime, float susLvl, float relTime)
maxAmp
- float: the maximum amplitude for the envelopeattTime
- float: the attack time, in secondsdecTime
- float: the decay time, in secondssusLvl
- float: the percentage of the maximum amplitude to maintain after the decay completesrelTime
- float: the release time, in secondspublic ADSR(float maxAmp, float attTime, float decTime, float susLvl, float relTime, float befAmp)
maxAmp
- float: the maximum amplitude for the envelopeattTime
- float: the attack time, in secondsdecTime
- float: the decay time, in secondssusLvl
- float: the percentage of the maximum amplitude to maintain after the decay completesrelTime
- float: the release time, in secondsbefAmp
- float: the amplitude to apply before the envelope is activatedpublic ADSR(float maxAmp, float attTime, float decTime, float susLvl, float relTime, float befAmp, float aftAmp)
maxAmp
- float: the maximum amplitude for the envelopeattTime
- float: the attack time, in secondsdecTime
- float: the decay time, in secondssusLvl
- float: the percentage of the maximum amplitude to maintain after the decay completesrelTime
- float: the release time, in secondsbefAmp
- float: the amplitude to apply before the envelope is activatedaftAmp
- float: the amplitude to apply once the envelope has completedpublic void setParameters(float maxAmp, float attTime, float decTime, float susLvl, float relTime, float befAmp, float aftAmp)
maxAmp
- float: the maximum amplitude for the envelopeattTime
- float: the attack time, in secondsdecTime
- float: the decay time, in secondssusLvl
- float: the percentage of the maximum amplitude to maintain after the decay completesrelTime
- float: the release time, in secondsbefAmp
- float: the amplitude to apply before the envelope is activatedaftAmp
- float: the amplitude to apply once the envelope has completedpublic void noteOn()
public void noteOff()
protected void sampleRateChanged()
sampleRateChanged
in class UGen
public void unpatchAfterRelease(AudioOutput output)
output
- AudioOutput: the output this should unpatch itself frompublic void unpatchAfterRelease(UGen ugen)
ugen
- the UGen this should unpatch itself fromprotected 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
.