13
0

Add Lua scripts to remove SysEx events

This commit is contained in:
Robin Gareus 2024-09-09 00:17:49 +02:00
parent 4fa4fdf498
commit 38349b21dd
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -0,0 +1,21 @@
ardour { ["type"] = "EditorAction", name = "Remove SysEx",
license = "MIT",
author = "Ardour Team",
description = [[Remove SysEx MIDI events from selected MIDI region(s).]]
}
function factory () return function ()
local sel = Editor:get_selection ()
for r in sel.regions:regionlist ():iter () do
local mr = r:to_midiregion ()
if mr:isnil () then goto continue end
local mm = mr:midi_source(0):model ()
local midi_command = mm:new_sysex_diff_command ("Remove SysEx Events")
for event in ARDOUR.LuaAPI.sysex_list (mm):iter () do
midi_command:remove (event)
end
mm:apply_command (Session, midi_command)
::continue::
end
end end