Reply To: lua&demo panel question

Home Forums General Programming lua&demo panel question Reply To: lua&demo panel question

#14136
zeoka
Participant
    • Topics: 73
    • Replies: 466
    • Total: 539
    • ★★★

    Hi
    i try this :

    myNewMethod = function(midi)
    
    vendor = midi:getLuaData():getByte(1)
     model = midi:getLuaData():getByte(2)
      typ1 = midi:getLuaData():getByte(4)
      typ2 = midi:getLuaData():getByte(5)
      typ3 = midi:getLuaData():getByte(6)
       if vendor == 62 and model == 17 then 
          if typ1 == 16  and typ3 == 0 then  
     i0to13 = midi:getLuaData():getRange(7,14) 
    i16to23 = midi:getLuaData():getRange(23,8)
    i26to33 = midi:getLuaData():getRange(33,8)
    i36to50 = midi:getLuaData():getRange(43,15)
    i53to67 = midi:getLuaData():getRange(60,15)
    i69to73 = midi:getLuaData():getRange(76,5)
    i75to83 = midi:getLuaData():getRange(82,9)
    i85to91 = midi:getLuaData():getRange(92,7)
        i94 = midi:getLuaData():getByte(101)
    sound01 = MemoryBlock(string.format("%s %s %s %s %s %s %s %s %s", i0to13:toHexString(1),i16to23:toHexString(1),i26to33:toHexString(1),
    i36to50:toHexString(1),i53to67:toHexString(1),
    i69to73:toHexString(1),i75to83:toHexString(1),i85to91:toHexString(1),i94:toHexString())) 
    panel:setModulatorValuesFromData (sound01, "vstIndex", 0, 1, false)
      elseif typ1 == 16  and typ3 == 1 then
     i0to13 = midi:getLuaData():getRange(7,14) 
    i16to23 = midi:getLuaData():getRange(23,8)
    i26to33 = midi:getLuaData():getRange(33,8)
    i36to50 = midi:getLuaData():getRange(43,15)
    i53to67 = midi:getLuaData():getRange(60,15)
    i69to73 = midi:getLuaData():getRange(76,5)
    i75to83 = midi:getLuaData():getRange(82,9)
    i85to91 = midi:getLuaData():getRange(92,7)
        i94 = midi:getLuaData():getByte(101)
    sound02 = MemoryBlock(string.format("%s %s %s %s %s %s %s %s %s", i0to13:toHexString(1),i16to23:toHexString(1),i26to33:toHexString(1),
    i36to50:toHexString(1),i53to67:toHexString(1),
    i69to73:toHexString(1),i75to83:toHexString(1),i85to91:toHexString(1),i94:toHexString())) 
    panel:setModulatorValuesFromData (sound02, "vstIndex", 82, 1, false)
         end
      end
    end

    I have a problem with sound01 variable that doesn’t work at all

    The last line is taken from the mopho “panel:setModulatorValuesFromData (unpackedData, “modulatorCustomIndex”, 0, 1, false)” and modified but not sure the first number is the index starting number . i don’t know what it is
    Any idea ?

    Ctrlr