You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Don't know why, but it's very easy to add those events in:
pos = pos or 0
local n = midi.Event(pos, 3)
n.data[0] = bor(0xd0, channel-1)
n.data[1] = band(val, 127)
n.data[2] = 0x00
return n
end
midi.Event.polyPressure = function (channel, val, noteId, pos)
pos = pos or 0
local n = midi.Event(pos, 3)
n.data[0] = bor(0xa0, channel-1)
n.data[1] = band(noteId, 127)
n.data[2] = band(val, 127)
return n
end
And under MidiEvent_mt
--- Is a channel aftertouch event.
-- @treturn boolean whether event is a channel aftertouch event.
-- @function Event:isControl
isPressure = function (self)
return band(self.data[0], 0xf0)==0xd0
end;
--- Get aftertouch value.
-- @return pressure value (0-127).
-- @function Event:getPressureValue
getPressureValue = function (self)
if not self:isPressure() then error "not a channel pressure event" end
return self.data[2]
end;
--- Is a polyphonic pressure event.
-- @treturn boolean whether event is a polyphonic pressure event.
-- @function Event:isControl
isPolyPressure = function (self)
return band(self.data[0], 0xf0)==0xa0
end;
--- Get pressure note ID value.
-- @return note ID (0-127).
-- @function Event:getPolyPressureValue
getPolyPressureNoteID = function (self)
if not self:isPolyPressure() then error "not a polyphonic pressure event" end
return self.data[1]
end;
--- Get poly pressure value.
-- @return pressure value (0-127).
-- @function Event:getPolyPressureValue
getPolyPressureValue = function (self)
if not self:isPolyPressure() then error "not a channel pressure event" end
return self.data[2]
end;
I hadn't implemented program change but it's pretty simple. Replace the modified midi.lua in the protoplugs folder and you're golden.
Current API module does not have any support for getting or setting ProgramChange, ChannelPressure and PolyPressure midi events. Why not?
The text was updated successfully, but these errors were encountered: