Jamoma API
0.6.0.a19
|
TTAdsr is an attack-decay-sustain-release envelope generator. More...
#include <TTAdsr.h>
Protected Types | |
enum | eg_states { k_eg_inactive, k_eg_attack, k_eg_decay, k_eg_sustain, k_eg_release } |
Enumerations tracking the state of the envelope. More... | |
Protected Member Functions | |
TTErr | updateSampleRate (const TTValue &, TTValue &) |
This method must be called when the sample rate change. More... | |
TTErr | dictionary (const TTValue &input, TTValue &output) |
Send a dictionary from Jamoma Graph to this object in order to pass a MidiNoteEvent or set attributes. More... | |
TTErr | processAudioLinear (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs) |
The Linear audio processing method use linear amplitude curves for all parts of the envelope. More... | |
TTErr | processAudioExponential (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs) |
The Exponential processing methods use exponential curves for all sections of the envelope. More... | |
TTErr | processAudioHybrid (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs) |
The Hybrid processing method combines a linear attack with an exponential release. More... | |
TTErr | setAttack (const TTValue &newValue) |
Set the attack time for the enevelope. More... | |
TTErr | setDecay (const TTValue &newValue) |
Set the decay time for the envelope. More... | |
TTErr | setSustainDb (const TTValue &newValue) |
Set the signal level to use for the sustain, expressed in decibels. More... | |
TTErr | getSustainDb (TTValue &returnedValue) |
Get the signal level currently used for the sustain, measured in decibels. More... | |
TTErr | setSustainAmp (const TTValue &newValue) |
Set the signal level to use for the sustain, expressed as linear amplitude. More... | |
TTErr | setRelease (const TTValue &newValue) |
Set the release time in milliseconds. More... | |
TTErr | setMode (const TTValue &newValue) |
Set the performance mode to use for the envelope. More... | |
Protected Attributes | |
TTFloat64 | attack_ms |
Attack duration in milliseconds. | |
TTInt32 | attack_samples |
Attack duration in total number of samples. | |
TTFloat64 | attack_step |
Stepsize for each sample in the attack phase. | |
TTFloat64 | attack_step_db |
Stepasize in decibels for each sample in the attack phase. | |
TTFloat64 | decay_ms |
Decay duration in milliseconds. | |
TTInt32 | decay_samples |
Decay duration in total number of samples. | |
TTFloat64 | decay_step |
Stepsize for each sample during the decay phase. | |
TTFloat64 | decay_step_db |
Stepsize in decibels for each sample during the decay phase. | |
TTFloat64 | sustain_amp |
Sustain level as linear amplitude. | |
TTFloat64 | sustain_db |
Sustain level as decibel value. | |
TTFloat64 | release_ms |
Release duration in milliseconds. | |
TTInt32 | release_samples |
Release duration in total number of samples. | |
TTFloat64 | release_step |
Stepsize for each sample during the release phase. | |
TTFloat64 | release_step_db |
Stepsize in decibels for each sample during the release phase. | |
TTSampleValue | output |
Current envelope value as linear amplitude. | |
TTSampleValue | output_db |
Current envelope value as decibel value. | |
TTInt16 | eg_state |
The current state of the envelope. Tracks what envelope phase that we are currently in. | |
TTAdsr is an attack-decay-sustain-release envelope generator.
|
protected |
Enumerations tracking the state of the envelope.
ingroup enums
Send a dictionary from Jamoma Graph to this object in order to pass a MidiNoteEvent or set attributes.
Sending a dictionary to this object may perform one of several functions.
Definition at line 52 of file TTAdsr.cpp.
References TTDictionary::getSchema(), TTDictionary::getValue(), kTTErrInvalidType, kTypeDictionary, and TT.
Get the signal level currently used for the sustain, measured in decibels.
returnedValue | Used to return the current sustain signal level in dB. |
Definition at line 143 of file TTAdsr.cpp.
References kTTErrNone, sustain_amp, and TTLinearGainToDecibels().
|
protected |
The Exponential processing methods use exponential curves for all sections of the envelope.
inputs | The input audio vector to process. For this unit generator this is basically ignored. |
outputs | The returned processed audio. |
Definition at line 227 of file TTAdsr.cpp.
References attack_step_db, decay_step_db, eg_state, k_eg_attack, k_eg_decay, k_eg_inactive, k_eg_release, k_eg_sustain, kTTErrNone, TTAudioSignal::mSampleVectors, TTAudioSignalArray::numAudioSignals, output, output_db, release_step_db, sustain_amp, and TTDecibelsToLinearGain().
Referenced by setMode().
|
protected |
The Hybrid processing method combines a linear attack with an exponential release.
inputs | The input audio vector to process. For this unit generator this is basically ignored. |
outputs | The returned processed audio. |
Definition at line 295 of file TTAdsr.cpp.
References attack_step, decay_step_db, eg_state, k_eg_attack, k_eg_decay, k_eg_inactive, k_eg_release, k_eg_sustain, kTTErrNone, TTAudioSignal::mSampleVectors, TTAudioSignalArray::numAudioSignals, output, output_db, release_step_db, sustain_amp, TTDecibelsToLinearGain(), and TTLinearGainToDecibels().
Referenced by setMode().
|
protected |
The Linear audio processing method use linear amplitude curves for all parts of the envelope.
inputs | The input audio vector to process. For this unit generator this is basically ignored. |
outputs | The returned processed audio. |
Definition at line 165 of file TTAdsr.cpp.
References attack_step, decay_step, eg_state, k_eg_attack, k_eg_decay, k_eg_inactive, k_eg_release, k_eg_sustain, kTTErrNone, TTAudioSignal::mSampleVectors, TTAudioSignalArray::numAudioSignals, output, release_step, and sustain_amp.
Referenced by setMode().
Set the attack time for the enevelope.
The maximum attack amplitude is normalised to 0 dB.
newValue | The desired attack time in milliseconds. |
Definition at line 99 of file TTAdsr.cpp.
References attack_ms, attack_samples, attack_step, attack_step_db, kTTErrNone, and TTAudioObjectBase::sr.
Referenced by updateSampleRate().
Set the decay time for the envelope.
newValue | The desired decay time in milliseconds. |
Definition at line 109 of file TTAdsr.cpp.
References decay_ms, decay_samples, decay_step, decay_step_db, kTTErrNone, and TTAudioObjectBase::sr.
Referenced by updateSampleRate().
Set the performance mode to use for the envelope.
Possible options are 'exponential', 'linear' and 'hybrid'
Definition at line 150 of file TTAdsr.cpp.
References kTTErrNone, processAudioExponential(), processAudioHybrid(), processAudioLinear(), setProcessMethod, and TT.
Set the release time in milliseconds.
param newValue The desired release time in milliseconds.
Definition at line 119 of file TTAdsr.cpp.
References kTTErrNone, release_ms, release_samples, release_step, release_step_db, and TTAudioObjectBase::sr.
Referenced by updateSampleRate().
Set the signal level to use for the sustain, expressed as linear amplitude.
newValue | The desired sustain level in decibels. |
Definition at line 129 of file TTAdsr.cpp.
References kTTErrNone, sustain_amp, sustain_db, and TTLinearGainToDecibels().
Set the signal level to use for the sustain, expressed in decibels.
newValue | The desired sustain level in decibels. |
Definition at line 136 of file TTAdsr.cpp.
References kTTErrNone, sustain_amp, sustain_db, and TTDecibelsToLinearGain().
This method must be called when the sample rate change.
Definition at line 82 of file TTAdsr.cpp.
References attack_ms, decay_ms, kTTErrNone, release_ms, setAttack(), setDecay(), and setRelease().