summaryrefslogtreecommitdiff
path: root/src/instrument.cc
diff options
context:
space:
mode:
authorSander Vocke <sandervocke@gmail.com>2024-07-28 09:24:01 +0200
committerSander Vocke <sandervocke@gmail.com>2024-07-28 09:24:01 +0200
commitfaaaf5d328429fd2c3f38131f7a874d056761f3f (patch)
treec49575d96ac820addefcf184ec7ad4f0151bc716 /src/instrument.cc
parentf6660bc51fe8c02ff7c3b6188e8437c67712bddf (diff)
Openness development
Diffstat (limited to 'src/instrument.cc')
-rw-r--r--src/instrument.cc12
1 files changed, 9 insertions, 3 deletions
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<Choke>& Instrument::getChokes()
{
return chokes;