summaryrefslogtreecommitdiff
path: root/plugin/drumgizmo_plugin.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-08-08 10:34:54 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-08-08 10:34:54 +0200
commitf43935b5c873676a632b23cbfcef45a4431b233d (patch)
treead1473fa34f3da5292e3344a99ed447261d99584 /plugin/drumgizmo_plugin.cc
parenta2483a839264369482fff135d33f007ded266d3c (diff)
Add support for a single midi note that plays multiple instruments.
Diffstat (limited to 'plugin/drumgizmo_plugin.cc')
-rw-r--r--plugin/drumgizmo_plugin.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc
index 82c0ee9..7960763 100644
--- a/plugin/drumgizmo_plugin.cc
+++ b/plugin/drumgizmo_plugin.cc
@@ -410,7 +410,18 @@ bool DrumGizmoPlugin::Input::loadMidiMap(const std::string& file,
bool result = AudioInputEngineMidi::loadMidiMap(file, i);
std::vector<std::pair<int, std::string>> midnam;
- const auto& map = mmap.getMap();
+ const auto& midimap = mmap.getMap();
+ std::map<int, std::string> map;
+ for(const auto& entry : midimap)
+ {
+ // in case of multiple instruments mapped to one note, use '/' as separator
+ if(!map[entry.note_id].empty())
+ {
+ map[entry.note_id] += "/";
+ }
+ map[entry.note_id] += entry.instrument_name;
+ }
+
midnam.reserve(map.size());
for(const auto& m : map)
{