Is it possible to prevent a midi message being sent when the value of a message is changed with a function call <message>:setValue(newValue)
?
What i want to achieve is updating the value of the pots by incoming sysex messages from a DAW. But the pots shouldn’t fire a cc message in response, because this will lead to a midi loop with the DAW sending the sysex messages and ultimately lead to a crash of the DAW. The pots should only emit midi messages when they are turned on the E1 controller.
Maybe not the most elegant solution, but you could set the pot to type virtual
and write a custom handler for the pots, that checks if a message was being sent before processing the value.
1 Like
A very handy callback is parameterMap.onChange.
The first line in the function is enough to reach what you want.
function parameterMap.onChange(valueObjects, origin, value)
if origin == MIDI then return end
for i, valueObject in ipairs(valueObjects) do -- -- onChange manually or via LUA
local parameterNumber = valueObject:getMessage ():getParameterNumber ()
local parameterType = valueObject:getMessage ():getType ()
if parameterType ~= PT_VIRTUAL then return end
-- from now on only virtual parameters, manually changed
.....
1 Like
The 4.0 has a Lua function (a method of the parameterMap) that allows setting the value without triggering all associated actions (sending a message, triggering callbacks, etc). I will provide all necessary info when the beta firmware is okayed by the community.
2 Likes