Reply To: Callback Error

Home Forums General Using Ctrlr Callback Error Reply To: Callback Error

#73258
Gecko
Participant
  • Topics: 1
  • Replies: 11
  • Total: 12

Hey Guys, had a bunch of work, and couldn’t sit down with the JV till today.

Tried the String method, but didn’t work. Gave me all kinds of error messages. Open it up in Stand Alone mode, even so that it gave me an error message at the begging, I was able to place my Sound Interface as Input – Output but couldn’t place the mpd32 as Device. But I moved the knobs and the Midi Message in from the JV lit. ATM couldn’t get the signal from the mpd32 to the JV. The name of the patches did not load.

I copied the code I have in my latest edit, the one with the Strings message written in it, no hyphens, just in case it is use for you guys. When I hit Save and Compile it did gave me this error message in the bottom box:

Compile: initializeValues – FAILED
ERROR: [string “initializeValues”]:19: ‘)’ expected (to close ‘(‘ at line nitializevalues 18) near ‘formula’

There was a line which had an extra apostrophe, tried with and without it:
–console(string(“Trying to decode modulator “..string.format(“%s”,v)))

Here’s the code of my latest edit:

—————————————————————————-


— Called when the panel has finished loading

initializeValues = function()
displayText(“Initializing…”)
console(String(“======== Trying to decode modulators ======”))
local memoryItem = “FF”

— Modulator list by sysex offset.
— Keys/indexes are two byte hex strings (like “00 4C”)
modulatorListByMemory = {}
modulatorSpecialListByMemory = {}

local max = panel:getNumModulators()
for v=1,max,1 do
local modulatorRef = panel:getModulatorByIndex(v)
if (modulatorRef ~= nil and (modulatorRef:getProperty(“modulatorIsStatic”)==”0″)) then
console(String(“Trying to decode modulator “..string.format(“%s”,v))
formula = string.format(“%s”,modulatorRef:getMidiMessage():getProperty(“midiMessageSysExFormula”))
if formula ~= nil then
console(String(“Sysex formula: “..formula))
string.sub(formula, 22, 5) should work but somehow it does not…
if (string.len(formula) == 35) then
sysexAddress=string.sub(formula , 22 )
sysexAddress=string.sub(sysexAddress , 1 , 5 )
console(String(“Sysex address: “..sysexAddress))
modulatorListByMemory[sysexAddress] = modulatorRef
— Special modulators that have 2-byte values. It will be treated differently.
elseif (string.len(formula) == 38) then
sysexAddress=string.sub(formula , 22 )
sysexAddress=string.sub(sysexAddress , 1 , 5 )
console(String(“Sysex address: “..sysexAddress))
modulatorSpecialListByMemory[sysexAddress] = modulatorRef

end
end
end
end
console(String(“======== Modulator decode end ======”))
end
console(String(“======== Modulator decode end ======”)): “..formula)
—————————————————-
Bottom Box

Compile: initializeValues – FAILED
ERROR: [string “initializeValues”]:19: ‘)’ expected (to close ‘(‘ at line nitializevalues 18) near ‘formula’

——————————————————————————–

Only did the input of the String message in the Initialize Tab.

Ctrlr