Randomizer on 3 Grouped buttons, How?
-
@Lindon YES! :clapping_hands_medium-light_skin_tone:
Thanks, and yes just noticed that 3-4 change :)
Thanks mate
-
@DanH Sooooo.... As ever when trying to implement it in my existing project it tends to go out the window! :grinning_squinting_face:
I'm trying to add in a line to switch filter modes by storing the filter mode values in an array and referring to it in the callback. HISE hangs when I try to do this... I've commented in the script where this happens. Would be super appreciative for any help :)
HiseSnippet 1433.3oc0X8taSbDD+tjbHraCpTUUoJ0OrJe.NKLN1IFnRAD9OwlZUriI1PaEJBs9t01qx4cM2sFvJJR8QnOR7HwaP6r6smuKINNFCTUtHExty7a1e6LyMybz1m6PBB39Flo5NcLwv7as5LkIFVcHlxLZrug40sNrbq8OnoQkoiwAADWCSy0ehTpYpMLTOe3wUvdXlCIdKCiWvoNjmRGQEw61tzuQ87picIcoiRncwRMb3rpbO9DfIqak2XL14X7.RKrTs0rLLuVMWpf62QfEj.CyMpvcm1YH+srP8eAMf1yiHWTvnCXnvsqy8bkLVtqQ0gTO21Q23.CvJsiu+qGd++AqlTW5r8i8CemR.JFQR+g4ZKhdERRu7KO8LSPuMBo2Ms533SGKhkH412X0fIH98wPHHIsB00Xs+9ZVU4fFLQtQ3iI08gEyPXe+74yhtW97Y1ayzPXHPfdC1GUm5AJT.8HjJgH2.hnV+9DGg8VZQaIArM7fZ9mnJOua2CZ0AYyfPlKxGyb4iP849HFG4SvAbVljlumfcXnNOB8xHxAmQU9nwbFrvdqv7N3XxtYZz7eVDvcVUf6tp.KtUlitfOrI2kDHuj2OK5AYQE1IKp3QQNtVk6VFbZgv09vMSuYZJyixHn9SXNBJmg3JmUitxS2m6Y6DczYgywaBIS5SRqXrG2A6o89uPJAN4lXH7I2BB41PntXl8RquJAbORtw9TPPBLY1CjFZOZej8aBsyiPExn16jHeyrX3KS.9nbADg5urKHSPVrtNCwrADWaMkNMTYoKP9uoOcuzouDOtxerUF4oo8JUwdd8f5F1myaIYg1e2sbkJ01G0nU2ZGVub0ZnNUOrQ6tR4w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thing
local idx = btnRandom.indexOf(component); local idf = btnRandom.indexOf(component);
Why are you doing this twice?
-
@d-healey I'm not... HISE hangs when I change it to idf = FiltModes and click on the Main Workspace button... I think it should be:
local idx = btnRandom.indexOf(component); local idf = FiltModes.indexOf(component);
-
FiltModes contains numbers
[6, 7, 12, 4]
why would you try to get the index of a component from there? -
@d-healey Ah I see, so it needs to be .indexOf(whatIneedittobe...)?!
-
@DanH I don't know what you're trying to do so I don't know :P
-
I'm trying to change filter modes
-
I see, so use the index of the button (which you have in
idx
) to get the number of the mode you want, i.e.filtModes[idx]
-
@d-healey Genius
-
@d-healey Here Is A Quick Questions Sir
How To Show The Name Of Filters On Below Example:( It Sames As Above But I Gave It The Filter Names, So By Pressing The Buttons Label1 Updates)
HiseSnippet 1505.3oc0X01aZbDD9NaeVAZIpospR8aq3CIfhCuXSRqDIp7hgXTMXrgj1pHqzk6VfU9XWxcKNFYYo7SK+j5+f1Y26U6fwNjDolyR12ty7L6yNyb6Lq65vMIttbGM8D8mOkno+sF8lyDiqOFSYZs1US+NFGUsytGzVq17oXWWhklt95OWJUOwFZpm+42pgswLSRzTZZujSMI6SmPEQy1sxuSssahsH8oShocoJsL4r5ba9LfIqaTPaJ17D7HRGrTs0Lzz2rgEUvc5IvBhql9F03Vy6Ml+Vlm9uj5RGXSjCJp0CLj2zM41VRFKmUq9XpsU2fcrqFXktQ6+081++nQapEMb9H+v2oDfhPD2enu1xnWw3zqvsmd5wn2Fdz6dF8LcnSEQRjb6aLZwDDmgXHDDmVd5ps162znNGzfIxMAeBooCLHDQlmTnvVnGWnP1xoRBgAWA5TrCpI0FTnH5YHUBQtQDQigCIlhLo8EkVBHO7fZ+WnZune+C5zCkgAgLKjClYwmfFxcPLNxgfc4rrwM+.A6HOcdF5UAjCVi57IS4LXPlzd4cvxrUpjnE+rLfaup.2YUAVJc1iWfOTlD6J2loqQeyLrEZ+to2J388juuO+sndiI1CQMNDFtGcz3XiONvM2oZ+pfK1aw783oRlJIkYSYDzvY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hr9syMbCWfcYoM+jQ3lB8UTttLx70Ce+YC+fNR5r+5g2203v+GP1i3yDT1H35mNT3.eiNylziOywj.Dkwf9bg4fBGRnpwEjiUE6ILK0f+Ed7EVTNV2WXw.gZSvlN7Wa50Xi76m6nlA3DS8OZJgQa4XTXubFFExUPaBTK60llxCzdDv8EiY6U.yNq.lRq.lGuBXdxJf4WVAL+5RwHain5LAehWtILQ2FpFK00an5yPklp8eLsrL9E
-
@d-healey said in Randomizer on 3 Grouped buttons, How?:
I see, so use the index of the button (which you have in
idx
) to get the number of the mode you want, i.e.filtModes[idx]
How to Do This?
-
HiseSnippet 1586.3oc0XE0aZbDD9NaetAZcRSUUk5aq3gpCEhCXbRSqaTwfgDTMXrgD0pHqzk6VfU9XWxcKNFYY07Oq4+Seo+CRmc2i6NrwNNjDolyOD1Y2uY+1Ylc1YRKetCIHf6aXlpyjQDCyuxp8DlXPkAXJyn9NFl2v5fsatydMLJOYDNHf3ZXZt7ikyZlZEC02+9qkwdXlCIVjgwy3TGxtzgTQrzVk9MpmWMrKoCcXhUuYo5NbVEtGeLvjksxaLB6bDtOoIVtrkrLLWspKUv8aKvBRfg4Jk4tSZOf+Jld8OiFP65QjCJXzFTjVbMtmqjwRoFUFP8baM8DGX.ZoU74eY84+asZPcoQxisCesZBTLhj1CyktJ5UHI8xe8omYB5shld21psiOcjHdFI29Rq5LAwuGFbAIokdsFK82qZUgCqfIVeH9HRMeXPDB6GjOeNz8ymO6VqkFbCABzwXeTMpGrfBnGgTADq2mHp1qGwQXmIbpLyBXWbWhmb8S2J.QE9vQbFLvNidZEF4e2C9PM9CT4m1oydMairYfq1E4iYt7gndbeDii7I3.NKaxcoqfcfdMOB874uS53UXqxsVZz7+tJfarn.Ktn.2LS1CmisWF7GHOlYJSe4XrKZ2VYxM82OQ96c4uB0d.wqGp59vvmP6OHd77TYCtqVkOLG5mxgJ.N9BENbqHGRys6rM3LzzJz2Hmjx7nLBp2XlifxYHtxITui7T4y8rcldjxAal2XR1z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plO4kiILmoVwREe0KKsexP.YcJwi+gR6OF6cNqdY5HtG1+Z4QV95YFdGMpeUgMemUzgB8YTrtzy74Ce+dqPmNRZr+7g22zZ++GP1C3ikO2.MA6SgWarZNdXa30.GBPTFCJnGjAuPJgpFmWNVUUCg4pFHeJIbxBxwlgSVX5jFCwN97W3nqfSd+4FJI.mXp+C0RY0PNFEUzpkU90yaLDdz9ENNxDZ2E397wrwBfo3BfYyE.y8W.LOXAv7iK.lGdkXj0Ks8XAenN1DDzpptl.yppBpTgoF+GnfSLqN
This works, but the problem here is that every time you compile the last button in the array is selected, even when saving presets. @d-healey Do you know a way around this? I know in the Tabbed Interface video you can select which button to default to if none are selected but here it would be preferable to be able to save the state of the buttons.
-
@DanH Sir Thing Happens Here, Also I Made A Video In Other Thread, It Acts Crazy In Scriptnode And Instead Of Allowing One Node, It Unbasses All The Nodes.
Still Waiting For A Little Help Over This, Since This Kind Of Scripting Needs More Experience Or I Will Break My Laptop -
@DanH said in Randomizer on 3 Grouped buttons, How?:
This works, but the problem here is that every time you compile the last button in the array is selected, even when saving presets. @d-healey Do you know a way around this?
What about disabling save in preset and then enabling the one you want as default manually in on init?
-
@d-healey Then the buttons will never be able to be saved in presets... :/
-
@d-healey Not A Good Idea.
But I Guess It Can Possible To Trigger The Buttons Using A Hidden Knob Which Is Saved In Project
Or Vise Versa? -
I think in that case you'd need to use a sliderpack to save their values and restore them in the sliderpack's callback.
-
@d-healey Hmmmm.... sounds a bit much - I might go for a button that cycles through the array instead. I assume that's achievable - no doubt be in touch soon
-
HiseSnippet 1070.3ocsV8taaaCDmJwpHVatXcn66D4SxvYtxIscEHKXNwNYvXKIFycYCnnnfQhJlKRjBRTdwqHuB6YbXOA6MX6nnjkriZWhGF+h88+eGuSGuwwBWZRhHFYz70yinHiO0bxbtb5foDFGMZHx3wlmRRjzXrl0QyiHIITOjgwleqhgQyFnrye8MGQBHbWZIKD5BAyk98rPlrj639eGKH3DhG80rvJZ+79ibE7Ah.QJfmMMcP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