32 jassert (value >= 0 && value <= 127);
35 :
int (
jmap<float> (
float (value - 64), 0.0f, 63.0f, 0.0f, 8191.0f)) + 8192;
42 jassert (value >= 0 && value <= 16383);
53 return normalisedValue >> 7;
58 return normalisedValue;
64 return (normalisedValue < 8192)
65 ?
jmap<float> (
float (normalisedValue), 0.0f, 8192.0f, -1.0f, 0.0f)
66 :
jmap<float> (
float (normalisedValue), 8192.0f, 16383.0f, 0.0f, 1.0f);
71 return jmap<float> (
float (normalisedValue), 0.0f, 16383.0f, 0.0f, 1.0f);
77 return normalisedValue ==
other.normalisedValue;
94 :
UnitTest (
"MPEValue class", UnitTestCategories::midi)
97 void runTest()
override
99 beginTest (
"comparison operator");
110 beginTest (
"special values");
122 beginTest (
"zero/minimum value");
128 beginTest (
"maximum value");
134 beginTest (
"centre value");
140 beginTest (
"value halfway between min and centre");
169static MPEValueTests MPEValueUnitTests;
float asSignedFloat() const noexcept
static MPEValue maxValue() noexcept
static MPEValue centreValue() noexcept
static MPEValue from14BitInt(int value) noexcept
bool operator==(const MPEValue &other) const noexcept
static MPEValue minValue() noexcept
float asUnsignedFloat() const noexcept
int as7BitInt() const noexcept
int as14BitInt() const noexcept
static MPEValue from7BitInt(int value) noexcept
bool operator!=(const MPEValue &other) const noexcept