I'm really a bit frustrated after searching the web for a simple midi plugin, that allows to pass a particular note of all octaves through and filters all other notes out.
Example: I want all E's to pass, so the E-1, E0, E1, ..., E8 pass, while all other notes should be filtered out.
Either I'm dumb or there's no such plugin. I have searched pizMidi, NDC, you name it ... But may be I missed some plugin less known midi plugins.
Thanks
] Peter:H [
---
In the meantime I used the "LUA Protoplug" (https://github.com/pac-dev/protoplug/releases) and wrote a Proof Of Concept myself
Code: Select all
require "include/protoplug"
//midi note numbers for Fs and Es
local allFs = {17, 29, 41, 53, 65, 77, 89, 101, 113}
local allEs = {16, 28, 40, 52, 64, 76, 88, 100, 112}
local blockEvents = {}
function plugin.processBlock(samples, smax, midiBuf)
blockEvents = {}
-- analyse midi buffer and prepare a chord for each note
for ev in midiBuf:eachEvent() do
if (ev:isNoteOn() and locate(allEs,ev:getNote())) then
insertNoteOn(ev)
elseif (ev:isNoteOff() and locate(allEs,ev:getNote())) then
insertNoteOff(ev)
end
end
-- fill midi buffer with prepared notes
midiBuf:clear()
if #blockEvents>0 then
for _,e in ipairs(blockEvents) do
midiBuf:addEvent(e)
end
end
end
function insertNoteOn(root)
local newEv = midi.Event.noteOn(
root:getChannel(),
root:getNote(),
root:getVel())
table.insert(blockEvents, newEv)
end
function insertNoteOff(root)
local newEv = midi.Event.noteOff(
root:getChannel(),
root:getNote())
table.insert(blockEvents, newEv)
end
function locate( table, value )
for i = 1, #table do
if table[i] == value then return true end
end
return false
end
