From a031d63f1e86c2fd811c584c1cf7b0e4d5e23b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Nusser?= Date: Fri, 19 Jul 2019 02:27:31 +0200 Subject: Make "diversity" penalty linear instead of quadratic. This again makes our sample selection less prone to extreme outliers. Now only closeness has a quadratic penalty. --- src/sample_selection.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/sample_selection.cc b/src/sample_selection.cc index 03453f3..f675044 100644 --- a/src/sample_selection.cc +++ b/src/sample_selection.cc @@ -126,7 +126,7 @@ const Sample* SampleSelection::get(level_t level, std::size_t pos) auto random = rand.floatInRange(0.,1.); auto close = (samples[current_index].power - level)/power_range; auto diverse = 1./(1. + (float)(pos - last[current_index])/settings.samplerate); - auto value = f_close*pow2(close) + f_diverse*pow2(diverse) + f_random*random; + auto value = f_close*pow2(close) + f_diverse*diverse + f_random*random; if (value < value_opt) { -- cgit v1.2.3