set modulator opacity through Lua

Home Forums General Programming set modulator opacity through Lua

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #657
    msepsis
    Participant
      • Topics: 219
      • Replies: 732
      • Total: 951
      • ★★★

      I don’t see it in the API docs, maybe I’m missing it. I’m looking for an alpha property so I can adjust the transparency of a modulator through Lua.. I seem to recall an older example panel that did this through the animator? I don’t see any transparency or alpha properties in setPropertyInt or setProperty… any help appreciated.

      Thanks!

      Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

      #4547
      msepsis
      Participant
        • Topics: 219
        • Replies: 732
        • Total: 951
        • ★★★

        *ping*

        Please advise.. is this not possible yet? I was playing with setPropertyColour with no luck.. I’d like to be able to "dim" a combobox if a corresponding knob is rotated. similarly I’d like to dim an imageSlider if a combobox is set.

        many thanks!

        Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

        #4548
        dasfaker
        Keymaster
          • Topics: 80
          • Replies: 793
          • Total: 873
          • ★★★

          If your panel has a background, you can draw in the background the knobs and combos "dimmed". When you need to display the "dimmed" knob, you simply hide the modulator and the "dimmed" version is on view. Note that in this way you can’t use the modulator when is dimmed.

          If you don’t have a background, you can make a a resource of the "dimmed" knob with only one frame, and when you need to deactivate this knob, you must change the image resource of the modulator to this one-frame resource and set it’s maximum value to 0. To activate it again, restore it’s original resource and max value.

          Those works if you need to deactivate some modulators from another one (let’s say you have a combo and when you choose the first option of the combo, a modulator became inactive, and any other option make the modulator active).

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

            I had a alpha property for components but i removed it, i’ll re-introduce that in the next nightly.

            #4550
            msepsis
            Participant
              • Topics: 219
              • Replies: 732
              • Total: 951
              • ★★★
              "dasfaker":1pbno554 wrote:
              If your panel has a background, you can draw in the background the knobs and combos "dimmed". When you need to display the "dimmed" knob, you simply hide the modulator and the "dimmed" version is on view. Note that in this way you can’t use the modulator when is dimmed.

              If you don’t have a background, you can make a a resource of the "dimmed" knob with only one frame, and when you need to deactivate this knob, you must change the image resource of the modulator to this one-frame resource and set it’s maximum value to 0. To activate it again, restore it’s original resource and max value.
              [/quote:1pbno554]

              Thank you Atom for your reply here and the ideas.. great work arounds (fun to find workarounds sometimes to current limitations) I’ll wait until you actually add an alpha property to the modulators, that would be ideal.

              Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

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

                You can use the ComponentAnimator

                if you attach this to a slider with values 0-127 this will set the alpha of the MODULATOR to the value of the slider
                [code:1ekq07vv]
                setAlpha = function(modulator, newValue)
                anim = CtrlrLuaComponentAnimator()
                mod = panel:getModulatorByName("MODULATOR")
                rect = mod:getComponent():getLuaBounds()

                anim:animateComponent (mod:getComponent(), rect, newValue/127, 0, false, 0, 0)
                end
                [/code:1ekq07vv]

                #4552
                msepsis
                Participant
                  • Topics: 219
                  • Replies: 732
                  • Total: 951
                  • ★★★

                  kick ASS. Thank you, Atom!

                  Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

                  #4553
                  msepsis
                  Participant
                    • Topics: 219
                    • Replies: 732
                    • Total: 951
                    • ★★★

                    Is using CtrlrLuaComponentAnimator still the way to do this in 1180?

                    Its working but it (or possibly something else?) seems to cause the modulator to be very laggy since the latest updates.

                    Instead of verbally explaining how I was using CtrlrLuaComponentAnimator, here is a very simple panel that demonstrates:
                    https://www.dropbox.com/s/bvwe7dt4fx1rb … st.bpanelz

                    It works but I’m just wondering if ComponentAnimator is still the preferred method to simply set the opacity of a modulator.

                    Monstrum Media | Music, Sound & Software Design, Chicago / San Francisco listen

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

                      It will work as usual the old API is still there. The new methods will be documented when i finish them. I changed the compiler options a lot as you noticed by the binary size so i might have broken something, need to test the build some more.

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