Using LUA to change the moderatorMax value

Home Forums General Programming Using LUA to change the moderatorMax value

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #607
    moroccomoose
    Participant
      • Topics: 5
      • Replies: 6
      • Total: 11

      I am Using LUA to change the parameters of a modulator according to a value in a drop down list (See my other thread!)

      The sysex I am trying to modulate is:

      F0 42 30 6d 10 41 06 00 MS LS f7

      where the max MS LS can equate to be either 2000, 4000 or 8000 depending on the drop down list value.

      I want to change the min and max values of the modulator to 2000, 4000 or 8000 depending on list selection.

      The max value appears twice on the modulator/component settings tab, once in the Modulator section and once in the component section.

      I can change the value in the modulator section using the code:
      [code:1hdeyxj5]panel:getModulatorByName("DelayTime"):getComponent():setPropertyInt("modulatorMax",2000)[/code:1hdeyxj5]
      But I can not change the value in the component section, it is the value in the component section I need to set to get the desired behaviour.

      Is it possible?

      Also, there does not seem to be an equivalent variable for ‘modulatorMin’ even though I can adjust the min value in the tab. Am I correct?

      As always, thanks in advance!

      Cheers.

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

        if you fetch the component:
        [code:2eph5sph]
        panel:getModulatorByName("DelayTime"):getComponent()
        [/code:2eph5sph]
        then don’t set modulator properties on it, set the components properties, if it’s the slider it will be the max for the slider. The properties belong to their owners, modulator/component, see the Utility tab and the XML to see what’s where. If it starts with "modulator" it’s the modulator if it start with component or ui it’s for the component. Changing the modulator properties directly is a bit tricky so it’s best to set the component properties from LUA.

      Viewing 2 posts - 1 through 2 (of 2 total)
      • The forum ‘Programming’ is closed to new topics and replies.
      There is currently 0 users and 91 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