Console printing non related stuff - Mk2 firmware 3.5

This one is a head scratcher. I do not think it is related to Mk2, or the firmware.

This is what normally happens on boot:

  • All the stored parameters are sent to their controls.
  • The controls, on change, call their respective functions.

imagine we have a fader control, using the following function

function myFaderWasMoved(vo, v)
    local typeV = type(v)
    local valueToPrint = (typeV == 'table') and typeV or tostring(v)
    print('LOG FUNCTION CALL [ myFaderWasMoved ]( '..valueToPrint..' )')
end

I set up a similar functionality log for each function called by a control. My template is quite short on controls, but almost 6k lines of code. This is the expected print

04:07:37.816 lua: LOG FUNCTION CALL [ myFaderWasMoved ]( 0.0 )

but some times, I get this

04:07:37.820 lua: LOG FUNCTION CALL [ myFa{"version":1,"presets":[{"slot":0,"bankNumber":0,"name":"KDS","projectId":"qzNMc7wxk2p1kVHHRY9t"},{"slot":1,"bankNumber":0,"name":"EMPTY","projectId":"pthdMCbauOIvie2M3cPf"},{"slot":2,"bankNumber":0,"name":"EMPTY","projectId":"pthdMCbauOIvie2M3cPf"},{"slot":3,"bankNumber":0,"name":"EMPTY","projectId":"pthdMCbauOIvie2M3cPf"},{"slot":4,"bankNumber":0,"name":"EMPTY","projectId":"pthdMCbauOIvie2M3cPf"},{"slot":5,"bankNumber":0,"name":"EMPTY","projectId":"pthdMCbauOIvie2M3cPf"},{"slot":6,"bankNumber":0,"name":derWasMoved ]( 0.0 )

And yes, I did set up my E1 with the first page of presets with one called “EMPTY”, except one called “KDS”.

Why was the json information of the first row of presets shown?

Now, this script is quite large (6k lines), and at some point it was using .5Mb of ram, I was afraid that there was some pointers wrongly returning stuff from other registry, but it seems that it is randomly when it happens. Any ideas?

My guess is you have setup the string in a way such that it’s interpolating the function name. Probably could search for stuff about “string interpolation lua”

Hi @adamc, I am not doing a fancy replacement. Bellow is what I am actually doing, and the variables categoryName and functionName come as an argument to a function, so both are strings:

print('DEBUG CALL [ ' .. categoryName .. ' ][ ' .. functionName .. ' ]( ' .. valuesToPrint .. ' )')

And while it is a string with the name of the function, I am not calling it like functionName(). The intriguing stuff is that I have no function that shows the available presets in the E1.

Could you try to create a small example where the behavior can still be reproduced and post it so that we can test it on our Electras?

I haven’t found a way to reproduce on a small code.