Home › Forums › General › Programming › combo or slider content
- This topic has 16 replies, 3 voices, and was last updated 10 years, 5 months ago by Hecticcc.
-
AuthorPosts
-
May 9, 2013 at 3:28 pm #8812
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
endI’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.
May 9, 2013 at 4:15 pm #8824This 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
May 9, 2013 at 8:56 pm #8838Tried 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
May 9, 2013 at 9:07 pm #8839The point was to use “\n” as a separator between values
combo:setProperty ("uiComboContent", "Combo entry1\nCombo Entry2\nCombo Entry3", false)
May 9, 2013 at 9:41 pm #8840Ahh
This is always under my nose !!
all day i tried coocking something…ah ah
Thank you
May 10, 2013 at 2:14 am #8843is 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.
May 10, 2013 at 4:21 pm #8852Why are you switching to edit mode ? This is not something you should be using for normal panel usage.
May 10, 2013 at 4:42 pm #8855This 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 ?May 10, 2013 at 7:46 pm #8863I’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….
July 3, 2013 at 1:08 pm #10567Hello
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
endend
mod1 and pm1 is the modulator i want change value content
That’s working
July 3, 2013 at 2:06 pm #10574You 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()
July 5, 2013 at 9:47 pm #10649Atom 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”)July 5, 2013 at 10:01 pm #10652yes
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.
October 5, 2013 at 11:36 am #13898Hello 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 onlyI’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
October 7, 2013 at 12:22 pm #13944If 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 😉October 7, 2013 at 7:00 pm #13955Yes
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 refreshedIf 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.October 8, 2013 at 12:22 pm #13976If 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. -
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.