On Sat, 26 Nov 2016 15:46:29 +0100
Jörn Eichler <joerneichler@xxxxxxx> wrote:
At the end of dev_notes/ToDo.txt I found this:
"LFO frequency should be stated in Hz."
I gave it a try and I have a working version for LFO freq.
The code can be found on my showLFOFrequencyInHz branch on github:
https://github.com/Yoshimi/yoshimi/compare/21d982f6c92fc076399ccaeaeb41907fb7c82e06...heuchi:showLFOFrequencyInHz
I added a function to WidgetPDial, which I called show_custom_value(string).
This function can be used in the callback code for the controls.
float lfofreq = (powf(2.0f, o->value() * 10.0f) - 1.0f) / 12.0f;
ostringstream oss;
oss.precision(3);
oss << lfofreq << " Hz";
o->show_custom_value(string(oss.str()));
This doesn't look very nice yet, because of the string generation. We might
add a helper in Misc/MiscFuncs to simplify it. Something like:
string valueWithUnit(float value, string unit);
Some more controls this could be used for:
Amplitude LFO depth in %
Frequency LFO depth in cents.
Attack, Decay, Release Times in ms
Comments welcome.
Jörn