diff options
author | André Nusser <andre.nusser@googlemail.com> | 2019-07-19 02:27:31 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2019-07-19 02:27:31 +0200 |
commit | a031d63f1e86c2fd811c584c1cf7b0e4d5e23b20 (patch) | |
tree | 244ec3a1b12600a7cb8a6706987fff63f8c4cdd7 /src | |
parent | 8877cd2ecd225ddb35a7c21589ad87fdbe0f6dc5 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/sample_selection.cc | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |