From ddd4e463360105758d6eafa2bfb2a7dab1837075 Mon Sep 17 00:00:00 2001 From: EvilDragon Date: Thu, 30 Sep 2021 16:43:20 +0200 Subject: [PATCH] A few M-S Tool naming tweaks (#5177) Rename M-S Tool params for consistency with other FX that use the same params. Also introduce ct_percent_bipolar_pan that says Center instead of Stereo for 0%. Use it on scene Pan and Combulator Pan params. --- .../M-S Decode (-6 dB).srgfx} | 2 +- .../M-S Decode.srgfx} | 2 +- .../M-S EQ.srgfx} | 2 +- .../M-S Encode.srgfx} | 2 +- .../Tight Bass.srgfx | 2 +- resources/surge-shared/configuration.xml | 10 +++---- src/common/Parameter.cpp | 22 ++++++++++++-- src/common/Parameter.h | 1 + src/common/SurgePatch.cpp | 2 +- src/common/SurgeStorage.h | 12 ++++---- src/common/dsp/effects/CombulatorEffect.cpp | 4 +-- src/common/dsp/effects/MSToolEffect.cpp | 30 +++++++++---------- src/common/dsp/effects/MSToolEffect.h | 2 +- 13 files changed, 55 insertions(+), 38 deletions(-) rename resources/data/fx_presets/{MS Tool/MS Decode(-6dB).srgfx => Mid-Side Tool/M-S Decode (-6 dB).srgfx} (90%) rename resources/data/fx_presets/{MS Tool/MS Decode.srgfx => Mid-Side Tool/M-S Decode.srgfx} (92%) rename resources/data/fx_presets/{MS Tool/MS EQ.srgfx => Mid-Side Tool/M-S EQ.srgfx} (89%) rename resources/data/fx_presets/{MS Tool/MS Encode.srgfx => Mid-Side Tool/M-S Encode.srgfx} (92%) rename resources/data/fx_presets/{MS Tool => Mid-Side Tool}/Tight Bass.srgfx (92%) diff --git a/resources/data/fx_presets/MS Tool/MS Decode(-6dB).srgfx b/resources/data/fx_presets/Mid-Side Tool/M-S Decode (-6 dB).srgfx similarity index 90% rename from resources/data/fx_presets/MS Tool/MS Decode(-6dB).srgfx rename to resources/data/fx_presets/Mid-Side Tool/M-S Decode (-6 dB).srgfx index 9497c879b14..7dc87f7f275 100644 --- a/resources/data/fx_presets/MS Tool/MS Decode(-6dB).srgfx +++ b/resources/data/fx_presets/Mid-Side Tool/M-S Decode (-6 dB).srgfx @@ -1,5 +1,5 @@ - - - - - - - - @@ -149,6 +144,11 @@ + + + diff --git a/src/common/Parameter.cpp b/src/common/Parameter.cpp index 1c6b6423e8b..83f629cf062 100644 --- a/src/common/Parameter.cpp +++ b/src/common/Parameter.cpp @@ -394,6 +394,7 @@ bool Parameter::is_bipolar() const case ct_freq_mod: case ct_percent_bipolar: case ct_percent_bipolar_stereo: + case ct_percent_bipolar_pan: case ct_percent_bipolar_w_dynamic_unipolar_formatting: case ct_twist_aux_mix: case ct_freq_shift: @@ -992,6 +993,7 @@ void Parameter::set_type(int ctrltype) case ct_modern_trimix: case ct_percent_bipolar: case ct_percent_bipolar_stereo: + case ct_percent_bipolar_pan: case ct_percent_bipolar_stringbal: case ct_percent_bipolar_w_dynamic_unipolar_formatting: case ct_twist_aux_mix: @@ -1313,6 +1315,18 @@ void Parameter::set_type(int ctrltype) snprintf(displayInfo.maxLabel, DISPLAYINFO_TXT_SIZE, "100.00 %% (Right)"); displayInfo.scale = 100; break; + case ct_percent_bipolar_pan: + displayType = LinearWithScale; + displayInfo.customFeatures = ParamDisplayFeatures::kHasCustomMinString | + ParamDisplayFeatures::kHasCustomMaxString | + ParamDisplayFeatures::kHasCustomDefaultString; + + snprintf(displayInfo.unit, DISPLAYINFO_TXT_SIZE, "%%"); + snprintf(displayInfo.minLabel, DISPLAYINFO_TXT_SIZE, "-100.00 %% (Left)"); + snprintf(displayInfo.defLabel, DISPLAYINFO_TXT_SIZE, "0.00 %% (Center)"); + snprintf(displayInfo.maxLabel, DISPLAYINFO_TXT_SIZE, "100.00 %% (Right)"); + displayInfo.scale = 100; + break; case ct_percent_bipolar_stringbal: displayType = LinearWithScale; displayInfo.customFeatures = ParamDisplayFeatures::kHasCustomMinString | @@ -1580,6 +1594,7 @@ void Parameter::bound_value(bool force_integer) case ct_percent200: case ct_percent_bipolar: case ct_percent_bipolar_stereo: + case ct_percent_bipolar_pan: case ct_percent_bipolar_stringbal: case ct_percent_bipolar_w_dynamic_unipolar_formatting: case ct_twist_aux_mix: @@ -3419,13 +3434,13 @@ void Parameter::get_display(char *txt, bool external, float ef) const switch (i) { case 0: - snprintf(txt, TXT_SIZE, "LR -> MS -> LR"); + snprintf(txt, TXT_SIZE, "L-R > M-S > L-R"); break; case 1: - snprintf(txt, TXT_SIZE, "LR -> MS"); + snprintf(txt, TXT_SIZE, "L-R > M-S"); break; case 2: - snprintf(txt, TXT_SIZE, "MS -> LR"); + snprintf(txt, TXT_SIZE, "M-S > L-R"); break; } break; @@ -3811,6 +3826,7 @@ bool Parameter::can_setvalue_from_string() const case ct_percent200: case ct_percent_bipolar: case ct_percent_bipolar_stereo: + case ct_percent_bipolar_pan: case ct_percent_bipolar_stringbal: case ct_percent_bipolar_w_dynamic_unipolar_formatting: case ct_twist_aux_mix: diff --git a/src/common/Parameter.h b/src/common/Parameter.h index f425fdcae6e..a5e9e8e10cc 100644 --- a/src/common/Parameter.h +++ b/src/common/Parameter.h @@ -182,6 +182,7 @@ enum ctrltypes ct_tape_speed, ct_lfophaseshuffle, ct_mscodec, + ct_percent_bipolar_pan, // bipolar with special text strings at -100% +100% and 0% num_ctrltypes, }; diff --git a/src/common/SurgePatch.cpp b/src/common/SurgePatch.cpp index b79bf729292..16d77ac963c 100644 --- a/src/common/SurgePatch.cpp +++ b/src/common/SurgePatch.cpp @@ -184,7 +184,7 @@ SurgePatch::SurgePatch(SurgeStorage *storage) a->push_back(scene[sc].volume.assign(p_id.next(), id_s++, "volume", "Volume", ct_amplitude_clipper, Surge::Skin::Scene::volume, sc_id, cg_GLOBAL, 0, true, sceasy)); - a->push_back(scene[sc].pan.assign(p_id.next(), id_s++, "pan", "Pan", ct_percent_bipolar, + a->push_back(scene[sc].pan.assign(p_id.next(), id_s++, "pan", "Pan", ct_percent_bipolar_pan, Surge::Skin::Scene::pan, sc_id, cg_GLOBAL, 0, true, sceasy)); a->push_back(scene[sc].width.assign(p_id.next(), id_s++, "pan2", "Width", diff --git a/src/common/SurgeStorage.h b/src/common/SurgeStorage.h index 2ffe058f332..588a01e1575 100644 --- a/src/common/SurgeStorage.h +++ b/src/common/SurgeStorage.h @@ -304,16 +304,16 @@ enum fx_type }; const char fx_type_names[n_fx_types][16] = { - "Off", "Delay", "Reverb 1", "Phaser", "Rotary", "Distortion", - "EQ", "Freq Shift", "Conditioner", "Chorus", "Vocoder", "Reverb 2", - "Flanger", "Ring Mod", "Airwindows", "Neuron", "Graphic EQ", "Resonator", - "CHOW", "Exciter", "Ensemble", "Combulator", "Nimbus", "Tape", - "Treemonster", "Waveshaper", "MS Tool"}; + "Off", "Delay", "Reverb 1", "Phaser", "Rotary", "Distortion", + "EQ", "Freq Shift", "Conditioner", "Chorus", "Vocoder", "Reverb 2", + "Flanger", "Ring Mod", "Airwindows", "Neuron", "Graphic EQ", "Resonator", + "CHOW", "Exciter", "Ensemble", "Combulator", "Nimbus", "Tape", + "Treemonster", "Waveshaper", "Mid-Side Tool"}; const char fx_type_shortnames[n_fx_types][8] = {"OFF", "DLY", "RV1", "PH", "ROT", "DIST", "EQ", "FRQ", "DYN", "CH", "VOC", "RV2", "FL", "RM", "AW", "NEU", "GEQ", "RES", "CHW", "XCT", "ENS", - "CMB", "NIM", "TAPE", "TM", "WS", "MS"}; + "CMB", "NIM", "TAPE", "TM", "WS", "M-S"}; enum fx_bypass { diff --git a/src/common/dsp/effects/CombulatorEffect.cpp b/src/common/dsp/effects/CombulatorEffect.cpp index 6d1c8a8f793..0e3f517a8ac 100644 --- a/src/common/dsp/effects/CombulatorEffect.cpp +++ b/src/common/dsp/effects/CombulatorEffect.cpp @@ -410,10 +410,10 @@ void CombulatorEffect::init_ctrltypes() fxdata->p[combulator_gain3].posy_offset = 5; fxdata->p[combulator_pan2].set_name("Pan 2"); - fxdata->p[combulator_pan2].set_type(ct_percent_bipolar_stereo); + fxdata->p[combulator_pan2].set_type(ct_percent_bipolar_pan); fxdata->p[combulator_pan2].posy_offset = 7; fxdata->p[combulator_pan3].set_name("Pan 3"); - fxdata->p[combulator_pan3].set_type(ct_percent_bipolar_stereo); + fxdata->p[combulator_pan3].set_type(ct_percent_bipolar_pan); fxdata->p[combulator_pan3].posy_offset = 7; fxdata->p[combulator_mix].set_name("Mix"); fxdata->p[combulator_mix].set_type(ct_percent); diff --git a/src/common/dsp/effects/MSToolEffect.cpp b/src/common/dsp/effects/MSToolEffect.cpp index bc65701b4a6..0c48749d361 100644 --- a/src/common/dsp/effects/MSToolEffect.cpp +++ b/src/common/dsp/effects/MSToolEffect.cpp @@ -150,11 +150,11 @@ const char *MSToolEffect::group_label(int id) switch (id) { case 0: - return "MS Options"; + return " Options"; case 1: - return "Filter M"; + return "Mid Filter"; case 2: - return "Filter S"; + return "Side Filter"; case 3: return "Output"; } @@ -220,32 +220,32 @@ void MSToolEffect::init_ctrltypes() fxdata->p[mstl_matrix].set_name("Matrix"); fxdata->p[mstl_matrix].set_type(ct_mscodec); - fxdata->p[mstl_hpm].set_name("HP M"); + fxdata->p[mstl_hpm].set_name("Low Cut"); fxdata->p[mstl_hpm].set_type(ct_freq_audible_deactivatable); - fxdata->p[mstl_pqm].set_name("Peak M"); + fxdata->p[mstl_pqm].set_name("Gain"); fxdata->p[mstl_pqm].set_type(ct_decibel_narrow_deactivatable); - fxdata->p[mstl_freqm].set_name("Freq M"); + fxdata->p[mstl_freqm].set_name("Frequency"); fxdata->p[mstl_freqm].set_type(ct_freq_audible); fxdata->p[mstl_freqm].dynamicDeactivation = &eqGroupDeact; - fxdata->p[mstl_lpm].set_name("LP M"); + fxdata->p[mstl_lpm].set_name("High Cut"); fxdata->p[mstl_lpm].set_type(ct_freq_audible_deactivatable); - fxdata->p[mstl_hps].set_name("HP S"); + fxdata->p[mstl_hps].set_name("Low Cut"); fxdata->p[mstl_hps].set_type(ct_freq_audible_deactivatable); - fxdata->p[mstl_pqs].set_name("Peak S"); + fxdata->p[mstl_pqs].set_name("Gain"); fxdata->p[mstl_pqs].set_type(ct_decibel_narrow_deactivatable); - fxdata->p[mstl_freqs].set_name("Freq S"); + fxdata->p[mstl_freqs].set_name("Frequency"); fxdata->p[mstl_freqs].set_type(ct_freq_audible); fxdata->p[mstl_freqs].dynamicDeactivation = &eqGroupDeact; - fxdata->p[mstl_lps].set_name("LP S"); + fxdata->p[mstl_lps].set_name("High Cut"); fxdata->p[mstl_lps].set_type(ct_freq_audible_deactivatable); - fxdata->p[mstl_mgain].set_name("Gain M"); + fxdata->p[mstl_mgain].set_name("Mid Gain"); fxdata->p[mstl_mgain].set_type(ct_decibel_attenuation_plus12); - fxdata->p[mstl_sgain].set_name("Gain S"); + fxdata->p[mstl_sgain].set_name("Side Gain"); fxdata->p[mstl_sgain].set_type(ct_decibel_attenuation_plus12); - fxdata->p[mstl_outgain].set_name("Balance L/R"); - fxdata->p[mstl_outgain].set_type(ct_percent_bipolar); + fxdata->p[mstl_outgain].set_name("Balance"); + fxdata->p[mstl_outgain].set_type(ct_percent_bipolar_stereo); fxdata->p[mstl_matrix].posy_offset = 1; diff --git a/src/common/dsp/effects/MSToolEffect.h b/src/common/dsp/effects/MSToolEffect.h index e41b08ce31c..b03c78fe9a7 100644 --- a/src/common/dsp/effects/MSToolEffect.h +++ b/src/common/dsp/effects/MSToolEffect.h @@ -27,7 +27,7 @@ class MSToolEffect : public Effect public: MSToolEffect(SurgeStorage *storage, FxStorage *fxdata, pdata *pd); virtual ~MSToolEffect(); - virtual const char *get_effectname() override { return "MS Tool"; } + virtual const char *get_effectname() override { return "Mid-Side Tool"; } virtual void init() override; virtual void process(float *dataL, float *dataR) override; virtual void suspend() override;