Reply To: add a parameter to : getModulatorValuesAsData() method

Home Forums General Programming add a parameter to : getModulatorValuesAsData() method Reply To: add a parameter to : getModulatorValuesAsData() method

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

    Ok solved that

    I’ve build custom scripts for anyone that wants use it
    call modulators by vst indexes
    -GetVstMods( 0, 100, false, “memo1”, 0)
    ———–first byte,lastbyte,valuesMapped=true,blockName,blockID
    LoadVstMods( “memo1”, 0, false)
    ————callBlockName,firstModulatorByVstIndex, valuesMapped=true
    possible to use up to 100 memory blocks

     function GetVstMods(firstByte, endByte,MappedOrNot,typeName,typeID)
      if firstByte ~= nil then 
      if firstByte >= 0 then
        if endByte ~= nil then
        if endByte >= firstByte then   
           if MappedOrNot == true or MappedOrNot == false then  
              if typeName ~= nil then
                  if typeID ~= nil then 
                  if typeID >= 0 then
                     na = MemoryBlock()
                     for h = firstByte,endByte,1 do 
                         md = panel:getModulatorWithProperty("vstIndex", h)
                         if MappedOrNot == true then 
                         else a = md:getValueMapped()
                              a = md:getModulatorValue()
                     end
                         if a >= 16 then 
                            b = MemoryBlock(string.format("%x",a))
                       else b = MemoryBlock(string.format("0%x",a))
                        end     
                            na:insert(b,1,h)
                     end 
                 end
                 end
             end
          end
       end
       end
     end
     end
            if myBlocks == nil then   
               myBlocks = {}
           end
            if myNames == nil then   
               myNames = {}
           end
         myNames[typeID+1] = string.format("%s",typeName)
         myBlocks[typeID+1] = na 
       --console(string.format("%s",myBlocks[typeID+1]:toHexString(1)))
       --console(string.format("%s",myNames[typeID+1]))
    
    end
    function LoadVstMods(nametoGet,startByte,AreValuesMapped) 
        for p = 1,100,1 do 
              if  myNames[p] == string.format("%s",nametoGet) then 
                  console(myNames[p])
                  console(string.format("%s",myBlocks[p]:toHexString(1)))             
                  if startByte ~= nil then
                  if startByte >= 0 then
                     if AreValuesMapped == true or AreValuesMapped == false then 
                        panel:setModulatorValuesFromData(myBlocks[p],"vstIndex", CtrlrPanel.EncodeNormal, startByte, 1,AreValuesMapped)         
                    end
                 end
                 end
             end
        end
    end

    Working
    If that helps

    Ctrlr