add a new AutomationType enum, LargeGainAutomation that provides +24dB of gain

This commit is contained in:
Paul Davis 2025-05-05 20:54:08 -06:00
parent 02764ae317
commit ba49f074b3
19 changed files with 42 additions and 8 deletions

View file

@ -335,6 +335,7 @@ Amp::state () const
XMLNode& node (Processor::state ());
switch (_gain_control->parameter().type()) {
case GainAutomation:
case LargeGainAutomation:
node.set_property("type", "amp");
break;
case TrimAutomation:

View file

@ -45,5 +45,3 @@ static inline double dB_coeff_step(double max_coeff) {
return 0.1 * (max_coeff / max_db);
}
extern double zero_db_as_fraction;

View file

@ -145,6 +145,7 @@ enum InsertMergePolicy {
*/
enum AutomationType {
NullAutomation,
LargeGainAutomation,
GainAutomation,
PanAzimuthAutomation,
PanElevationAutomation,

View file

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

View file

@ -194,6 +194,8 @@ Automatable::describe_parameter (Evoral::Parameter param)
if (param == Evoral::Parameter(GainAutomation)) {
return _("Fader");
} else if (param == Evoral::Parameter(LargeGainAutomation)) {
return _("Fader");
} else if (param.type() == BusSendLevel) {
return _("Send");
} else if (param.type() == SurroundSendLevel) {
@ -588,7 +590,7 @@ Automatable::control_factory(const Evoral::Parameter& param)
} else {
warning << "PluginPropertyAutomation for non-Plugin" << endl;
}
} else if (param.type() == GainAutomation) {
} else if (param.type() == GainAutomation || param.type() == GainAutomation) {
control = new GainControl(_a_session, param);
} else if (param.type() == TrimAutomation) {
control = new GainControl(_a_session, param);

View file

@ -157,6 +157,7 @@ AutomationList::create_curve_if_necessary()
{
switch (_parameter.type()) {
case GainAutomation:
case LargeGainAutomation:
case BusSendLevel:
case SurroundSendLevel:
case InsertReturnLevel:
@ -234,6 +235,7 @@ AutomationList::default_interpolation () const
{
switch (_parameter.type()) {
case GainAutomation:
case LargeGainAutomation:
case BusSendLevel:
case SurroundSendLevel:
case InsertReturnLevel:

View file

@ -227,6 +227,7 @@ ControlGroup::fill_from_stripable_list (StripableList& sl, Evoral::Parameter con
switch (p.type()) {
case GainAutomation:
case LargeGainAutomation:
for (auto & s : sl) {
std::shared_ptr<AutomationControl> ac = s->gain_control ();
if (ac) {

View file

@ -184,6 +184,7 @@ setup_enum_writer ()
REGISTER_ENUM (NullAutomation);
REGISTER_ENUM (GainAutomation);
REGISTER_ENUM (LargeGainAutomation);
REGISTER_ENUM (PanAzimuthAutomation);
REGISTER_ENUM (PanElevationAutomation);
REGISTER_ENUM (PanWidthAutomation);

View file

@ -130,6 +130,8 @@ EventTypeMap::from_symbol(const string& str) const
if (str == "gain") {
p_type = GainAutomation;
} else if (str == "large-gain") {
p_type = LargeGainAutomation;
} else if (str == "send") {
p_type = BusSendLevel;
} else if (str == "surround-send") {
@ -258,6 +260,8 @@ EventTypeMap::to_symbol(const Evoral::Parameter& param) const
if (t == GainAutomation) {
return "gain";
} else if (t == LargeGainAutomation) {
return "large-gain";
} else if (t == BusSendLevel) {
return "send";
} else if (t == BusSendEnable) {

View file

@ -38,6 +38,8 @@ using namespace std;
static std::string gain_control_name (Evoral::Parameter const& param)
{
switch (param.type()) {
case LargeGainAutomation:
/* fallthrough */
case GainAutomation:
/* fallthrough */
case BusSendLevel:
@ -62,6 +64,8 @@ static std::string gain_control_name (Evoral::Parameter const& param)
static std::shared_ptr<AutomationList> automation_list_new (Evoral::Parameter const& param)
{
switch (param.type()) {
case LargeGainAutomation:
/* fallthrough */
case GainAutomation:
/* fallthrough */
case BusSendLevel:

View file

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

View file

@ -64,6 +64,10 @@ ParameterDescriptor::ParameterDescriptor(const Evoral::Parameter& parameter)
upper = Config->get_max_gain();
normal = 1.0f;
break;
case LargeGainAutomation:
upper = 15.85; /* +24dB */
normal = 1.0f;
break;
case BusSendEnable:
upper = 1.f;
normal = 1.f;
@ -286,11 +290,11 @@ ParameterDescriptor::update_steps()
if (unit == ParameterDescriptor::MIDI_NOTE) {
step = smallstep = 1; // semitone
largestep = 12; // octave
} else if (type == GainAutomation || type == TrimAutomation || type == BusSendLevel || type == MainOutVolume || type == SurroundSendLevel || type == InsertReturnLevel) {
} else if (type == LargeGainAutomation || 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
like "slider position", so we convert from "slider position" to gain
to have the correct unit here. */
largestep = position_to_gain (dB_coeff_step(upper));
largestep = position_to_gain (dB_coeff_step (upper));
step = position_to_gain (largestep / 10.0);
smallstep = step;
} else if (logarithmic) {
@ -401,6 +405,8 @@ ParameterDescriptor::to_interface (float val, bool rotary) const
{
val = std::min (upper, std::max (lower, val));
switch(type) {
case LargeGainAutomation:
/* fallthrough */
case GainAutomation:
/* fallthrough */
case BusSendLevel:
@ -468,6 +474,7 @@ ParameterDescriptor::from_interface (float val, bool rotary) const
switch(type) {
case GainAutomation:
case LargeGainAutomation:
case EnvelopeAutomation:
case BusSendLevel:
case InsertReturnLevel:
@ -532,6 +539,7 @@ ParameterDescriptor::is_linear () const
}
switch(type) {
case GainAutomation:
case LargeGainAutomation:
case EnvelopeAutomation:
case BusSendLevel:
case SurroundSendLevel:

View file

@ -3074,7 +3074,8 @@ Route::set_state_2X (const XMLNode& node, int version)
_main_outs->panner_shell()->set_state(*io_child, version);
} else if (io_child->name() == X_("Automation")) {
/* IO's automation is for the fader */
_amp->set_automation_xml_state (*io_child, Evoral::Parameter (GainAutomation));
AutomationType at = is_master() ? LargeGainAutomation : GainAutomation;
_amp->set_automation_xml_state (*io_child, Evoral::Parameter (at));
}
}
}

View file

@ -369,7 +369,7 @@ Send::set_state (const XMLNode& node, int version)
continue;
}
Evoral::Parameter param = EventTypeMap::instance().from_symbol (id_prop->value());
if (param.type() != GainAutomation) {
if (param.type() != GainAutomation && param.type() != LargeGainAutomation) {
continue;
}
XMLNode xn (**i);

View file

@ -2103,6 +2103,7 @@ MackieControlProtocol::down_controls (AutomationType p, uint32_t pressed)
pull_stripable_range (m->second, stripables, pressed);
switch (p) {
case LargeGainAutomation:
case GainAutomation:
for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) {
controls.push_back ((*s)->gain_control());

View file

@ -713,6 +713,7 @@ Strip::format_parameter_for_display(
switch (desc.type) {
case GainAutomation:
case LargeGainAutomation:
case BusSendLevel:
case TrimAutomation:
case SurroundSendLevel:

View file

@ -222,6 +222,7 @@ Maschine2Knob::controllable_changed ()
break;
case ARDOUR::GainAutomation:
case ARDOUR::LargeGainAutomation:
case ARDOUR::BusSendLevel:
case ARDOUR::SurroundSendLevel:
case ARDOUR::InsertReturnLevel:

View file

@ -1639,6 +1639,7 @@ US2400Protocol::down_controls (AutomationType p, uint32_t pressed)
switch (p) {
case GainAutomation:
case LargeGainAutomation:
for (StripableList::iterator s = stripables.begin(); s != stripables.end(); ++s) {
controls.push_back ((*s)->gain_control());
}

View file

@ -22,6 +22,8 @@
#include <iostream>
#include <assert.h>
#include "ardour/utils.h"
#include "gtkmm2ext/cairo_widget.h"
#include "gtkmm2ext/colors.h"
#include "gtkmm2ext/keyboard.h"
@ -59,6 +61,8 @@ ArdourFader::ArdourFader (Gtk::Adjustment& adj, int orientation, int fader_lengt
, have_explicit_fg (false)
, outline_color (0)
{
adj.signal_changed().connect (sigc::mem_fun (*this, &ArdourFader::update_unity_position));
update_unity_position ();
add_events (Gdk::TOUCH_UPDATE_MASK);