Open bijlevel opened 3 years ago
I can't even find requestDataChanged anywhere in the repo
OK, doing some more searching, the error windows seem to get created here.
This might be a good place to start to narrow down this error. I'll keep searching for other potential places.
Out of curiosity, does this only happen with panels that are imported from other versions, or does it still happen if panels are created from scratch in this version?
Indeed this link gives me (or someone else...) a good start! I did a panel from scratch with one simple function sending only one Midi message and got the same kind of error(s). All imported panels from older versions also give the error on every function which is called when clicking on a button. At least that is what my experience is. I did not test it with other kind of functions which involve calling "something".
I think I found the reason for the errors. In older versions assigning a variable to and formatting a sysex message like this: syxProgram = {0xF0, 0x07, 0x00, 0x78, 0x14, 0x09, 0x40, 0x08, 0xF7} was no problem. In this latest version (5.6.23) this is apparently a problem and causes the overload mismatch. The solution is to format the message explicitly as a string, like this: "F0 07 00 78 14 09 40 08 F7". Other ways also are OK, as long as (I think) the outcome is a string. I hope I'm right, but at least my panel does now run without issues so far in this version.
I think the bug must he in this file, though the only change has been to remove the luabind overload. As far as I can see it should still accept an array, but I'm definately no C++ guru.
It's weird because it seems to work fine in Windows.
https://github.com/RomanKubiak/ctrlr/blob/master/Source/MIDI/CtrlrMidiMessage.cpp
Looking at this, I'm wondering is line 118 should be
MemoryBlock possibleMidiData = luaArrayToMemoryBlock(luaArray.getObject());
and not
MemoryBlock possibleMidiData = luaArrayTomemoryBlock(luaArray.getObject());
Normally all the ctrlr stuff is strictly lowerCamelCase.
This function is only referenced 4 times in this repo, though it looks like it still relies on luaBind.
https://github.com/RomanKubiak/ctrlr/search?q=luaArrayToMemoryBlock
We've confirmed that it's just midi messages formatted as a table that cause the issue. MIDI messages in a memory block or string work fine. MemoryBlocks are probably the easiest conversion to make by using this code snippet.
requestMessage = {0xf0, 0x00, 0x00, 0x2f, 0x03, 0x01, 0x02, 0x00, 0xf7}
requestMessageMB = MemoryBlock()
requestMessageMB:createFromTable(requestMessage)
midi = CtrlrMidiMessage(requestMessageMB)
panel: sendMidiMessageNow (midi)
can you show me what causes an error ? a line in Lua ?
Sorry Roman, but I only found a kind of workaround and Godlike-Productions (aka the Puppeteer) did elaborate on this. See his comments. My guess is in this version (5.6.23) Lua does not accept a sysex message formatted as a table.
can you show me what causes an error ? a line in Lua ?
Hi Roman. Basically this works.
requestMessage = {0xf0, 0x00, 0x00, 0x2f, 0x03, 0x01, 0x02, 0x00, 0xf7}
requestMessageMB = MemoryBlock()
requestMessageMB:createFromTable(requestMessage)
midi = CtrlrMidiMessage(requestMessageMB)
panel: sendMidiMessageNow (midi)
This also works
requestMessage = {0xf0, 0x00, 0x00, 0x2f, 0x03, 0x01, 0x02, 0x00, 0xf7}
requestMessageMB = MemoryBlock()
requestMessageMB:createFromTable(requestMessage)
midi = CtrlrMidiMessage(requestMessageMB:toHexString(1))
panel: sendMidiMessageNow (midi)
This does NOT work
requestMessage = {0xf0, 0x00, 0x00, 0x2f, 0x03, 0x01, 0x02, 0x00, 0xf7}
midi = CtrlrMidiMessage(requestMessage)
panel: sendMidiMessageNow (midi)
This is only an issue with OSX. They all work fine in Windows.
It is only an issue with Ctrlr v5.6.23 for Mac. Older versions, in particular the 5.3.xxx versions, work OK.
@Godlike-Productions You don't need all those lines to create a memoryblock:
just replace :
panel:sendMidiMessageNow(CtrlrMidiMessage({x, y, z }))
with
panel:sendMidiMessageNow(CtrlrMidiMessage(MemoryBlock({x, y, z})))
where t={x, y, z } is already a table. since you can create a MB from a table you can get a volatile MB with just : MemoryBlock({x, y, z})
This way you can update all your "sendMidiMessageNow" instructions to the 5.5.0 version without to much hassle by just wrapping your table with MemoryBlock(t)
Thank you, this is a great solution: "panel:sendMidiMessageNow(CtrlrMidiMessage(MemoryBlock({x, y, z})))"
Greeting, Fred
I did compile the latest build (v5.6.23) on Mac, but when trying to use existing panels I get always the same error when using callBack methods:
What could be the origin of these errors?