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

Method toScaled

src/Quantity.cpp:188–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186}
187
188float Quantity::toScaled(float value) {
189 if (!isBounded())
190 return value;
191 else if (getMinValue() == getMaxValue())
192 return 0.f;
193 else
194 return math::rescale(value, getMinValue(), getMaxValue(), 0.f, 1.f);
195}
196
197float Quantity::fromScaled(float scaledValue) {
198 if (!isBounded())

Callers

nothing calls this directly

Calls 1

rescaleFunction · 0.50

Tested by

no test coverage detected