Vapor: set surround-send level range to +/-20 dB

This commit is contained in:
Robin Gareus 2024-03-21 14:23:43 +01:00
parent 25397d7812
commit 73fea85381
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
13 changed files with 30 additions and 4 deletions

View File

@ -173,6 +173,7 @@ enum AutomationType {
MonitoringAutomation, MonitoringAutomation,
BusSendLevel, BusSendLevel,
BusSendEnable, BusSendEnable,
SurroundSendLevel,
InsertReturnLevel, InsertReturnLevel,
MainOutVolume, MainOutVolume,
MidiVelocityAutomation, MidiVelocityAutomation,

View File

@ -53,7 +53,7 @@ value_as_string(const ARDOUR::ParameterDescriptor& desc,
// Value is not a scale point, print it normally // Value is not a scale point, print it normally
if (desc.unit == ARDOUR::ParameterDescriptor::MIDI_NOTE) { if (desc.unit == ARDOUR::ParameterDescriptor::MIDI_NOTE) {
snprintf(buf, sizeof(buf), "%s", ParameterDescriptor::midi_note_name (rint(v)).c_str()); snprintf(buf, sizeof(buf), "%s", ParameterDescriptor::midi_note_name (rint(v)).c_str());
} else if (desc.type == GainAutomation || desc.type == BusSendLevel || desc.type == TrimAutomation || desc.type == EnvelopeAutomation || desc.type == MainOutVolume || desc.type == InsertReturnLevel) { } else if (desc.type == GainAutomation || desc.type == BusSendLevel || desc.type == TrimAutomation || desc.type == EnvelopeAutomation || desc.type == MainOutVolume || desc.type == SurroundSendLevel || desc.type == InsertReturnLevel) {
#ifdef PLATFORM_WINDOWS #ifdef PLATFORM_WINDOWS
if (v < GAIN_COEFF_SMALL) { if (v < GAIN_COEFF_SMALL) {
snprintf(buf, sizeof(buf), "-inf dB"); snprintf(buf, sizeof(buf), "-inf dB");

View File

@ -196,6 +196,8 @@ Automatable::describe_parameter (Evoral::Parameter param)
return _("Fader"); return _("Fader");
} else if (param.type() == BusSendLevel) { } else if (param.type() == BusSendLevel) {
return _("Send"); return _("Send");
} else if (param.type() == SurroundSendLevel) {
return _("Send");
} else if (param.type() == InsertReturnLevel) { } else if (param.type() == InsertReturnLevel) {
return _("Return"); return _("Return");
} else if (param.type() == TrimAutomation) { } else if (param.type() == TrimAutomation) {
@ -596,6 +598,8 @@ Automatable::control_factory(const Evoral::Parameter& param)
control = new GainControl(_a_session, param); control = new GainControl(_a_session, param);
} else if (param.type() == BusSendLevel) { } else if (param.type() == BusSendLevel) {
control = new GainControl(_a_session, param); control = new GainControl(_a_session, param);
} else if (param.type() == SurroundSendLevel) {
control = new GainControl(_a_session, param);
} else if (param.type() == PanSurroundX || param.type() == PanSurroundY || param.type() == PanSurroundZ || param.type() == PanSurroundSize || param.type() == PanSurroundSnap || param.type() == BinauralRenderMode) { } else if (param.type() == PanSurroundX || param.type() == PanSurroundY || param.type() == PanSurroundZ || param.type() == PanSurroundSize || param.type() == PanSurroundSnap || param.type() == BinauralRenderMode) {
assert (0); assert (0);
control = new SurroundControllable (_a_session, param.type(), *this); control = new SurroundControllable (_a_session, param.type(), *this);

View File

@ -158,6 +158,7 @@ AutomationList::create_curve_if_necessary()
switch (_parameter.type()) { switch (_parameter.type()) {
case GainAutomation: case GainAutomation:
case BusSendLevel: case BusSendLevel:
case SurroundSendLevel:
case InsertReturnLevel: case InsertReturnLevel:
case TrimAutomation: case TrimAutomation:
case PanAzimuthAutomation: case PanAzimuthAutomation:
@ -234,6 +235,7 @@ AutomationList::default_interpolation () const
switch (_parameter.type()) { switch (_parameter.type()) {
case GainAutomation: case GainAutomation:
case BusSendLevel: case BusSendLevel:
case SurroundSendLevel:
case InsertReturnLevel: case InsertReturnLevel:
case EnvelopeAutomation: case EnvelopeAutomation:
return ControlList::Exponential; return ControlList::Exponential;

View File

@ -207,6 +207,7 @@ setup_enum_writer ()
REGISTER_ENUM (MonitoringAutomation); REGISTER_ENUM (MonitoringAutomation);
REGISTER_ENUM (BusSendLevel); REGISTER_ENUM (BusSendLevel);
REGISTER_ENUM (BusSendEnable); REGISTER_ENUM (BusSendEnable);
REGISTER_ENUM (SurroundSendLevel);
REGISTER_ENUM (InsertReturnLevel); REGISTER_ENUM (InsertReturnLevel);
REGISTER_ENUM (MainOutVolume); REGISTER_ENUM (MainOutVolume);
REGISTER_ENUM (MidiVelocityAutomation); REGISTER_ENUM (MidiVelocityAutomation);

View File

@ -132,6 +132,8 @@ EventTypeMap::from_symbol(const string& str) const
p_type = GainAutomation; p_type = GainAutomation;
} else if (str == "send") { } else if (str == "send") {
p_type = BusSendLevel; p_type = BusSendLevel;
} else if (str == "surround-send") {
p_type = SurroundSendLevel;
} else if (str == "send-enable") { } else if (str == "send-enable") {
p_type = BusSendEnable; p_type = BusSendEnable;
} else if (str == "return") { } else if (str == "return") {
@ -260,6 +262,8 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const
return "send"; return "send";
} else if (t == BusSendEnable) { } else if (t == BusSendEnable) {
return "send-enable"; return "send-enable";
} else if (t == SurroundSendLevel) {
return "surround-send";
} else if (t == InsertReturnLevel) { } else if (t == InsertReturnLevel) {
return "return"; return "return";
} else if (t == TrimAutomation) { } else if (t == TrimAutomation) {

View File

@ -42,6 +42,8 @@ static std::string gain_control_name (Evoral::Parameter const& param)
/* fallthrough */ /* fallthrough */
case BusSendLevel: case BusSendLevel:
/* fallthrough */ /* fallthrough */
case SurroundSendLevel:
/* fallthrough */
case InsertReturnLevel: case InsertReturnLevel:
return X_("gaincontrol"); return X_("gaincontrol");
case TrimAutomation: case TrimAutomation:
@ -64,6 +66,8 @@ static std::shared_ptr<AutomationList> automation_list_new (Evoral::Parameter co
/* fallthrough */ /* fallthrough */
case BusSendLevel: case BusSendLevel:
/* fallthrough */ /* fallthrough */
case SurroundSendLevel:
/* fallthrough */
case InsertReturnLevel: case InsertReturnLevel:
/* fallthrough */ /* fallthrough */
case TrimAutomation: case TrimAutomation:

View File

@ -2394,6 +2394,7 @@ LuaBindings::common (lua_State* L)
.beginNamespace ("AutomationType") .beginNamespace ("AutomationType")
.addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation)) .addConst ("GainAutomation", ARDOUR::AutomationType(GainAutomation))
.addConst ("BusSendLevel", ARDOUR::AutomationType(BusSendLevel)) .addConst ("BusSendLevel", ARDOUR::AutomationType(BusSendLevel))
.addConst ("SurroundSendLevel", ARDOUR::AutomationType(SurroundSendLevel))
.addConst ("InsertReturnLevel", ARDOUR::AutomationType(InsertReturnLevel)) .addConst ("InsertReturnLevel", ARDOUR::AutomationType(InsertReturnLevel))
.addConst ("PluginAutomation", ARDOUR::AutomationType(PluginAutomation)) .addConst ("PluginAutomation", ARDOUR::AutomationType(PluginAutomation))
.addConst ("SoloAutomation", ARDOUR::AutomationType(SoloAutomation)) .addConst ("SoloAutomation", ARDOUR::AutomationType(SoloAutomation))

View File

@ -69,6 +69,8 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter)
normal = 1.f; normal = 1.f;
toggled = true; toggled = true;
break; break;
case SurroundSendLevel:
/* fallthrough */
case TrimAutomation: case TrimAutomation:
upper = 10; // +20dB upper = 10; // +20dB
lower = .1; // -20dB lower = .1; // -20dB
@ -284,7 +286,7 @@ ParameterDescriptor::update_steps()
if (unit == ParameterDescriptor::MIDI_NOTE) { if (unit == ParameterDescriptor::MIDI_NOTE) {
step = smallstep = 1; // semitone step = smallstep = 1; // semitone
largestep = 12; // octave largestep = 12; // octave
} else if (type == GainAutomation || type == TrimAutomation || type == BusSendLevel || type == MainOutVolume || type == InsertReturnLevel) { } else if (type == GainAutomation || type == TrimAutomation || type == BusSendLevel || type == MainOutVolume || type == SurroundSendLevel || type == InsertReturnLevel) {
/* dB_coeff_step gives a step normalized for [0, max_gain]. This is /* dB_coeff_step gives a step normalized for [0, max_gain]. This is
like "slider position", so we convert from "slider position" to gain like "slider position", so we convert from "slider position" to gain
to have the correct unit here. */ to have the correct unit here. */
@ -408,6 +410,8 @@ ParameterDescriptor::to_interface (float val, bool rotary) const
case EnvelopeAutomation: case EnvelopeAutomation:
val = gain_to_slider_position_with_max (val, upper); val = gain_to_slider_position_with_max (val, upper);
break; break;
case SurroundSendLevel:
/* fallthrough */
case TrimAutomation: case TrimAutomation:
/* fallthrough */ /* fallthrough */
case MainOutVolume: case MainOutVolume:
@ -469,6 +473,7 @@ ParameterDescriptor::from_interface (float val, bool rotary) const
case InsertReturnLevel: case InsertReturnLevel:
val = slider_position_to_gain_with_max (val, upper); val = slider_position_to_gain_with_max (val, upper);
break; break;
case SurroundSendLevel:
case TrimAutomation: case TrimAutomation:
{ {
const float lower_db = accurate_coefficient_to_dB (lower); const float lower_db = accurate_coefficient_to_dB (lower);
@ -529,6 +534,7 @@ ParameterDescriptor::is_linear () const
case GainAutomation: case GainAutomation:
case EnvelopeAutomation: case EnvelopeAutomation:
case BusSendLevel: case BusSendLevel:
case SurroundSendLevel:
case InsertReturnLevel: case InsertReturnLevel:
return false; return false;
default: default:

View File

@ -46,8 +46,8 @@ SurroundSend::SurroundSend (Session& s, std::shared_ptr<MuteMaster> mm)
_send_delay.reset (new DelayLine (_session, "Send-" + name ())); _send_delay.reset (new DelayLine (_session, "Send-" + name ()));
_thru_delay.reset (new DelayLine (_session, "Thru-" + name ())); _thru_delay.reset (new DelayLine (_session, "Thru-" + name ()));
std::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (BusSendLevel), *this)); std::shared_ptr<AutomationList> gl (new AutomationList (Evoral::Parameter (SurroundSendLevel), *this));
_gain_control = std::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter (BusSendLevel), gl)); _gain_control = std::shared_ptr<GainControl> (new GainControl (_session, Evoral::Parameter (SurroundSendLevel), gl));
_amp.reset (new Amp (_session, _("Surround"), _gain_control, false)); _amp.reset (new Amp (_session, _("Surround"), _gain_control, false));
_amp->activate (); _amp->activate ();

View File

@ -715,6 +715,7 @@ Strip::format_parameter_for_display(
case GainAutomation: case GainAutomation:
case BusSendLevel: case BusSendLevel:
case TrimAutomation: case TrimAutomation:
case SurroundSendLevel:
case InsertReturnLevel: case InsertReturnLevel:
// we can't use value_as_string() that'll suffix "dB" and also use "-inf" w/o space :( // we can't use value_as_string() that'll suffix "dB" and also use "-inf" w/o space :(
if (val == 0.0) { if (val == 0.0) {

View File

@ -223,6 +223,7 @@ Maschine2Knob::controllable_changed ()
case ARDOUR::GainAutomation: case ARDOUR::GainAutomation:
case ARDOUR::BusSendLevel: case ARDOUR::BusSendLevel:
case ARDOUR::SurroundSendLevel:
case ARDOUR::InsertReturnLevel: case ARDOUR::InsertReturnLevel:
case ARDOUR::TrimAutomation: case ARDOUR::TrimAutomation:
snprintf (buf, sizeof (buf), "%+4.1f dB", accurate_coefficient_to_dB (_controllable->get_value())); snprintf (buf, sizeof (buf), "%+4.1f dB", accurate_coefficient_to_dB (_controllable->get_value()));

View File

@ -326,6 +326,7 @@ Push2Knob::controllable_changed ()
case ARDOUR::GainAutomation: case ARDOUR::GainAutomation:
case ARDOUR::BusSendLevel: case ARDOUR::BusSendLevel:
case ARDOUR::SurroundSendLevel:
case ARDOUR::InsertReturnLevel: case ARDOUR::InsertReturnLevel:
case ARDOUR::TrimAutomation: case ARDOUR::TrimAutomation:
set_gain_text (_val); set_gain_text (_val);