Trouble with the 'setBit' command, could someone help

Home Forums General Programming Trouble with the 'setBit' command, could someone help

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #28706
    LukeYouth
    Participant
      • Topics: 6
      • Replies: 7
      • Total: 13
      
      switches1 = function(mod, value)
      range= panel:getModulatorByName("RANGE"):getModulatorValue()
      
      --low = 00 = 001 binary
      --mid = 01 = 010 binary
      --high = 02 = 100 binary
      waveform= panel:getModulatorByName("WAVEFORM"):getModulatorValue()
      --NONE = 00 = 00
      --PULSE = 01 = 01
      --TRIANGLE = 02 = 10 
      --PULSE AND TRI = 03 = 11
      chorus= panel:getModulatorByName("CHORUS"):getModulatorValue()
      --OFF = 00 = 00
      --CHORUS 1 = 01
      --CHORUS 2 = 11
      
      bi111= BigInteger(0)
      --range
      if range == 00 then 
      bi111:setBit(1,0) 
      bi111:setBit(0,1) 
      bi111:setBit(1,2)
      elseif range == 01 then 
      bi111:setBit(0,0) 
      bi111:setBit(1,1) 
      bi111:setBit(0,2)
      elseif range == 02 then 
      bi111:setBit(0,0) 
      bi111:setBit(0,1) 
      bi111:setBit(1,2)
      end
      --waveform
      if waveform == 00 then 
      bi111:setBit(0,3) 
      bi111:setBit(0,4)
      elseif waveform == 01 then 
      bi111:setBit(0,3) 
      bi111:setBit(1,4)
      elseif waveform == 02 then 
      bi111:setBit(1,3) 
      bi111:setBit(0,4)
      elseif waveform == 03 then 
      bi111:setBit(1,3) 
      bi111:setBit(1,4)
      end
      if chorus == 00 then
      bi111:setBit(0,5) 
      bi111:setBit(0,6)
      elseif chorus == 01 then 
      bi111:setBit(0,5) 
      bi111:setBit(1,6)
      elseif chorus == 02 then
      bi111:setBit(1,5) 
      bi111:setBit(1,6) 
      end
      hexData11= string.format ("F0 41 32 00 11 %.2x F7", bi222:getBitRangeAsInt(0,7))
      midi1= CtrlrMidiMessage(hexdata11)
      panel:sendMidiMessageNow(midi1)
      console (string.format ("F0 41 32 00 11 %.2x F7", bi222:getBitRangeAsInt(0,7)))
      
      end
      

      This is some lua i wrote hoping to set switches on my juno adapted from the ctrlr panel atom created.

      Its coming up with error ‘No Matching overloads found’ and im completely stumped!

      #28707
      LukeYouth
      Participant
        • Topics: 6
        • Replies: 7
        • Total: 13

        btw console doesnt work so im guessing ive coded something wrong, if anyone can help i’d be eternally greatful. Im definitely not a coder!

        #28715
        atom
        Keymaster
          • Topics: 159
          • Replies: 2945
          • Total: 3104
          • ★★★★★

          Can you paste the entire error message here ?

        Viewing 3 posts - 1 through 3 (of 3 total)
        • The forum ‘Programming’ is closed to new topics and replies.
        There is currently 0 users and 53 guests online
        No users are currently active
        Forum Statistics
        Threads: 2,495, Posts: 17,374, Members: 77,605
        Most users ever online was 12 on January 22, 2019 3:47 pm
        Ctrlr