13
0

Change default stereo panner to equal power balance

The stereo-width panner is not generally useful. In order to
change the azimuth, width has to be reduced, which usually leads
to comb-filter artifacts.

Equal power stereo, also matches the default mono to stereo panner
better than the stereo-width panner.

Last but not least, control surfaces only have an azimuth control
knob, without an easy way to reduce width, this leaves
the panner insensitive.
This commit is contained in:
Robin Gareus 2020-03-15 21:39:53 +01:00
parent dbd4b9d07d
commit a7a781971e
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
6 changed files with 56 additions and 37 deletions

View File

@ -29,6 +29,7 @@
#include "pbd/error.h"
#include "pbd/compose.h"
#include "pbd/file_utils.h"
#include "pbd/stateful.h"
#include "pbd/stl_delete.h"
#include "ardour/debug.h"
@ -68,13 +69,13 @@ PannerManager::instance ()
static bool panner_filter (const string& str, void */*arg*/)
{
#ifdef COMPILER_MSVC
/**
* Different build targets (Debug / Release etc) use different versions
* of the 'C' runtime (which can't be 'mixed & matched'). Therefore, in
* case the supplied search path contains multiple version(s) of a given
* panner module, only select the one(s) which match the current build
* target (otherwise, all hell will break loose !!)
*/
/**
* Different build targets (Debug / Release etc) use different versions
* of the 'C' runtime (which can't be 'mixed & matched'). Therefore, in
* case the supplied search path contains multiple version(s) of a given
* panner module, only select the one(s) which match the current build
* target (otherwise, all hell will break loose !!)
*/
#if defined (_DEBUG)
return str.length() > 12 && (str.find ("panner_") == 0) && (str.find ("D.dll") == (str.length() - 5));
#elif defined (RDC_BUILD)
@ -170,27 +171,34 @@ PannerInfo*
PannerManager::select_panner (ChanCount in, ChanCount out, std::string const uri)
{
PannerInfo* rv = NULL;
PanPluginDescriptor* d;
int32_t nin = in.n_audio();
int32_t nout = out.n_audio();
uint32_t priority = 0;
/* look for user-preference -- check if channels match */
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
d = &(*p)->descriptor;
if (d->panner_uri != uri) continue;
if (d->in != nin && d->in != -1) continue;
if (d->out != nout && d->out != -1) continue;
PanPluginDescriptor const& d ((*p)->descriptor);
if (d.panner_uri != uri) continue;
if (d.in != nin && d.in != -1) continue;
if (d.out != nout && d.out != -1) continue;
return *p;
}
/* look for exact match first */
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
d = &(*p)->descriptor;
PanPluginDescriptor const& d ((*p)->descriptor);
if (d->in == nin && d->out == nout && d->priority > priority) {
priority = d->priority;
/* backward compat */
if (Stateful::loading_state_version < 6000 && d.panner_uri == "http://ardour.org/plugin/panner_2in2out") {
if (d.in == nin && d.out == nout) {
priority = 9999;
rv = *p;
}
}
if (d.in == nin && d.out == nout && d.priority > priority) {
priority = d.priority;
rv = *p;
}
}
@ -198,38 +206,45 @@ PannerManager::select_panner (ChanCount in, ChanCount out, std::string const uri
/* no exact match, look for good fit on inputs and variable on outputs */
#if 0
priority = 0;
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
d = &(*p)->descriptor;
/* unused, so far Ardour only features 4 panners:
* in = 1 ; out = 2 // Mono to Stereo
* in = 2 ; out = 2 // Equal Power Stereo
* in = 2 ; out = 2 // Stereo Balance
* in = -1 ; out = -1 // VBAP
*/
if (d->in == nin && d->out == -1 && d->priority > priority) {
priority = d->priority;
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
PanPluginDescriptor const& d ((*p)->descriptor);
if (d.in == nin && d.out == -1 && d.priority > priority) {
priority = d.priority;
rv = *p;
}
}
if (rv) { return rv; }
/* no exact match, look for good fit on outputs and variable on inputs */
priority = 0;
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
d = &(*p)->descriptor;
PanPluginDescriptor const& d ((*p)->descriptor);
if (d->in == -1 && d->out == nout && d->priority > priority) {
priority = d->priority;
if (d.in == -1 && d.out == nout && d.priority > priority) {
priority = d.priority;
rv = *p;
}
}
if (rv) { return rv; }
#endif
/* no exact match, look for variable fit on inputs and outputs */
priority = 0;
for (list<PannerInfo*>::iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
d = &(*p)->descriptor;
PanPluginDescriptor const& d ((*p)->descriptor);
if (d->in == -1 && d->out == -1 && d->priority > priority) {
priority = d->priority;
if (d.in == -1 && d.out == -1 && d.priority > priority) {
priority = d.priority;
rv = *p;
}
}
@ -265,11 +280,11 @@ PannerManager::get_available_panners(uint32_t const a_in, uint32_t const a_out)
/* get available panners for current configuration. */
for (list<PannerInfo*>::const_iterator p = panner_info.begin(); p != panner_info.end(); ++p) {
PanPluginDescriptor* d = &(*p)->descriptor;
if (d->in != -1 && d->in != in) continue;
if (d->out != -1 && d->out != out) continue;
if (d->in == -1 && d->out == -1 && out <= 2) continue;
panner_list.insert(std::pair<std::string,std::string>(d->panner_uri,d->name));
PanPluginDescriptor const& d ((*p)->descriptor);
if (d.in != -1 && d.in != in) continue;
if (d.out != -1 && d.out != out) continue;
if (d.in == -1 && d.out == -1 && out <= 2) continue;
panner_list.insert(std::pair<std::string,std::string>(d.panner_uri,d.name));
}
return panner_list;
}

View File

@ -37,10 +37,11 @@
#include "pbd/cartesian.h"
#include "pbd/convert.h"
#include "pbd/enumwriter.h"
#include "pbd/error.h"
#include "pbd/failed_constructor.h"
#include "pbd/stateful.h"
#include "pbd/xml++.h"
#include "pbd/enumwriter.h"
#include "evoral/Curve.h"
@ -126,6 +127,9 @@ PannerShell::configure_io (ChanCount in, ChanCount out)
fatal << _("No panner found: check that panners are being discovered correctly during startup.") << endmsg;
abort(); /*NOTREACHED*/
}
if (Stateful::loading_state_version < 6000 && pi->descriptor.in == 2) {
_user_selected_panner_uri = pi->descriptor.panner_uri;
}
DEBUG_TRACE (DEBUG::Panning, string_compose (_("select panner: %1\n"), pi->descriptor.name.c_str()));

View File

@ -67,7 +67,7 @@ static PanPluginDescriptor _descriptor = {
"http://ardour.org/plugin/panner_1in2out",
"http://ardour.org/plugin/panner_1in2out#ui",
1, 2,
10000,
20,
Panner1in2out::factory
};

View File

@ -65,7 +65,7 @@ static PanPluginDescriptor _descriptor = {
"http://ardour.org/plugin/panner_2in2out",
"http://ardour.org/plugin/panner_2in2out#ui",
2, 2,
10000,
20,
Panner2in2out::factory
};

View File

@ -64,7 +64,7 @@ static PanPluginDescriptor _descriptor = {
"http://ardour.org/plugin/panner_balance",
"http://ardour.org/plugin/panner_balance#ui",
2, 2,
2000,
25,
Pannerbalance::factory
};

View File

@ -55,7 +55,7 @@ static PanPluginDescriptor _descriptor = {
"http://ardour.org/plugin/panner_vbap",
"http://ardour.org/plugin/panner_vbap#ui",
-1, -1,
1000,
10,
VBAPanner::factory
};