21 #define thisTTClass LinearAmplitudeUnit
22 #define thisTTClassName "unit.linear"
23 #define thisTTClassTags "dataspace.unit, gain"
29 LinearAmplitudeUnit::~LinearAmplitudeUnit(){;}
45 #undef thisTTClassName
46 #undef thisTTClassTags
50 #define thisTTClass MidiGainUnit
51 #define thisTTClassName "unit.midi.gain"
52 #define thisTTClassTags "dataspace.unit, gain"
58 MidiGainUnit::~MidiGainUnit(){;}
73 #undef thisTTClassName
74 #undef thisTTClassTags
78 #define thisTTClass DecibelUnit
79 #define thisTTClassName "unit.db"
80 #define thisTTClassTags "dataspace.unit, gain"
86 DecibelUnit::~DecibelUnit(){;}
90 output = pow(10.0,
TTFloat64(input) * 0.05);
109 #undef thisTTClassName
110 #undef thisTTClassTags
114 #define thisTTClass GainDataspace
115 #define thisTTClassName "dataspace.gain"
116 #define thisTTClassTags "foundationDataspaceLib, dataspace, gain"
121 registerUnit(
TT(
"unit.linear"),
TT(
"linear"));
122 registerUnit(
TT(
"unit.midi.gain"),
TT(
"midigain"));
123 registerUnit(
TT(
"unit.db"),
TT(
"dB"));
124 registerUnit(
TT(
"unit.db"),
TT(
"db"));
127 neutralUnit =
TT(
"linear");
130 setInputUnit(neutralUnit);
131 setOutputUnit(neutralUnit);
135 GainDataspace::~GainDataspace()
141 #undef thisTTClassName
142 #undef thisTTClassTags
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to linear.
double TTFloat64
64 bit floating point number
#define TT
This macro is defined as a shortcut for doing a lookup in the symbol table.
TTFOUNDATION_EXPORT const TTFloat64 kTTGainMidiPowerInv
Invverse power constant used when calculating MID gain.
void cliplow(const TTFloat64 &aLowBound)
Clip numerical values below a specified boundary.
Specification for the base class of each DataspaceUnit.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to midi value.
The GainDataspace converts between different measurement untis describing audio gain.
void convertFromNeutral(const TTValue &input, TTValue &output)
Convert from neutral unit to decibels.
TTFOUNDATION_EXPORT const TTFloat64 kTTGainMidiPower
Power constant used when calculating MID gain.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from MIDI units to neutral unit.
TT_OBJECT_CONSTRUCTOR
Constructor macro.
[doxygenAppendixC_copyExample]
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from decibel to neutral unit.
void convertToNeutral(const TTValue &input, TTValue &output)
Convert from linear to neutral unit.