Jamoma API
0.6.0.a19
|
TTMixer mixes N input channels of a signal to M output channels of a signal. More...
#include <TTMixer.h>
Protected Member Functions | |
TTErr | setNumInputs (const TTValue &newValue) |
Set the number of audio input channels to the mixer. More... | |
TTErr | setNumOutputs (const TTValue &newValue) |
Set the number of audio output channels from the mixer. More... | |
TTErr | checkMatrixSize (const TTChannelCount x, const TTChannelCount y) |
Check what the current mixer size is. More... | |
TTErr | clear () |
Clear the matrix by setting all gain coefficients to 0. More... | |
TTErr | restoreMatrix () |
Restore matrix coefficients. More... | |
TTErr | setGain (const TTValue &newValue, TTValue &) |
Set the gain as desibel for one inlet to one outlet. More... | |
TTErr | setLinearGain (const TTValue &newValue, TTValue &) |
Set the gain as linear amplitude for one inlet to one outlet. More... | |
TTErr | setMidiGain (const TTValue &newValue, TTValue &) |
Set the gain as midi value for one inlet to one outlet. More... | |
TTErr | processAudio (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs) |
Process audio. More... | |
TTErr | processAudioInterpolated (TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs) |
Process audio with interpolation. More... | |
Protected Attributes | |
TTMatrix | mGainMatrix |
A NxM matrix of mixing coefficients. | |
TTBoolean | mInterpolated |
A flag determine if we will be interpolating towards new matrix values whenever a gain value is being updated. | |
TTMatrix | oldGainMatrix |
Required for the process of resizing when changing the number of inputs or outputs. | |
TTMatrix | tempGainMatrix |
Required for the process of resizing when changing the number of inputs or outputs. | |
TTChannelCount | mNumInputs |
The number of audio inputs. | |
TTChannelCount | mNumOutputs |
The number of audio outputs. | |
TTMixer mixes N input channels of a signal to M output channels of a signal.
|
protected |
Check what the current mixer size is.
x | The current number of audio input signals |
y | The current number of audio output signals |
Definition at line 126 of file TTMixer.cpp.
References kTTErrNone, mNumInputs, mNumOutputs, setNumInputs(), and setNumOutputs().
Referenced by setGain(), setLinearGain(), and setMidiGain().
|
protected |
Clear the matrix by setting all gain coefficients to 0.
Definition at line 119 of file TTMixer.cpp.
References TTMatrix::clear(), kTTErrNone, mGainMatrix, and oldGainMatrix.
Referenced by setNumInputs(), and setNumOutputs().
|
protected |
Process audio.
This version of the processing method is the simpler and more efficient. It will be used whenever no gain values have been recently changes. If the mInterpolated flag is NOT set, it will also be used when gain coefficients change. This saves CPU as compared to the more expensive processAudioInterpolated method, but at the risk of audible clicks and discontinuities.
Definition at line 212 of file TTMixer.cpp.
References TTAudioSignal::clear(), TTMatrix::get2d(), kTTErrNone, mGainMatrix, mNumInputs, mNumOutputs, TTAudioSignal::mSampleVectors, and TTAudioSignal::setMaxNumChannels().
Referenced by processAudioInterpolated().
|
protected |
Process audio with interpolation.
If a gain coefficient has been updated, and the mInterpolated flag is set, this method will be used for the next vector to be processed, and will ensure that matrix coefficients ramp (interpolate) to their new values over the duration of the next vector. Upon completion, this unit will be set to use the simpler and more efficient processAudio method again, until next time a matrix gain coefficient is changed.
Definition at line 257 of file TTMixer.cpp.
References TTAudioSignal::clear(), TTMatrix::get2d(), kTTErrNone, mGainMatrix, mNumInputs, mNumOutputs, TTAudioSignal::mSampleVectors, oldGainMatrix, processAudio(), TTMatrix::set2d(), TTAudioSignal::setMaxNumChannels(), and setProcessMethod.
Referenced by setGain(), setLinearGain(), and setMidiGain().
|
protected |
Restore matrix coefficients.
This method is used when the matrix is being resized.
Definition at line 98 of file TTMixer.cpp.
References TTObject::get(), TTMatrix::get2d(), kTTErrNone, mGainMatrix, mNumInputs, mNumOutputs, oldGainMatrix, TTMatrix::set2d(), and tempGainMatrix.
Referenced by setNumInputs(), and setNumOutputs().
Set the gain as desibel for one inlet to one outlet.
newValue | An array of three values is expected:
|
Definition at line 144 of file TTMixer.cpp.
References checkMatrixSize(), kTTErrNone, kTTErrWrongNumValues, mGainMatrix, mInterpolated, processAudioInterpolated(), TTMatrix::set2d(), setProcessMethod, TTValue::size(), and TTDecibelsToLinearGain().
Set the gain as linear amplitude for one inlet to one outlet.
newValue | An array of three values is expected:
|
Definition at line 167 of file TTMixer.cpp.
References checkMatrixSize(), kTTErrNone, kTTErrWrongNumValues, mGainMatrix, mInterpolated, processAudioInterpolated(), TTMatrix::set2d(), setProcessMethod, and TTValue::size().
Set the gain as midi value for one inlet to one outlet.
newValue | An array of three values is expected:
|
Definition at line 189 of file TTMixer.cpp.
References checkMatrixSize(), kTTErrNone, kTTErrWrongNumValues, mGainMatrix, mInterpolated, processAudioInterpolated(), TTMatrix::set2d(), setProcessMethod, TTValue::size(), and TTMidiToLinearGain().
Set the number of audio input channels to the mixer.
Definition at line 65 of file TTMixer.cpp.
References clear(), TTMatrixBase::copy(), TTMatrix::instance(), kTTErrNone, mGainMatrix, mNumInputs, mNumOutputs, oldGainMatrix, restoreMatrix(), TTObject::set(), and tempGainMatrix.
Referenced by checkMatrixSize().
Set the number of audio output channels from the mixer.
Definition at line 82 of file TTMixer.cpp.
References clear(), TTMatrixBase::copy(), TTMatrix::instance(), kTTErrNone, mGainMatrix, mNumInputs, mNumOutputs, oldGainMatrix, restoreMatrix(), TTObject::set(), and tempGainMatrix.
Referenced by checkMatrixSize().