Need Help with Combobox Function
-
Hey folks,
I've got 4 combo boxes and 4 LFOs, and I want to use the same combo box to switch off the LFOs and change their shapes. No Idea, and Too tired!
Here is the snippet:
HiseSnippet 1321.3oc6Y0saaaCElx1pHV6Gzf0qFv.HxUNHYt1wdcaH6G23DWXr7iQUV2FBJJnknsHhDopDURLF5yvtXuT6x8nr2fsCkjsja8RbbRyBvrtvvGd34nOd34imio6EHrnggh.jV4iG4SQZent4HtzosCgwQc2Eo8w5GPBkz.bxP6LxmDFRsQZZEelZ.sxkPwO+02uCwkvsnYCgPuPvrn6y7XxrQ605GXttcH1ziYd4lcyVcsD71BWQDfmh50P9DqSICoGRTSqfNR6A6Yyjh.SIQRCQZk1QXOxzQbNOY9ufEx56RUB0QlfiRFtiv0VgX02QscXt18FutCQHM8dYQghIQgGoe.ylMY7rnwCiUfyrHe7Pqvzvq3Tvqdd3UKG7lAjzxAoRIPZUcSq.luLSiBOefdWNr4Lf.g87PIYtnB+dA81BXFbYUOxozNAfvDKpzrVsMwMps91FFFO9w3m55hUyNP3FZ.aEgR7YDXiWDwkcfME72hatMFiyoCLY+AhPPyIub6oGusW+wiaXLPDfqv.wZaiY3uIymf3FartwuhMLJm5rSXuDlXbZX0gT4AB6HWBDVqr19cNBOQbM7FfK2n95.7KGar5MlX730LXdagmufCBUVC9ZewNhKlxxL6pFplc7xuMw0sOj7UQvU5SkBS0phWuQ8NMXbWFmhGDwsjLAGOyoWwZLD1DhMtQTX4ZTFh2GRo1Xo.aRkXXoEhOZv.bTHiODSIVN3X71WbwlXB2FSbCEfVJlIUFY4P3CoXoCUYK1zg3SCqBX5MFwPqbNPcnPROhWI98B5wuspAClotT76RCloZE6M3xLrBOxqOMH+pVMQHkdZdxC924I4owVIap4lnf2kyjG4SSkyH50mAqBklU.7qRoHDlpLlc8vT103TDDyVQtFKVGEuDxeXG5Z5hst4tnwM2EMmgK9wt6RjD0oNoAHHn4SCjL0di1tzyfivSNCpr9tzvSkB+3HXZRMRak4LFdQ9JCixK3Q.c5ZO.9JSR8f2KV+nNcLLA1kwwALCSx4FluNhDPMdNPFDdnyY1RmLe7KsbnrgN4Jy7csPWaLtEJFG12WwWiD78G2WwWyD7so1cC9d2pjP84w0GxWzV0oRpB3DpopTppFxCYxQ44Duck7RyWk7q37m4Dtqp2iIsblMdKLC7BT2223MsunOReuACnVxLvVRuyOeoMAcqCkURfxmp+LWQehaV.DN7BPEMownOKUcV+B3ISn9kzE6eNucw5O2cwpUbtaKr9k2VXo2Wcpdmle+IuyVS3sJi7Zz5e9.5pIPVWGZmJMBNU+l0uZPtCyW3RBT56DPecDkakS+JsTYKcyR1Z8as9IxYTn2Xuz5qS7z9zgv6L+HGSgyhglhsxmXZ5IDRGngwoyAeTq8EB+83DHhXm2I8bHgp18fNcmxMfaOVj767Z6JrNMuxtC4h.ZRKj4GucTnT3MdAD+6yLkT+3dIzNQ+IMqBOC1P84W2F9nwQ2NxnabpvrRd0JL2YuprhIa+p7i640SRP7jDx6IH9pnaasjtsjtsjtcWQ2ZrjtsjtsjtcWQ2Ztjtsjtsjt8e90oT7+mWmxyEQRfne.QFvT2L2gQdlhn.KJfDNm5FptstBJdYhbMkbL4lxsiE9a3IUYckrVpx5iUdm7N7HVAhWYk9eVAabqDOBrt4w+mgk0OPIimb+8550pVC4wrYuxxREt+75HzrsYqEvlFKfMMW.a9hEvlmr.17kKfMe0kZi5RodZDbVeBUDFn2dImxqMoDiVQz+.QSr3KA
Any help is much appreciated :folded_hands:
-
@Natan what's wrong with
if (value == 1) { LFO.dothething etc } if (value == 2) { LFO.dotheotherthing etc } etc etc
-
@DanH Thanks Mate, Just took a nap, and My brain came back to Life :) LOL
Do you see A Better Way to do it?
HiseSnippet 1323.3oc6Y0saZbDEdVfMxr8GEqlqpTkF4qvxoDvPSakqaIFahP01fBttMxxJZX2AXj2cFxtyZaTUeF5qTeD5SQutuAsmY2E1gFhMlXmZEAWXyYN+LeyYNeyb1k19BaZPfvGYj+nQCoHiO1ryHtbP8ADFG0bWjw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z6eNuM8Nbta50H6U0ja4ErI2b26Zxcdqi+r2XqI38HaapD2pwvzzDZDMISMUKokuNJF7LRrgBWhuB3M7ouNjxs0zuRMUERyzBrZ+dselbNEZe1K4tyIQZeZeXN0G4HJb9Jz2rsdwXGOgPNfw6Occ2ipsuPLbONAxBN5Ao8.Rfp8MnevoBCD1iDwOJXcn00yzU1rOW3SiaITe75gARg23EPziv0QRGF0mfwIlOsZQ3SuMT+8aqC+oRqaG4axAYku5s+LycUppRXxVtpl3d3cBwnbRg2+in75nRatjJsjJsjJcaPkprjJsjJsjJcaPkptjJsjJsjJcm9pIx9g8ql3EhPIPVOfH8Yp2f0ggdcfm82lByNmScUu7ZiLJtUrbIkbDAkxchD9G3ShxxJYiDkkGq78xb3Qr8EuxN4mKB1fVIZDXcyi945xadfRFO4cdaZVpXIjGyg8JaaUJ9KKiPy1mMW.epr.9TcA74qV.ed5B3yWu.97MWoOpWpyyBgyqiobv.s2K9jZiIWSXjE8u.EerL2
local idx = AllCmbs.indexOf(component); if (AllCmbs[idx].getValue() == 1) { AllLfos[idx].setBypassed(true); } else { AllLfos[idx].setBypassed(false); }
-
You don't need to use
AllCmbs[idx]
inside the callback, you can use thecomponent
instead - but it's not needed here at all.And you don't need to use
.getValue()
you can usevalue
So you can shorten your callback to this.
inline function onAllCallbacksControl(component, value) { local idx = AllCmbs.indexOf(component); AllLfos[idx].setBypassed(value == 1); }
-
@d-healey said in Need Help with Combobox Function:
local idx = AllCmbs.indexOf(component); AllLfos[idx].setBypassed(value == 1);
EDIT:
All good Here, There was a typoAllLfos[idx].setAttribute(AllLfos[idx].WaveFormType,value-1);
-
@Natan said in Need Help with Combobox Function:
AllLfos[idx].setAttribute(AllLfos[idx].WaveFormType,value-1);
@d-healey Sir, David, How do you assign Painitng to each Combobox Value?
I Made this so Far! and no glory here
HiseSnippet 1556.3oc6Y81SaaDF2FhqHdioVs9pIMoSr23HRo1jztMwZaJAbEZPIpg10JDp5h8kjSXemq8kVhp5mg8UZubube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esDiqqiQ10SLVSCi+Y3mZL9EIXbwrqZnJVFCvELiGe1Qh2u9EppCqmUXFVCdHN4j3km.0e1AYSr5OoHZhU+YG+L4O8mb+IV8mcnwTn9+IQ8m9ZlvEbytWj9sdUW0Ok.b5zHW0TccRdDSNPu13U1UgurP7VlMYRmdiGiyMFLBks+XfwzFHVzb6NcnNxb.Nuo8y93zsft5WHQ8eq4i7DsId4FJ3.J.IzjtF9tTx42AFObCUOmV79qKaKdAW5V7LJbdszUcJaoa9qcszcYii+lS4Zh9DlsMhg6VIvzzD5VJ0RMReSUuXfsIKP3QBUzsCoupOk6nQeg5pHjcxCvp+G0UsRzIsUBcIsKsKnS8UNfBkNgl6bzCFa4KDPm.7tiF2c656JDAayIfUvUWHM6QhTWcGZEXDw.h8.QxK9nAzb0Q5D2oKWDRSZGPe8F8ijB+rGf3WXQKIMH9NhFO27t0VE90YY0++bC3u02+pY9jTHq5469m6RGkphDF5xUwDWCOSHAkCC79eDkWTpzZWzoUWcoRHzrToYoRe9lJs9rToYoRyRktJRkpMKUZVpzrToOpuZhBed+pIR9VJc2iHCYp2d4i662B582gBZmq9TLp2n4bpbqj4UTyiSPob23Im.+RIVUM2HkX0LheRzgOwIT7RmzuMJ3fVHdE34lG+woKZtmZN9zeuCjOyk8RGmQE0oXbsokw0mVFqMsL9CSKi2cZY7GmVF+oKlQ0K+4g8g55IolHzdM2NohtwviSLJf9WDcqcRA
-
@d-healey said in Need Help with Combobox Function:
Sir David, I Try to use multiple colors for each Combo Options.
I mean Combobox has 6 color options, and so combo 2, 3 and 4
Each Sin, tri, ... Will change the Color! -
@Natan said in Need Help with Combobox Function:
6 color options
But there's only 4 in your array, so there should be 6?
-
I got the idea, You are the best
I used the inline function for Cmbs to change the bgColour :folded_hands:
inline function onAllCallbacksControl(component, value) { local myColours = [0XFFffffff, 0XFFFF0000, 0XFF0000FF, 0XFF000000, 0XFFbdd8e1, 0XFFe6004a]; local idx = AllCmbs.indexOf(component); AllLfos[idx].setBypassed(value == 1); AllLfos[idx].setAttribute(AllLfos[idx].WaveFormType,value-1); panels[idx].set("bgColour", myColours[value]); panels[idx].changed(); }