Home Forums General Programming Correctly adding a Modulator Expression in Lua

This topic contains 2 replies, has 2 voices, and was last updated by lfo2vco lfo2vco 4 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #13218
    lfo2vco
    lfo2vco
    Participant

    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.

    #13220
    atom
    atom
    Moderator

    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
    lfo2vco
    Participant

    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. ;~)

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Comments are closed.