Correctly adding a Modulator Expression in Lua

Home Forums General Programming Correctly adding a Modulator Expression in Lua

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13218
    lfo2vco
    Participant
      • Topics: 26
      • Replies: 162
      • Total: 188
      • ★★

      I have an instance where I wish to add:
      modulatorValue + 32
      To the output of a uiSlider, however I DO NOT wish to add the expression in the forward expression box*. I wish to add to this line of the Lua method:
      byte23 = panel:getModulatorByName("DCO 1 LFO Mod Amt"):getModulatorValue()

      •Values sent to the Synth from the modulator are correct, however I wish to write the value + 32 to a string in Lua.

      Any guidance welcome, along with pointers to correct syntax.

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

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

        Well just add 32 then

        byte23 = panel:getModulatorByName("DCO 1 LFO Mod Amt"):getModulatorValue() + 32
        

        byte32 will be just 32 larger then the value of the modulator, byte23 is a normal number (integer), you can do whatever arithmetics with it you like

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

          Hahaha, it’s that simple! Damn.

          Cheers Atom, I think I need to take evening classes in Lua. However if anyone wishes to follow my posts then it will become obvious I am slowly generating an idiots guide to Ctrlr. ;~)

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

        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 98 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