PSdH:HHM ꣸C̭6VIAZ LuaCC2PCAZLU--[[ Translate CCs (f.e. sent by buttons) into PC ]]-- -- This table defines the mapping (CC6 - PC4, CC8 - PC53 local ccmap = { [6] = 4, [8] = 53 } function OnInput(pqIn, pqOut) for i,e in ipairs(pqIn) do if e.Type == Control and ccmap[e.Num] then if e.Val > 0 then -- Value not zero, button press, replace local pc = MfxEvent.new(Patch) pc.Time = e.Time pc.Chan = e.Chan pc.Patch = ccmap[e.Num] pqOut.add(pc) end -- else that is "button release", don't send anything else -- the rest send unchanged pqOut.add(e) end end end OnEvents = function ( From, To, pqIn, pqOut) OnInput(pqIn, pqOut) end