//----------------------------------------------------------------------------- tresult RangeNoteExpressionType::getStringByValue (NoteExpressionValue valueNormalized /*in*/, String128 string /*out*/) { NoteExpressionValue plain = valueNormalized * (getMax () - getMin ()) + getMin (); UString128 wrapper; wrapper.printFloat (plain, precision); wrapper.copyTo (string, 128); return kResultTrue; }
//----------------------------------------------------------------------------- tresult PLUGIN_API RezFilterController::getParamStringByValue (ParamID tag, ParamValue valueNormalized, String128 string) { UString128 result; switch (tag) { case 4: { float att = (float)pow (10.0, -0.01 - 4.0 * valueNormalized); result.printFloat (-301.0301 / (getSampleRate () * log10(1.0 - att)), 2); break; } case 5: { float rel = 1.f - (float)pow (10.0, -2.00 - 4.0 * valueNormalized); result.printFloat (-301.0301 / (getSampleRate () * log10(rel)), 2); break; } case 7: { result.printFloat (pow (10.0f, (float)(4.f*valueNormalized - 2.f)), 2); break; } case 8: { float tthr = 0; if (valueNormalized<0.1f) tthr=0.f; else tthr = 3.f * valueNormalized * valueNormalized; if (tthr == 0) result.fromAscii("FREE RUN"); else result.printFloat (20*log10 (0.5*tthr), 2); break; } default: return BaseController::getParamStringByValue (tag, valueNormalized, string); } result.copyTo (string, 128); return kResultTrue; }
//----------------------------------------------------------------------------- tresult NoteExpressionType::getStringByValue (NoteExpressionValue valueNormalized /*in*/, String128 string /*out*/) { if (associatedParameter) { associatedParameter->toString (valueNormalized, string); return kResultTrue; } UString128 wrapper; if (info.valueDesc.stepCount > 0) { int32 value = Min<int32> (info.valueDesc.stepCount, (int32)(valueNormalized * (info.valueDesc.stepCount + 1))); wrapper.printInt (value); } else { wrapper.printFloat (valueNormalized, precision); } wrapper.copyTo (string, 128); return kResultTrue; }