This breaks a lot of controls, because they are misusing it as well.
void set_value (double);
double get_value () const;
void set_value (double);
double get_value () const;
- virtual double internal_to_interface (double v) const {
- return v;
- }
-
- virtual double interface_to_internal (double v) const {
- return v;
- }
-
- virtual double internal_to_user (double v) const {
- return v;
- }
-
double lower() const { return parameter().min(); }
double upper() const { return parameter().max(); }
double normal() const { return parameter().normal(); }
double lower() const { return parameter().min(); }
double upper() const { return parameter().max(); }
double normal() const { return parameter().normal(); }
double
PluginInsert::PluginControl::internal_to_interface (double val) const
{
double
PluginInsert::PluginControl::internal_to_interface (double val) const
{
+ val = Controllable::internal_to_interface(val);
+
- /* some plugins have a log-scale range "0.."
- * ideally we'd map the range down to infinity somehow :)
- *
- * one solution could be to use
- * val = exp(lower + log(range) * value);
- * (log(val) - lower) / range)
- * This approach would require access to the actual range (ie
- * Plugin::ParameterDescriptor) and also require handling
- * of unbound ranges..
- *
- * currently an arbitrarly low number is assumed to represnt
- * log(0) as hot-fix solution.
- */
+ val = pow (val, 1/1.5);
- val = -8; // ~ -70dB = 20 * log10(exp(-8))
PluginInsert::PluginControl::interface_to_internal (double val) const
{
if (_logarithmic) {
PluginInsert::PluginControl::interface_to_internal (double val) const
{
if (_logarithmic) {
- if (val <= -8) {
- /* see note in PluginInsert::PluginControl::internal_to_interface() */
+ val = Controllable::interface_to_internal(val);
+