From 5cfe39aa82ce25895517fb16e5fb7856181dd6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Sat, 20 Jul 2019 12:18:40 +0200 Subject: Set new default values for sample selection alg and scale parameters. The parameters are now all in [0,1]. --- plugingui/sampleselectionframecontent.cc | 18 +++++++++--------- plugingui/sampleselectionframecontent.h | 4 ---- src/sample_selection.cc | 3 ++- src/settings.h | 6 +++--- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/plugingui/sampleselectionframecontent.cc b/plugingui/sampleselectionframecontent.cc index d52ef93..f0aa5e7 100644 --- a/plugingui/sampleselectionframecontent.cc +++ b/plugingui/sampleselectionframecontent.cc @@ -45,21 +45,21 @@ SampleselectionframeContent::SampleselectionframeContent(Widget* parent, f_close.resize(80, 80); f_close_knob.resize(30, 30); f_close_knob.showValue(false); - f_close_knob.setDefaultValue(Settings::sample_selection_f_close_default/f_close_factor); + f_close_knob.setDefaultValue(Settings::sample_selection_f_close_default); f_close.setControl(&f_close_knob); layout.addItem(&f_close); f_diverse.resize(80, 80); f_diverse_knob.resize(30, 30); f_diverse_knob.showValue(false); - f_diverse_knob.setDefaultValue(Settings::sample_selection_f_diverse_default/f_diverse_factor); + f_diverse_knob.setDefaultValue(Settings::sample_selection_f_diverse_default); f_diverse.setControl(&f_diverse_knob); layout.addItem(&f_diverse); f_random.resize(80, 80); f_random_knob.resize(30, 30); f_random_knob.showValue(false); - f_random_knob.setDefaultValue(Settings::sample_selection_f_random_default/f_random_factor); + f_random_knob.setDefaultValue(Settings::sample_selection_f_random_default); f_random.setControl(&f_random_knob); layout.addItem(&f_random); @@ -84,32 +84,32 @@ SampleselectionframeContent::SampleselectionframeContent(Widget* parent, void SampleselectionframeContent::fCloseKnobValueChanged(float value) { - settings.sample_selection_f_close.store(value*f_close_factor); + settings.sample_selection_f_close.store(value); } void SampleselectionframeContent::fDiverseKnobValueChanged(float value) { - settings.sample_selection_f_diverse.store(value*f_diverse_factor); + settings.sample_selection_f_diverse.store(value); } void SampleselectionframeContent::fRandomKnobValueChanged(float value) { - settings.sample_selection_f_random.store(value*f_random_factor); + settings.sample_selection_f_random.store(value); } void SampleselectionframeContent::fCloseSettingsValueChanged(float value) { - f_close_knob.setValue(value/f_close_factor); + f_close_knob.setValue(value); } void SampleselectionframeContent::fDiverseSettingsValueChanged(float value) { - f_diverse_knob.setValue(value/f_diverse_factor); + f_diverse_knob.setValue(value); } void SampleselectionframeContent::fRandomSettingsValueChanged(float value) { - f_random_knob.setValue(value/f_random_factor); + f_random_knob.setValue(value); } } // GUI:: diff --git a/plugingui/sampleselectionframecontent.h b/plugingui/sampleselectionframecontent.h index 67da213..d94b3fc 100644 --- a/plugingui/sampleselectionframecontent.h +++ b/plugingui/sampleselectionframecontent.h @@ -46,10 +46,6 @@ public: SettingsNotifier& settings_notifier); private: - static float constexpr f_close_factor = 4.f; - static float constexpr f_diverse_factor = 1.f; - static float constexpr f_random_factor = 1.f; - void fCloseKnobValueChanged(float value); void fDiverseKnobValueChanged(float value); void fRandomKnobValueChanged(float value); diff --git a/src/sample_selection.cc b/src/sample_selection.cc index f991e4b..6fe4b63 100644 --- a/src/sample_selection.cc +++ b/src/sample_selection.cc @@ -70,7 +70,8 @@ const Sample* SampleSelection::get(level_t level, std::size_t pos) float close_opt = 0.; float diverse_opt = 0.; - const float f_close = settings.sample_selection_f_close.load(); + // Note the magic value of "4" in front of f_close + const float f_close = 4.*settings.sample_selection_f_close.load(); const float f_diverse = settings.sample_selection_f_diverse.load(); const float f_random = settings.sample_selection_f_random.load(); diff --git a/src/settings.h b/src/settings.h index 84add97..b967f91 100644 --- a/src/settings.h +++ b/src/settings.h @@ -75,9 +75,9 @@ struct Settings static float constexpr velocity_modifier_falloff_default = 0.5f; static float constexpr velocity_modifier_weight_default = 0.25f; static float constexpr velocity_stddev_default = 1.0f; - static float constexpr sample_selection_f_close_default = 2.f; - static float constexpr sample_selection_f_diverse_default = .2f; - static float constexpr sample_selection_f_random_default = 0.1f; + static float constexpr sample_selection_f_close_default = .5f; + static float constexpr sample_selection_f_diverse_default = .1f; + static float constexpr sample_selection_f_random_default = 0.03f; Atomic velocity_modifier_falloff{velocity_modifier_falloff_default}; Atomic velocity_modifier_weight{velocity_modifier_weight_default}; Atomic velocity_stddev{velocity_stddev_default}; -- cgit v1.2.3