Reply To: Callback error: Lua runtime error

Home Forums General Programming Callback error: Lua runtime error Reply To: Callback error: Lua runtime error

#13261
lfo2vco
Participant
    • Topics: 26
    • Replies: 162
    • Total: 188
    • ★★

    OK, I think that the problem is that I cannot put a string into at MIDI message. Is that correct?

    So in this instance I have to get the Sysex data into a memory block and compile the information there?

    I have looked through several examples in other panels but cannot decipher the mechanics of what is happening as they are very complex methods. Way beyond what I am currently capable of.

    Should I be trying something like the following?

    Write your values to a Lua table that’s indexed with numbers, like so

    myTable = {}
    myTable[1] = panel:getModulatorByName("w00f"):getValue()
    myTable[2] = panel:getModulatorByName("w00f"):getValue()
    myTable[3] = panel:getModulatorByName("w00f"):getValue()
    myTable[4] = panel:getModulatorByName("w00f"):getValue()
    

    then convert that table to a MemoryBlock

    mb = MemoryBlock (myTable)
    

    and write that to a file, do this in reverse to get the values.

    To convert a MemoryBlock to a hex string use toHexString(1) method (the 1 as the parameter is the grouping parameter for output)

    a MemoryBlock can be constructed from a hex string ex:

    mb = MemoryBlock ("f0 f1 f2 f3 f7")
    console (mb:toHexString(1))
    

    Here is some noise I organised into an acceptable format:
    https://soundcloud.com/lfo2vco/a-dark-crystal

    Ctrlr