diff options
author | Sander Vocke <sandervocke@gmail.com> | 2024-07-23 13:23:38 +0200 |
---|---|---|
committer | Sander Vocke <sandervocke@gmail.com> | 2024-07-23 13:23:38 +0200 |
commit | 0e59f90e2396190ec3e3a7195bac9c79e12fd6cc (patch) | |
tree | f7fd25a952c6e64db9108eab2a774e46fd9f0a83 /plugin/drumgizmo_plugin.cc | |
parent | 019d478818950f7880d2c0f80d8fc8f963e9736b (diff) |
Add CC-controller openness parameter for hi-hats.
Diffstat (limited to 'plugin/drumgizmo_plugin.cc')
-rw-r--r-- | plugin/drumgizmo_plugin.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/plugin/drumgizmo_plugin.cc b/plugin/drumgizmo_plugin.cc index 7960763..e582f93 100644 --- a/plugin/drumgizmo_plugin.cc +++ b/plugin/drumgizmo_plugin.cc @@ -410,16 +410,23 @@ bool DrumGizmoPlugin::Input::loadMidiMap(const std::string& file, bool result = AudioInputEngineMidi::loadMidiMap(file, i); std::vector<std::pair<int, std::string>> midnam; + // Create MIDNAM mappings. + // FIXME: Can CC entries somehow be added to the MIDNAM file? + // For now, limiting this to note mappings. 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()) + if(entry.from_kind == MapFrom::Note && + entry.to_kind == MapTo::PlayInstrument) { - map[entry.note_id] += "/"; + // in case of multiple instruments mapped to one note, use '/' as separator + if(!map[entry.from_id].empty()) + { + map[entry.from_id] += "/"; + } + map[entry.from_id] += entry.instrument_name; } - map[entry.note_id] += entry.instrument_name; } midnam.reserve(map.size()); |