Just a question to understand memory management on an E1 a bit better.
I’m using a parameterOnChange function, to send out SysEx when a change originates from the E1 itself. At the same time I was sending outputs for debugging reasons (see the print command) per change.
But I was getting "not enough memory " issues, so I added filters in the code not to show the results on incoming changes (origin = 1) and some other reasons. That explains why the screenshot texts are not consistent with the more recent code below.
I haven’t had memory issues yet since.
Question therefor is: can it be that when requesting too much output, this might cause some buffer in the E1 to fill in with queues (yet to print), resulting in an ‘out of memory’ state?
function parameterMap.onChange (valueObjects, origin, value)-- callback function retrieving MIDI value
if origin == 1 then return end -- only process parameter Change when set from within the E1
local parameterNumber = 0
local parameterType = 0
local byte7 = 0
for i, valueObject in ipairs (valueObjects) do
local control = valueObject:getControl ()
parameterNumber = valueObject:getMessage():getParameterNumber ()
parameterType = valueObject:getMessage():getType ()
if parameterNumber>=7000 then return end -- only send sysEx when parameter below 7000
if parameterType~= 0 then return end-- only process virtual K4R parameters
print(string.format ("Parameter %d (origin %d) => Control '%s'.%s with midiValue %d"
, parameterNumber, origin, control:getName(), valueObject:getId(),value))
--print(string.format (" Control has minimum value %d and maximum value %d"
-- , control:getValue("min"):getMin(), control:getValue("max"):getMax() ))
break
end
if parameterNumber%1000 == 36 then byte7 = math.floor(value/128) end -- wave selection uses byte 7 to host bit 8 of the value
midi.sendSysex (devPort, {0x40, channel-1, 0x10, 0x00, 0x04, parameterNumber%1000, math.floor(parameterNumber/1000)+byte7, value%128})
end