diff options
author | André Nusser <andre.nusser@googlemail.com> | 2018-06-08 22:17:20 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2018-08-12 11:13:49 +0200 |
commit | 2da458423c1fa95d3000d94105f215c6a603094b (patch) | |
tree | 13db7d1b4104a5d3b60c73854d5d26396ba40fc1 /src/drumgizmo.cc | |
parent | 592f05fa549c7e680e502f569c27e71177361ad6 (diff) |
Add tab for drumkit.
Diffstat (limited to 'src/drumgizmo.cc')
-rw-r--r-- | src/drumgizmo.cc | 19 |
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); |