From fef0637d002962b2de936fe1b6d1703519483218 Mon Sep 17 00:00:00 2001 From: Mario Kruselj Date: Tue, 18 Apr 2023 00:01:40 +0200 Subject: [PATCH] Make FM3's M3 Freq extendable down to 0.5 Hz Addresses #6753 --- src/common/Parameter.cpp | 17 +++++++++++++++++ src/common/Parameter.h | 1 + src/common/SurgeStorage.h | 3 ++- src/common/dsp/oscillators/FM3Oscillator.cpp | 7 ++++++- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/common/Parameter.cpp b/src/common/Parameter.cpp index 488abe19c11..177d14f3f2a 100644 --- a/src/common/Parameter.cpp +++ b/src/common/Parameter.cpp @@ -264,6 +264,7 @@ bool Parameter::can_extend_range() const case ct_lfophaseshuffle: case ct_fmratio: case ct_reson_res_extendable: + case ct_freq_audible_fm3_extendable: case ct_freq_audible_with_tunability: case ct_freq_audible_very_low_minval: case ct_percent_oscdrift: @@ -589,6 +590,7 @@ void Parameter::set_type(int ctrltype) break; case ct_freq_audible: case ct_freq_audible_deactivatable: + case ct_freq_audible_fm3_extendable: case ct_freq_audible_with_tunability: valtype = vt_float; val_min.f = -60; // 13.75 Hz @@ -1387,6 +1389,7 @@ void Parameter::set_type(int ctrltype) case ct_freq_audible_deactivatable: case ct_freq_audible_deactivatable_hp: case ct_freq_audible_deactivatable_lp: + case ct_freq_audible_fm3_extendable: case ct_freq_audible_with_tunability: case ct_freq_audible_very_low_minval: case ct_freq_reson_band1: @@ -2029,6 +2032,11 @@ void Parameter::set_extend_range(bool er) displayInfo.customFeatures |= kAllowsTuningFractionTypein; } break; + case ct_freq_audible_fm3_extendable: + { + val_min.f = -60; // 13.75 Hz + } + break; case ct_freq_reson_band1: { // Why the heck are we modifying this here? @@ -2083,6 +2091,11 @@ void Parameter::set_extend_range(bool er) displayInfo.customFeatures = ParamDisplayFeatures::kAllowsModulationsInNotesAndCents; } break; + case ct_freq_audible_fm3_extendable: + { + val_min.f = -117.3763; // 0.5 Hz + } + break; case ct_freq_reson_band1: case ct_freq_reson_band2: case ct_freq_reson_band3: @@ -2090,6 +2103,7 @@ void Parameter::set_extend_range(bool er) val_min.f = -34.4936f; // 60 Hz val_max.f = 49.09578; // 7500 Hz } + break; case ct_dly_fb_clippingmodes: case ct_lfophaseshuffle: { @@ -2942,6 +2956,7 @@ float Parameter::quantize_modulation(float inputval) const case ct_freq_audible_deactivatable: case ct_freq_audible_deactivatable_hp: case ct_freq_audible_deactivatable_lp: + case ct_freq_audible_fm3_extendable: case ct_freq_audible_with_tunability: case ct_freq_audible_very_low_minval: case ct_freq_reson_band1: @@ -3045,6 +3060,7 @@ void Parameter::get_display_alt(char *txt, bool external, float ef) const case ct_freq_audible_deactivatable: case ct_freq_audible_deactivatable_hp: case ct_freq_audible_deactivatable_lp: + case ct_freq_audible_fm3_extendable: case ct_freq_audible_with_tunability: case ct_freq_audible_very_low_minval: case ct_freq_reson_band1: @@ -4103,6 +4119,7 @@ bool Parameter::can_setvalue_from_string() const case ct_freq_audible_deactivatable: case ct_freq_audible_deactivatable_hp: case ct_freq_audible_deactivatable_lp: + case ct_freq_audible_fm3_extendable: case ct_freq_audible_with_tunability: case ct_freq_audible_very_low_minval: case ct_freq_reson_band1: diff --git a/src/common/Parameter.h b/src/common/Parameter.h index 2d5050f88c5..48e800eec32 100644 --- a/src/common/Parameter.h +++ b/src/common/Parameter.h @@ -81,6 +81,7 @@ enum ctrltypes ct_freq_audible_deactivatable_lp, ct_freq_audible_with_tunability, // we abuse 'extended' to mean 'use SCL tuning' ct_freq_audible_very_low_minval, + ct_freq_audible_fm3_extendable, ct_freq_mod, ct_freq_hpf, ct_freq_shift, diff --git a/src/common/SurgeStorage.h b/src/common/SurgeStorage.h index 0394dd90688..86a646c2319 100644 --- a/src/common/SurgeStorage.h +++ b/src/common/SurgeStorage.h @@ -105,7 +105,8 @@ const int FIRoffsetI16 = FIRipolI16_N >> 1; // added Extend to Delay Feedback parameter (allows negative delay) // 19 -> 20 (XT 1.1 release) added voice envelope mode, but super late so don't break 19 // 20 -> 21 (XT 1.2 nightlies) added absolutable mode for Combulator Offset 1/2 (to match the behavior of Center parameter) -// oddsound_as_mts_main +// added oddsound_as_mts_main +// 21 -> 22 (XT 1.3 nighlies) added new ring modulator modes in the mixer // clang-format on const int ff_revision = 22; diff --git a/src/common/dsp/oscillators/FM3Oscillator.cpp b/src/common/dsp/oscillators/FM3Oscillator.cpp index bed113c36ff..99cacbba172 100644 --- a/src/common/dsp/oscillators/FM3Oscillator.cpp +++ b/src/common/dsp/oscillators/FM3Oscillator.cpp @@ -174,7 +174,7 @@ void FM3Oscillator::init_ctrltypes() oscdata->p[fm3_m3amount].set_name("M3 Amount"); oscdata->p[fm3_m3amount].set_type(ct_percent); oscdata->p[fm3_m3freq].set_name("M3 Frequency"); - oscdata->p[fm3_m3freq].set_type(ct_freq_audible); + oscdata->p[fm3_m3freq].set_type(ct_freq_audible_fm3_extendable); oscdata->p[fm3_feedback].set_name("Feedback"); oscdata->p[fm3_feedback].set_type(ct_osc_feedback_negative); @@ -222,4 +222,9 @@ void FM3Oscillator::handleStreamingMismatches(int streamingRevision, { oscdata->retrigger.val.b = true; } + + if (streamingRevision <= 21) + { + oscdata->p[fm3_m3freq].extend_range = false; + } }