Home › Forums › General › Programming › LAU midiMassageReceived cause crash
- This topic has 25 replies, 2 voices, and was last updated 12 years, 1 month ago by atom.
-
AuthorPosts
-
February 25, 2012 at 3:42 pm #565
Trying to get a modulator to update on patchdump.
As soon as i enable the lua code in the panel ctrlr crashes.[code:33cey2ja]–
— Called when a panel receives a midi message (does not need to match any modulator mask)
—midiMessageReceived = function(midiMessage)
s = midiMessage:getSize()
if s == 67 then
out = panel:getModulatorByName("outputLabel")
out:getComponent():setPropertyString ("uiLabelText", midiMessage:toString())
console("received program data")assignValues(midiMessage)
end
endfunction assignValues(midiMessage)
console ("assignValues")
lastSavedProgram = midiMessage:getLuaData()
programData = midiMessage:getLuaData():getByte(
— unpackedData = utils.unpackDsiData(programData)console ("RAW DATA: ")
console (programData:toHexString(1))
— console ("UNPACKED DATA: ")
— console (unpackedData:toHexString(1))panel:getModulatorByName("modulator-1"):setModulatorValue(programData:getByte(, false, true, true)
end
[/code:33cey2ja]Can anyone tel me why?
It’s a simple panel with just one modulatorFebruary 25, 2012 at 3:58 pm #3949can you also paste the output from the console here ? have you tried removing more lines to see witch one causes the crash ?
February 25, 2012 at 5:29 pm #3950Yes i’ve taken out some lines.
It’s a test panel with one modulator only (trying to get the code working for the JX-8P)
Ctrlr crashes with all midi inputThe sysex when i press the preset button on the JX-8P:
[list:2l8igms2]
[f0 41 36 00 21 30 01 08 02 f7][19216.431]
[c0 40][19216.432]
[f0 41 36 00 21 30 01 07 00 f7][19216.435]
f0 41 35 00 21 20 01 20 50 49 41 4e 4f 20 31 20 20 20 00 60 42 00 00 60 20 00 68 46 00 00 7f 7f 7f 00 60 5a 55 7f 20 60 20 2d 1c 00 11 5f 40 20 7f 20 20 40 54 67 00 2f 00 21 20 00 4d 00 25 20 7f 40 f7][19216.49]
[/list:u:2l8igms2]February 25, 2012 at 7:48 pm #3951that won’t work
[code:1rev88nr]
programData = midiMessage:getLuaData():getByte(
panel:getModulatorByName("modulator-1"):setModulatorValue(programData:getByte(, false, true, true)
[/code:1rev88nr]programData is a byte (a number) you can’t call method on it.
February 26, 2012 at 8:23 am #3952Getrange does the same. Also gives a crash
February 26, 2012 at 9:01 am #3953Even with this little lua code ctrlr crashes[code:33riel45]–
— Panel executes when when a midi message is received
—
—midiMessageReceived = function(midiMessage)
s = midiMessage:getSize()
— console(string.format ("I got the size of the message, here it is : %d",s))
end
[/code:33riel45]
I think console should show me the sysex byte lengtFebruary 26, 2012 at 12:25 pm #3954Can you tell me what revision of Ctrlr are u using. I’ll check and see if there is something wrong, but even if there is it will take some time to fix cause i dismantled Ctrlr and need to put it back together in a better way and that might take a while.
February 26, 2012 at 3:59 pm #3955I’ve the latest build and tryed the stable one.
Both with the same behavior.February 26, 2012 at 4:35 pm #3956Windows version 32bit
February 27, 2012 at 4:59 pm #3957Can you try this piece of code as part of your method, and see what the console will tell you
[code:2r828jir]
data = midiMessage:getLuaData()
console (string.format ("midiIncomming size: %d", data:getSize()))
console ("HEX: "..data:toHexString(1))
for i=0,data:getSize()-1 do
console (string.format("BYTE[%d]: %d/%x", i, data:getByte(i), data:getByte(i)))
end
[/code:2r828jir]February 27, 2012 at 11:04 pm #3958if i input this in the console i’m getting an error.
ERROR: [string "data = midiMessage:getLuaData()…"]:1: attempt to index global ‘midiMessage’ (a nil value)February 27, 2012 at 11:39 pm #3959No no, edit the method, and replace it with:
[code:asyo8m0r]
midiMessageReceived = function(midiMessage)
data = midiMessage:getLuaData()
console (string.format ("midiIncomming size: %d", data:getSize()))
console ("HEX: "..data:toHexString(1))
for i=0,data:getSize()-1 do
console (string.format("BYTE[%d]: %d/%x", i, data:getByte(i), data:getByte(i)))
end
end
[/code:asyo8m0r]then try to generate some midi data to the panel and watch the LUA console for any events.
February 28, 2012 at 6:38 am #3960Haha you must be thinking ” title=”Wink” />
But there is no output in the console an ctrlr crashes.
February 28, 2012 at 8:21 am #3961What i’m finding strange is when i fire a random sysex string at other pannels
like the Virus or Blofeld, ctrlr doesn’t crash.February 28, 2012 at 2:52 pm #3962That’s why i’m trying to figure out what is happening, have you tried my piece of code ?
February 28, 2012 at 4:53 pm #3963Yes and also ctrlr crashes.
February 28, 2012 at 4:54 pm #3964Allright can you send the panel to me or attach it here so i can debug it ?
February 28, 2012 at 5:03 pm #3965In the vst version ctrlr doesn’t crash but there is no byte length shown in the console
February 28, 2012 at 5:06 pm #3966Here is the paneltext
February 28, 2012 at 5:32 pm #3967It’s weird, i think there is something weird happening with the naming scheme here. Try to create a new panel, add a method call it myMethod and paste the code from the old method, so that it look like this:
[code:6dx2hvce]—
— Called when a panel receives a midi message (does not need to match any modulator mask)
—myMethod = function(midiMessage)
data = midiMessage:getLuaData()
console (string.format ("midiIncomming size: %d", data:getSize()))
console ("HEX: "..data:toHexString(1))for i=0,data:getSize()-1 do
console (string.format("BYTE[%d]: %d/%x", i, data:getByte(i), data:getByte(i)))
endend
[/code:6dx2hvce]but try it on a new panel and see if that keeps crashing.
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.