Hello!
I am trying to add the ability to Changes Ports and Midi Channels to my “EMU Proteus 2” Preset I am starting to make. It is MultiTimbral to have the ability to change channels on the fly and update the control parameters is ideal.
I took what I were essential from the Arp Preset but I get an error.
-- Channels
local ALL_CHANNELS = 0
-- User input variables
--
local state = {
-- Port In
portIn = PORT_1,
-- MIDI channel in
channelIn = 1,
-- Port out
portOut = PORT_1,
-- MIDI channel out
channelOut = 1,
}
-- Runtime variables
--
local runtime = {
-- Indicates that user changed settings of ports/channels
ioChangeIsPending = true,
}
-- Map of parameters used in the preset
--
local parameters = {
portIn = { PT_VIRTUAL, 11 },
channelIn = { PT_VIRTUAL, 12 },
portOut = { PT_VIRTUAL, 13 },
channelOut = { PT_VIRTUAL, 14 },
}
-- Initialize the preset
-- Reconfigure all IO ports according to the UI config
--
function reconfigureIoPorts()
state.portIn = getParameter(parameters.portIn)
state.channelIn = getParameter(parameters.channelIn)
state.portOut = getParameter(parameters.portOut)
state.channelOut = getParameter(parameters.channelOut)
end
-- Reflect any changes to the Input/Output
if runtime.ioChangeIsPending then
reconfigureIoPorts()
runtime.ioChangeIsPending = false
end
-- Check input port and channel
--
function isInputMatching(port, channel)
if state.portIn ~= port then
return false
end
if (channel ~= ALL_CHANNELS) and (channel ~= state.channelIn) then
return false
end
return true
end
-- Function callbacks
-- Callback to change the input port
--
function setIoPort(valueObject, value)
runtime.ioChangeIsPending = true
end
ERROR:
loadLuaModule: error loading file: filename=ctrlv2/slots/p001.lua, error=ctrlv2/slots/p001.lua:44: attempt to call a nil value (global ‘getParameter’)
Thank you,
Michael