diff options
author | Alby M <1473644+Linux-cpp-lisp@users.noreply.github.com> | 2019-02-18 22:06:08 -0600 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-02-19 15:38:10 +0100 |
commit | f0d227f9258b40b63f54c5bf44e5d69c6f93e73d (patch) | |
tree | 84e361d1770ec91f2ab64afa1f528943d4ea83e9 /scripts/midi_remap.lua | |
parent | eb8394a0f10ec786c8246ea59a199c10f77218c0 (diff) |
Made any -> none mappings remove events
Diffstat (limited to 'scripts/midi_remap.lua')
-rw-r--r-- | scripts/midi_remap.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/midi_remap.lua b/scripts/midi_remap.lua index da3ffcb630..4fb7919e23 100644 --- a/scripts/midi_remap.lua +++ b/scripts/midi_remap.lua @@ -22,7 +22,7 @@ end function dsp_params () local map_scalepoints = {} - map_scalepoints["Off"] = OFF_NOTE + map_scalepoints["None"] = OFF_NOTE for note=0,127 do local name = ARDOUR.ParameterDescriptor.midi_note_name(note) map_scalepoints[string.format("%03d (%s)", note, name)] = note @@ -72,7 +72,7 @@ function dsp_run (_, _, n_samples) local translation_table = {} local ctrl = CtrlPorts:array() for i=1,N_REMAPINGS*2,2 do - if not (ctrl[i] == OFF_NOTE or ctrl[i + 1] == OFF_NOTE) then + if not (ctrl[i] == OFF_NOTE) then translation_table[ctrl[i]] = ctrl[i + 1] end end @@ -87,7 +87,9 @@ function dsp_run (_, _, n_samples) if (#d == 3) and (event_type == 9 or event_type == 8 or event_type == 10) then -- note on, note off, poly. afterpressure -- Do the mapping - 2 is note byte for these types d[2] = translation_table[d[2]] or d[2] - tx_midi (t, d) + if not (d[2] == OFF_NOTE) then + tx_midi (t, d) + end else tx_midi (t, d) end |