Add Lua scripts to remove SysEx events
This commit is contained in:
parent
4fa4fdf498
commit
38349b21dd
21
share/scripts/remove_sysex_from_region.lua
Normal file
21
share/scripts/remove_sysex_from_region.lua
Normal 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
|
Loading…
Reference in New Issue
Block a user