summaryrefslogtreecommitdiff
path: root/src/drumgizmo.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r--src/drumgizmo.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/drumgizmo.cc b/src/drumgizmo.cc
index d389cc2..d15b192 100644
--- a/src/drumgizmo.cc
+++ b/src/drumgizmo.cc
@@ -137,6 +137,25 @@ bool DrumGizmo::run(size_t pos, sample_t *samples, size_t nsamples)
{
resample_ratio = 1.0;
}
+
+ if (settings_getter.audition_counter.hasChanged())
+ {
+ settings_getter.audition_counter.getValue();
+ auto instrument_name = settings.audition_instrument.load();
+ auto velocity = settings.audition_velocity.load();
+
+ std::size_t instrument_index = 0;
+ for (std::size_t i = 0; i < kit.instruments.size(); ++i)
+ {
+ if (instrument_name == kit.instruments[i]->getName())
+ {
+ instrument_index = i;
+ }
+ }
+
+ events.emplace_back(event_t{TYPE_ONSET, instrument_index, 0, velocity});
+ }
+
bool active_events_left =
input_processor.process(events, pos, resample_ratio);