diff --git a/libs/ardour/parameter_descriptor.cc b/libs/ardour/parameter_descriptor.cc index d2622ee042..161cccf46a 100644 --- a/libs/ardour/parameter_descriptor.cc +++ b/libs/ardour/parameter_descriptor.cc @@ -78,7 +78,7 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter) logarithmic = true; break; case MainOutVolume: - upper = 100; // +40dB + upper = 15.85; // +24B lower = .01; // -40dB normal = 1.0f; logarithmic = true; diff --git a/libs/ardour/vst3_plugin.cc b/libs/ardour/vst3_plugin.cc index d1ab7846c6..1cf44541f9 100644 --- a/libs/ardour/vst3_plugin.cc +++ b/libs/ardour/vst3_plugin.cc @@ -2969,7 +2969,7 @@ VST3PI::getContextInfoValue (double& value, FIDString id) if (0 == strcmp (id, ContextInfo::kMaxVolume)) { value = s->gain_control ()->upper (); } else if (0 == strcmp (id, ContextInfo::kMaxSendLevel)) { - value = 2.0; // Config->get_max_gain(); + value = Config->get_max_gain(); #ifdef MIXBUS if (s->send_enable_controllable (0)) { assert (s->send_level_controllable (0)); diff --git a/libs/surfaces/launchkey_4/launchkey_4.cc b/libs/surfaces/launchkey_4/launchkey_4.cc index b03f52ad7b..99bbba362c 100644 --- a/libs/surfaces/launchkey_4/launchkey_4.cc +++ b/libs/surfaces/launchkey_4/launchkey_4.cc @@ -1549,7 +1549,7 @@ LaunchKey4::fader_move (int which, int val) } if (ac) { - gain_t gain = ARDOUR::slider_position_to_gain_with_max (val/127.0, ARDOUR::Config->get_max_gain()); + gain_t gain = ARDOUR::slider_position_to_gain_with_max (val/127.0, ac->upper()); session->set_control (ac, gain, PBD::Controllable::NoGroup); char buf[16]; @@ -1574,7 +1574,7 @@ LaunchKey4::automation_control_change (int n, std::weak_ptr w case VolumeFaders: case SendAFaders: case SendBFaders: - msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ARDOUR::Config->get_max_gain()) * 127.0); + msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ac->upper()) * 127.0); break; case PanFaders: msg[2] = (MIDI::byte) (ac->get_value() * 127.0); @@ -1779,9 +1779,9 @@ LaunchKey4::encoder_level (int which, int step) if (shift_pressed) { gain = gc->get_value(); } else { - double pos = ARDOUR::gain_to_slider_position_with_max (gc->get_value(), ARDOUR::Config->get_max_gain()); + double pos = ARDOUR::gain_to_slider_position_with_max (gc->get_value(), gc->upper()); pos += (step/127.0); - gain = ARDOUR::slider_position_to_gain_with_max (pos, ARDOUR::Config->get_max_gain()); + gain = ARDOUR::slider_position_to_gain_with_max (pos, gc->upper()); session->set_control (gc, gain, Controllable::NoGroup); } @@ -1827,9 +1827,9 @@ LaunchKey4::encoder_senda (int which, int step) /* Just display current value */ gain = gc->get_value(); } else { - double pos = ARDOUR::gain_to_slider_position_with_max (gc->get_value(), ARDOUR::Config->get_max_gain()); + double pos = ARDOUR::gain_to_slider_position_with_max (gc->get_value(), gc->upper()); pos += (step/127.0); - gain = ARDOUR::slider_position_to_gain_with_max (pos, ARDOUR::Config->get_max_gain()); + gain = ARDOUR::slider_position_to_gain_with_max (pos, gc->upper()); session->set_control (gc, gain, Controllable::NoGroup); } diff --git a/libs/surfaces/launchpad_pro/lppro.cc b/libs/surfaces/launchpad_pro/lppro.cc index e9ee1ca58d..e47c637895 100644 --- a/libs/surfaces/launchpad_pro/lppro.cc +++ b/libs/surfaces/launchpad_pro/lppro.cc @@ -1969,7 +1969,7 @@ LaunchPadPro::fader_move (int cc, int val) case VolumeFaders: ac = r->gain_control(); if (ac) { - session->set_control (ac, ARDOUR::slider_position_to_gain_with_max (val/127.0, ARDOUR::Config->get_max_gain()), PBD::Controllable::NoGroup); + session->set_control (ac, ARDOUR::slider_position_to_gain_with_max (val/127.0, ac->upper()), PBD::Controllable::NoGroup); } break; case PanFaders: @@ -1981,7 +1981,7 @@ LaunchPadPro::fader_move (int cc, int val) case SendFaders: ac = r->send_level_controllable (scroll_x_offset + (cc - first_fader)); if (ac) { - session->set_control (ac, ARDOUR::slider_position_to_gain_with_max (val/127.0, ARDOUR::Config->get_max_gain()), PBD::Controllable::NoGroup); + session->set_control (ac, ARDOUR::slider_position_to_gain_with_max (val/127.0, ac->upper()), PBD::Controllable::NoGroup); } break; default: @@ -2032,7 +2032,7 @@ LaunchPadPro::map_faders () case VolumeFaders: ac = r->gain_control(); if (ac) { - msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ARDOUR::Config->get_max_gain()) * 127.0); + msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ac->upper()) * 127.0); } else { msg[2] = 0; } @@ -2048,7 +2048,7 @@ LaunchPadPro::map_faders () case SendFaders: ac = r->send_level_controllable (n); if (ac) { - msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ARDOUR::Config->get_max_gain()) * 127.0); + msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ac->upper()) * 127.0); } else { msg[2] = 0; } @@ -2081,7 +2081,7 @@ LaunchPadPro::automation_control_change (int n, std::weak_ptr switch (current_fader_bank) { case VolumeFaders: case SendFaders: - msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ARDOUR::Config->get_max_gain()) * 127.0); + msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ac->upper()) * 127.0); break; case PanFaders: msg[2] = (MIDI::byte) (ac->get_value() * 127.0); diff --git a/libs/surfaces/launchpad_x/lpx.cc b/libs/surfaces/launchpad_x/lpx.cc index e21f9bf970..6d078b983c 100644 --- a/libs/surfaces/launchpad_x/lpx.cc +++ b/libs/surfaces/launchpad_x/lpx.cc @@ -1666,7 +1666,7 @@ LaunchPadX::fader_move (int cc, int val) case VolumeFaders: ac = r->gain_control(); if (ac) { - session->set_control (ac, ARDOUR::slider_position_to_gain_with_max (val/127.0, ARDOUR::Config->get_max_gain()), PBD::Controllable::NoGroup); + session->set_control (ac, ARDOUR::slider_position_to_gain_with_max (val/127.0, ac->upper()), PBD::Controllable::NoGroup); } break; case PanFaders: @@ -1678,7 +1678,7 @@ LaunchPadX::fader_move (int cc, int val) case SendAFaders: ac = r->send_level_controllable (scroll_x_offset + (cc - first_fader)); if (ac) { - session->set_control (ac, ARDOUR::slider_position_to_gain_with_max (val/127.0, ARDOUR::Config->get_max_gain()), PBD::Controllable::NoGroup); + session->set_control (ac, ARDOUR::slider_position_to_gain_with_max (val/127.0, ac->upper()), PBD::Controllable::NoGroup); } break; case SendBFaders: @@ -1731,7 +1731,7 @@ LaunchPadX::map_faders () case VolumeFaders: ac = r->gain_control(); if (ac) { - msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ARDOUR::Config->get_max_gain()) * 127.0); + msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ac->upper()) * 127.0); } else { msg[2] = 0; } @@ -1747,7 +1747,7 @@ LaunchPadX::map_faders () case SendAFaders: ac = r->send_level_controllable (0); if (ac) { - msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ARDOUR::Config->get_max_gain()) * 127.0); + msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ac->upper()) * 127.0); } else { msg[2] = 0; } @@ -1755,7 +1755,7 @@ LaunchPadX::map_faders () case SendBFaders: ac = r->send_level_controllable (1); if (ac) { - msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ARDOUR::Config->get_max_gain()) * 127.0); + msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ac->upper()) * 127.0); } else { msg[2] = 0; } @@ -1789,7 +1789,7 @@ LaunchPadX::automation_control_change (int n, std::weak_ptr w case VolumeFaders: case SendAFaders: case SendBFaders: - msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ARDOUR::Config->get_max_gain()) * 127.0); + msg[2] = (MIDI::byte) (ARDOUR::gain_to_slider_position_with_max (ac->get_value(), ac->upper()) * 127.0); break; case PanFaders: msg[2] = (MIDI::byte) (ac->get_value() * 127.0);