From faaaf5d328429fd2c3f38131f7a874d056761f3f Mon Sep 17 00:00:00 2001 From: Sander Vocke Date: Sun, 28 Jul 2024 09:24:01 +0200 Subject: Openness development --- src/instrument.cc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/instrument.cc') diff --git a/src/instrument.cc b/src/instrument.cc index b7bcdd9..6556fb1 100644 --- a/src/instrument.cc +++ b/src/instrument.cc @@ -30,10 +30,11 @@ #include "sample.h" -Instrument::Instrument(Settings& settings, Random& rand) +Instrument::Instrument(Settings& settings, Random& rand, float openness_choke_threshold) : settings(settings) , rand(rand) , sample_selection(settings, rand, powerlist) + , openness_choke_threshold(openness_choke_threshold) { DEBUG(instrument, "new %p\n", this); mod = 1.0; @@ -54,12 +55,12 @@ bool Instrument::isValid() const return this == magic; } -const Sample* Instrument::sample(level_t level, size_t pos) +const Sample* Instrument::sample(level_t level, float openness, std::size_t pos) { if(version >= VersionStr("2.0")) { // Version 2.0 - return sample_selection.get(level * mod, pos); + return sample_selection.get(level * mod, openness, pos); } else { @@ -153,6 +154,11 @@ float Instrument::getMinPower() const } } +float Instrument::getOpennessChokeThreshold() const +{ + return openness_choke_threshold; +} + const std::vector& Instrument::getChokes() { return chokes; -- cgit v1.2.3