Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make FM3's M3 Freq extendable down to 0.5 Hz #6949

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/common/Parameter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -2083,13 +2091,19 @@ 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:
{
val_min.f = -34.4936f; // 60 Hz
val_max.f = 49.09578; // 7500 Hz
}
break;
case ct_dly_fb_clippingmodes:
case ct_lfophaseshuffle:
{
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions src/common/Parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/common/SurgeStorage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion src/common/dsp/oscillators/FM3Oscillator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -222,4 +222,9 @@ void FM3Oscillator::handleStreamingMismatches(int streamingRevision,
{
oscdata->retrigger.val.b = true;
}

if (streamingRevision <= 21)
{
oscdata->p[fm3_m3freq].extend_range = false;
}
}