combo or slider content

Home Forums General Programming combo or slider content

Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • #8812
    zeoka
    Participant
      • Topics: 73
      • Replies: 466
      • Total: 539
      • ★★★

      Hi

      I would replace content by LUA

      gr1 = panel:getModulatorByName(“01Group”):getModulatorValue()

      if gr1 == 0 then

      tr1:setProperty(“uiGroupOutlineColour1” , c4:toString(),false)
      tm1:setProperty(“uiComboTextColour” , c4:toString(),false)
      patmod1()
      mod1:setProperty(“uiComboContent” ,”off=0 on=1 Latch=2 Toggle=3 One Shot=4″,false)

      elseif gr1 > 0 then

      tr1:setProperty(“uiGroupOutlineColour1” , c1:toString(),false)
      tm1:setProperty(“uiComboTextColour” , c1:toString(),false)
      color1:setProperty(“uiGroupOutlineColour1” , c4:toString(),false)
      mod1:setProperty(“uiComboContent” ,”Gr.Latch=0 Gr.Latch=1 Gr.Latch=2 Gr.Latch=3 Gr.1Shot=4″,false)
      end
      end

      I’ve tried several things ( propertySting, (),{} or “” per value,etc…) and i can’t get the correct form to type contents.
      I’ve searched in panels too….

      Please help

      PS the special charaecters that define the combo content value ( 0 & # 10 ) are not shown here

      • This topic was modified 10 years, 10 months ago by zeoka.
      #8824
      atom
      Keymaster
        • Topics: 159
        • Replies: 2945
        • Total: 3104
        • ★★★★★

        This is how i fill a combo with random 10 values

        alterCombo = function(mod, value)
        	myCombo = panel:getComponent("myCombo")
        
        	comboContent = ""
        
        	for i=1,10 do
        		r = math.random(127)
        		comboContent = comboContent..string.format("NUM:%d\n", r)
        	end
        	myCombo:setProperty ("uiComboContent", comboContent, false)
        end
        
        #8838
        zeoka
        Participant
          • Topics: 73
          • Replies: 466
          • Total: 539
          • ★★★

          Tried hours to understand and see what this gives

          the 10 of i=1,10 is the number of values of the combo
          you use random operation and display the result as a variabe you use %d , r (in this case) but i can’t apply to my needs
          i need to put 5 names or 5 others not numbers. I fail to adapt.Thank you anyway
          What define in LUA the number of values in the combo content??

          I can put a text in a combocontent with LUA but not several corresponding to nb of values

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

            The point was to use “\n” as a separator between values

            combo:setProperty ("uiComboContent", "Combo entry1\nCombo Entry2\nCombo Entry3", false)
            
            #8840
            zeoka
            Participant
              • Topics: 73
              • Replies: 466
              • Total: 539
              • ★★★

              Ahh

              This is always under my nose !!

              all day i tried coocking something…ah ah

              Thank you

              #8843
              zeoka
              Participant
                • Topics: 73
                • Replies: 466
                • Total: 539
                • ★★★

                is there a way to refresh by lua?

                the combo needs a click in edit mode to remove (no selection) text after “switching” content and displays current value . Or if i use the device knobs to refresh..

                Damage i’ve worked hard , there is 49 methods crossed and all work very fine for 49 modulators.
                Must i change direction ?

                I believe the issue is because the combo don’t change value so it is re-init….

                • This reply was modified 10 years, 10 months ago by zeoka.
                #8852
                atom
                Keymaster
                  • Topics: 159
                  • Replies: 2945
                  • Total: 3104
                  • ★★★★★

                  Why are you switching to edit mode ? This is not something you should be using for normal panel usage.

                  #8855
                  zeoka
                  Participant
                    • Topics: 73
                    • Replies: 466
                    • Total: 539
                    • ★★★

                    This is for the info

                    Just a click on the combo in edit mode do something that display values after it has changed content. What could replace this mouse click ? In LUA ?
                    it is a good way to change dynamically contents ?
                    i would do same thing with ressources or visible names but i think it will be same problem …
                    Any suggestion ?

                    • This reply was modified 10 years, 10 months ago by zeoka.
                    • This reply was modified 10 years, 10 months ago by zeoka.
                    #8863
                    zeoka
                    Participant
                      • Topics: 73
                      • Replies: 466
                      • Total: 539
                      • ★★★

                      I’ve tried to change by other modulator the visible name and ressources of a modulator

                      -visible name works well

                      – ressource needs i place the mouse cursor above the modulator to refresh image

                      content ,visible name and ressource changed by another modulator are features that could improve strongly the fx’s section of my panel by reducing the number of linked modulators….

                      #10567
                      zeoka
                      Participant
                        • Topics: 73
                        • Replies: 466
                        • Total: 539
                        • ★★★

                        Hello
                        it was simple finally to fix the value content changing :
                        patgr1 = function(mod, value)

                        gr1 = panel:getModulatorByName(“01Group”):getModulatorValue() if gr1 == 0 then
                        mod1:setProperty(“uiComboContent” ,”off\non\nLatch\nToggle\nOne Shot”,false) mode01:setModulatorValue(pm1,false,false,false) if gpm == 0 then
                        tr1:setProperty(“uiGroupOutlineColour1” , c4:toString(),false)
                        tm1:setProperty(“uiComboTextColour” , c4:toString(),false)
                        patmod1()
                        end
                        elseif gr1 > 0 then
                        mod1:setProperty(“uiComboContent” ,”Gr.Latch\nGr.Latch\nGr.Latch\nGr.Latch\nGr.1Shot” ,false) mode01:setModulatorValue(pm1,false,false,false) if gpm == 0 then
                        tr1:setProperty(“uiGroupOutlineColour1” , c1:toString(),false)
                        tm1:setProperty(“uiComboTextColour” , c1:toString(),false)
                        color1:setProperty(“uiGroupOutlineColour1” , c1:toString(),false)
                        mod1:setProperty(“uiComboTextColour” , c1:toString(),false)
                        end
                        end

                        end

                        mod1 and pm1 is the modulator i want change value content

                        That’s working

                        • This reply was modified 10 years, 9 months ago by zeoka.
                        • This reply was modified 10 years, 9 months ago by zeoka.
                        • This reply was modified 10 years, 9 months ago by zeoka.
                        • This reply was modified 10 years, 9 months ago by zeoka.
                        #10574
                        atom
                        Keymaster
                          • Topics: 159
                          • Replies: 2945
                          • Total: 3104
                          • ★★★★★

                          You can refresh (repoaint) any component by calling it’s repaint() method (you can do that on the entire panel too, but remember this will cause a major CPU spike)

                          example

                          panel:getModulatorByname("modulator-1"):getComponent():repaint()
                          panel:getEditor():repaint()
                          
                          #10649
                          zeoka
                          Participant
                            • Topics: 73
                            • Replies: 466
                            • Total: 539
                            • ★★★

                            Atom thank you for the tip
                            euh.. your first line is for one modulator and second for all the panel ?
                            or the second execute the function ?
                            I surely do something bad because repaint() is not working
                            tried -mode01:getComponent():repaint()
                            -mod1:repaint()
                            mode01 is panel:getModulatorByname(“Mode01”)
                            mod1 is panel:getComponent(“Mode01”)

                            • This reply was modified 10 years, 8 months ago by zeoka.
                            • This reply was modified 10 years, 8 months ago by zeoka.
                            #10652
                            atom
                            Keymaster
                              • Topics: 159
                              • Replies: 2945
                              • Total: 3104
                              • ★★★★★

                              yes

                              do not repaint the panel unless you need to, it will cause major CPU usage.

                              it works, but it depends what are you repainting and if the data to repaint is valid. those calls are JUCE native, not implemented by me.

                              #13898
                              zeoka
                              Participant
                                • Topics: 73
                                • Replies: 466
                                • Total: 539
                                • ★★★

                                Hello Atom ,

                                I’m rebuilding fx’s at uploaded panel ; i’ve removed the shit ( all layers for each fx’s types , all “baby” modulators ) It’s more clean now but i have troubles :
                                -When panel is loaded : incorrect visual
                                -Content mod is not changing when : -the nb of values is the same
                                -the value of mod is not changing when i change only fx type (Already posted for this issue : repaint() was not working )
                                I can refresh by movin the knob only

                                I’ve done hard work for this basic visual effect and don’t know now how to fix

                                Please Can you check in my dl section “RA1.33” file ?

                                3 Scripts fxtables,fx1select,and fx2select(but not applied content change on it yet)
                                in fxtables() there is tables used by the 2 fx’s scripts and some specific to each (set positions)
                                Like i said the fx implementation is complexe in RA and i can’t do simple things because i change each property component differently.
                                Can you tell me what’s wrong and what i can change ?

                                Thank you Atom for the time you past to try to understand user problems

                                #13944
                                Hecticcc
                                Participant
                                  • Topics: 25
                                  • Replies: 160
                                  • Total: 185
                                  • ★★

                                  If i understand correctly you have modulators that need different value mappings for a selected fx type?

                                  You can try resetting the value content of the modulators before assigning new ranges/values.
                                  IE setting the propery to an empty string (so the old values go away) before you assign the actual data it should hold (for the selected fx-type in your case).
                                  This happens very fast, you don’t even see it glitching 😉

                                  #13955
                                  zeoka
                                  Participant
                                    • Topics: 73
                                    • Replies: 466
                                    • Total: 539
                                    • ★★★

                                    Yes
                                    If i do that i will lose the value of modulators ?
                                    the fx type will set mods props blank then their values will be set to 0 before i set new prop contents ?
                                    Ex fx1 is on reverb : “damping” is 000 to 127, value is set to 100
                                    delay : “polarity” is positive-negative , value will change to 1
                                    note i don’t have problem in this case : the RackAttack reacts as same way and this
                                    change the value and the range is not the same : even if “damping” is “001”(1) , “polarity” will be “negative”(1)
                                    The problem is
                                    fx1 is on delay : “feedback” is 000 to 127 , value is set to 64
                                    mod delay : “feedback” is -100% to +100% (0 to 127 too) , value stay the same then the content is not refreshed

                                    If i change the content to ” ” before “-100% to +100%” i will have a value to 0 ? I will try and set the mod value to original values after. this will render my script more complicated
                                    On the Dasfaker virus panel , labels are used to do this thing it’s better but i need to reduce component nb to the max and don’t have so much space
                                    Here are quasi-finished scripts (i found them big )

                                    Thank you for the tip Hecticcc

                                    Attachments:
                                    You must be logged in to view attached files.
                                    #13976
                                    Hecticcc
                                    Participant
                                      • Topics: 25
                                      • Replies: 160
                                      • Total: 185
                                      • ★★

                                      If you set the content to “” before assigning the actual values for uiFixedSliderContent it resets the value to the minimum.
                                      You can use a variable to store the value temporarily and use that one to set the modulator’s value correctly.

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