MCPcopy Create free account
hub / github.com/VCVRack/Rack / getDisplayValue

Method getDisplayValue

src/engine/ParamQuantity.cpp:73–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73float ParamQuantity::getDisplayValue() {
74 float v = getValue();
75 if (displayBase == 0.f) {
76 // Linear
77 // v is unchanged
78 }
79 else if (displayBase < 0.f) {
80 // Logarithmic
81 v = std::log(v) / std::log(-displayBase);
82 }
83 else {
84 // Exponential
85 v = std::pow(displayBase, v);
86 }
87 return v * displayMultiplier + displayOffset;
88}
89
90
91void ParamQuantity::setDisplayValue(float displayValue) {

Callers

nothing calls this directly

Calls 2

powFunction · 0.85
logFunction · 0.50

Tested by

no test coverage detected