setValue or setModulatorValue?

Home Forums General Programming setValue or setModulatorValue?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #83962
    human fly
    Participant
      • Topics: 124
      • Replies: 1070
      • Total: 1194
      • ★★★★

      what is the difference between setValue and setModulatorValue?

      i want a command that affects screen state of the modulator/component,
      rather than an active command that forces panel to send out the value.
      if you see what i mean.

      as a side issue:
      i have a button, off/on, that shows/hides a uiTabs.
      if i save my panel with it ‘on’, next time, it loads with no view of
      the uiTabs (not wanted).

      so now i’ve put a command in ‘panel loaded’ that forces the value to 0/off,
      but it doesn’t ensure the uiTabs view is correct. suppose i’ll have to
      ‘force’ that view as well. but i don’t want the panel to be sending out
      any data at this point, of course.

      #83968
      Possemo
      Participant
        • Topics: 14
        • Replies: 638
        • Total: 652
        • ★★★

        uiTabs is another awkward component. It behaves very strange in some cases. I avoid touching it unless there is no other way.

        To your first question about setValue – this is a quite complex topic with some surprises. I will explain my findings in the evening. I have to go back to work now…

        #83969
        human fly
        Participant
          • Topics: 124
          • Replies: 1070
          • Total: 1194
          • ★★★★

          uiTabs turned out fine, just had to specify/call the
          tab with setProperty.

          i make a little progress, slowly slowly. 🙂

          #83981
          Possemo
          Participant
            • Topics: 14
            • Replies: 638
            • Total: 652
            • ★★★

            yesterday evening I was too tired to turn on the pc. Here a quick answer:

            panel:getModulatorByName(“myName”):setValue(myValue, false, false)
            this one will send the changed value to the midi-out. Usually you don’t want that to happen so this is not the best way of setting a value. AFAIK the two booleans (false,false) do not do anything. Correct me if I am wrong.

            panel:getModulatorByName(“myName”):setModulatorValue(myValue, false, false, false)
            One of the three booleans will prevent sending the changed parameter to midi-out if set to “false”. I don’t remember which one it is, but it does not matter as the two other ones are useless. So set them all to “false”.

            panel:getComponent(“myName”):setValue(myValue, false, false)
            Yes this does work as well. But why should you use this one? Well first it won’t send the value to midi-out. That’s one good point. Much more important: I suspect that Ctrlr will handle this somewhat “multithreaded”. You will see it when you let move a modulator by script forth and back (think as a software LFO). It will work much smoother than doing it with “getModulator…”. But alas there are drawbacks too. Sometimes it will just not get the right value when trying to get it by ..getValue(myValue). Erratic behavior – sometimes it works as expected, sometimes not.

            #83982
            human fly
            Participant
              • Topics: 124
              • Replies: 1070
              • Total: 1194
              • ★★★★

              panel:getModulatorByName(“myName”):setValue(myValue, false, false)
              this one will send the changed value to the midi-out. Usually you don’t want that to happen so this is not the best way of setting a value. AFAIK the two booleans (false,false) do not do anything. Correct me if I am wrong.
              [quote]

              far be it from me to correct anyone ! 🙂 *however* 🙂 i’ve got a setValue working here with
              true, true – as suggested to me by … (? will have to check)
              seems to work, anyway (needs investigating further). this is how i’ve got it currently,
              having changed it from this version below:

              panel:getModulatorByName(“myName”):setModulatorValue(myValue, false, false, false)
              One of the three booleans will prevent sending the changed parameter to midi-out if set to “false”. I don’t remember which one it is, but it does not matter as the two other ones are useless. So set them all to “false”.

              ok, so i shall revert back to this (was first way that i was using).

              panel:getComponent(“myName”):setValue(myValue, false, false)
              Yes this does work as well. But why should you use this one? Well first it won’t send the value to midi-out. That’s one good point. Much more important: I suspect that Ctrlr will handle this somewhat “multithreaded”. You will see it when you let move a modulator by script forth and back (think as a software LFO). It will work much smoother than doing it with “getModulator…”. But alas there are drawbacks too. Sometimes it will just not get the right value when trying to get it by ..getValue(myValue). Erratic behavior – sometimes it works as expected, sometimes not.

              surprised by this one, as i didn’t think a ‘component’ could have a value property.
              i tend to think of the ‘modulator’ as the absolute, and the ‘component’ as the screen
              identity/display, something like that. cannot find anything there to do with ‘value’.

              anyway, i’ve just found something really strange with one of my sliders not
              displaying the modulator value correctly in the Utility page. have a feeling
              i might have to re-create that slider/modulator, if i’ve managed to create
              new properties somehow (can happen, and i’ve forgotten how to sort that out).

              (sorry, seem to have messed up with italics, thought i was being clever.)

              #83984
              Possemo
              Participant
                • Topics: 14
                • Replies: 638
                • Total: 652
                • ★★★

                Yea that’s what I meant – you can set the booleans to “true, true” – it does not matter as they don’t do anything.

                It looks like you can set and get the modulator value via the component. It does not seem to be another value dedicated to the component. As you said, a component’s value wouldn’t make sense. Unfortunately behavior is erratic but I managed to make some software LFO’s on the Moog Source panel using component’s setValue. For some reason the LFO timer-script runs much smoother with component’s setValue than with modulator’s setValue.

                AFAIK the component is a subset of the modulator. Every modulator “owns” a component and its properties.

                What do you mean by “Utility page”?

                #83985
                human fly
                Participant
                  • Topics: 124
                  • Replies: 1070
                  • Total: 1194
                  • ★★★★

                  ‘general’, ‘resources’, ‘utility’.

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