Change Combo Box Items With Buttons
-
@Lindon said in Change Combo Box Items With Buttons:
@Tod-Slaughter "Change Combo Box Items With Buttons" . <- its the first step of this...
So empty the combo first and load the new items second. It works but it's ugly thanks man!
-
Anyone having the same idea, here's the solution:
HiseSnippet 1000.3ocsV8taaaCDmxNpsVaoqEXO.B9SJ.YAxZscCnXXN9eYdsI0XJKX.aEczRzwbQhTPhpKFE4UaXOJ6QXuAa2IIKo3ZmlXf3Obv7t62we2Ix63jXoGKIQFSzZc5hHFQ6y0cWHTy6OmxEjwCHZOV+XZhhEalqp2hHZRBymno07HTgVqcHY+92uuGMfJ7XUpHjyjbO1q4gbUk1IceEOHXD0mcJOrl2Oq6XOonuLPlB7ootMIh5cA8b1ITzsF5DsGLzmqjwtJphkPz1omzeg6b4eJx8+LdBeZ.CWzg3BAJW8HYfOxXTKo+bdf+jk4cBAhxjppPy7pvWpeL2mWpupZ7jLClUHpWOzZbSzqSc5Ye6omVM5sSN8dptqWLORUYA41moOV.enlQgOA0oUtujF+US89RvCg5fP5ErQwvhRDVuv1deymaau2K20XWC3CQhx78T3ytLbpbp7xNlem4R3myTf5Ho.VX0tzi1qh0kFFEvbYpMCtxkLzqAqymFqyJXSxLDRiRvM9WaeX68Ma2CE8Qw.TLDEiPwQse6FP6jg9GPmFiheDEuBEuFEGihSxPuqQUhbPBxRgJVFzmFDLENDaUYseOjqbQ.WvLmkJ7TbovrtcKubv6CrIHksGF8O.PlYZsTgI7CTUV4wszpMWwBSPNkUN1fwZ0lC9CIWX092Ds26i.bFtSVcP83lcERhqtVd5bi4oymHOcVWddejkN2sr7pRpJEmHUr2Hr1y3CFsLtxvbUSylsVaE0j.V7ZMiM8huIfVhzvor3kkkkNB29ud6E8M2dod2Ou76N0bTJFK3p2DwDapoCo3BGz9oYAqf+oxZ97jhlOYExdxKIber2SYckjQans9CzVNEX0P73hPzKUojhr..ycJuBTFgxIK2wH3rZDfe+73ATEE6mVjaP9FwhUbrTpMf8dXPUd20V5CXIWnjQYIeQ2Fh1itko+kka6e61cQ4hem2EJ1.AvSnDsuP+PidF8MFXLzXjwQjPJfSW6gfm706AoFWzuc0wMPERT2XpOWdTrLMZkx7caKbpsEjSqsE+S7l1hOdZFLSU5mFPUWePK95hBCv0iqMQCmZIR3pE0i78xz2aKcep9Dtxa954ai0vW3f38MeKdKyt5CmMi4opH6N5i9k6+GtP9IYphKN+XpJliGtOIMzEdZmGCXhPvBvVXZMv1C4qsw0XkwkI7yV7evuBicv0ZEF6rzHbswKV9thAI3qkdTlFfShrGM1Bd8Jr1rrmhtt8A1jP3QbuyyCKEeEv80iwYKv70aAlmsEXd9Vf4EaAluYKv7s2HF78yGlpjg4WS.ESFl0YVSanfBmxxNQR9e.qyRZSB
-
@Tod-Slaughter said in Change Combo Box Items With Buttons:
So empty the combo first and load the new items second. It works but it's ugly thanks man!
Yep it's ugly, that's why David's approach is better
With two comboboxes, you keep the last selection existing in the hidden combobox, so you can quickly switch between two samplemaps from different categories. That's the choice I would make... -
@ustk said in Change Combo Box Items With Buttons:
@Tod-Slaughter said in Change Combo Box Items With Buttons:
So empty the combo first and load the new items second. It works but it's ugly thanks man!
Yep it's ugly, that's why David's approach is better
With two comboboxes, you keep the last selection existing in the hidden combobox, so you can quickly switch between two samplemaps from different categories. That's the choice I would make...Combobox1.setValue(1); :smiling_face_with_halo:
-
@Tod-Slaughter yep, but this way you force the first samplemap of each category, it's an extra step that can annoy the user who wants to quickly switch between, let say, "D" & "J", but maybe it is not important in your design...
-
@ustk said in Change Combo Box Items With Buttons:
@Tod-Slaughter yep, but this way you force the first samplemap of each category, it's an extra step that can annoy the user who wants to quickly switch between, let say, "D" & "J", but maybe it is not important in your design...
If it's done the other way I have to show/hide multiple combo boxes and reload the sampler everytime a combobox is hidden and an alternative is loaded. Then I'd have to also change my randomiser script to accommodate all the extra combos. This is simpler and will probably translate to the preset system a lot easier too. The 1st line in my combos is an empty samplemap "category" heading.
-
@Tod-Slaughter ok I got it, but everything can be easily automated.
your randomizer can randomize the CB that shows up (by randomizing the selected button category), and the value insideI would be annoyed if, every time I select another category to see what's inside, the actual instrument is blanked...
-
@ustk said in Change Combo Box Items With Buttons:
@Tod-Slaughter ok I got it, but everything can be easily automated.
your randomizer can randomize the CB that shows up (by randomizing the selected button category), and the value insideI would be annoyed if, every time I select another category to see what's inside, the actual instrument is blanked...
I shall bear it in mind for sure. I hate instruments with bad design and buggy code. I'm not so good on code so I like to make everything crash proof as a priority and then the user design has to come second based on those choices. The coding you did above has already helped me start to optimise my stable but lengthy code and I can see how I could change things to your suggested flow. Maybe i'll change my mind.
-
in your code
" for (s in SampleSet) "
How does it work? Is it just a way to create a sub arrary using the first letter of the original array?
why not "for (w in SampleSet)"??
-
@Tod-Slaughter I am coding for less than a year, so my knowledge is very relative...
The letter here can be anything, even a word if you want...
the way I see this is:
- the function scans the array,
- attribute each element of the array to "s",
- then iterates in order to set the same callback to each array element
My description might not be accurate though...
-
@ustk said in Change Combo Box Items With Buttons:
@Tod-Slaughter I am coding for less than a year, so my knowledge is very relative...
The letter here can be anything, even a word if you want...
the way I see this is:
- the function scans the array,
- attribute each element of the array to "s",
- then iterates in order to set the same callback to each array element
My description might not be accurate though...
That's perfect buddy! thanks a bunch you made my day.
-
@ustk said in Change Combo Box Items With Buttons:
@Tod-Slaughter ok I got it, but everything can be easily automated.
your randomizer can randomize the CB that shows up (by randomizing the selected button category), and the value insideI would be annoyed if, every time I select another category to see what's inside, the actual instrument is blanked...
Would you get the combo (value) position from the previous combo and pass it to the new one to keep continuity when changing?
-
that's definitely an idea that is better than cutting the sound. But it is not so different than forcing the first element as you did (which is not a bad idea either)
-