Can you control module presets with buttons?
-
@Lindon Thanks a lot for that. Really helpful script!
-
@Lindon Awesome mate! I've been trying to do this for a while. You hit the nail on the head there. Thanks man!
I'm experimenting now... I want to try and find a way to make a combo box drop-down menu that will do the same thing. So we could have separate drop downs to change the reverb or delay presets and not have to change the main preset. I'll have a play now and share the code if I manage to work it out!!
Any advice to make the task a bit quicker though would be mega appreciated. This is my first time back in HISE properly coding since December so I'm a little rusty
-
There's a function (if I'm not mistaken) that is intended for that purpose. You directly save and restore a module's state. I've never tried it though...
https://docs.hise.audio/working-with-hise/menu-reference/edit/index.html#create-base64-encoded-state -
@ustk That could be pretty useful. I'll have a play around with it. Cheers mate.
-
@SteveRiggs Just tested and it works nicely. Although I can a benefit only for "behind the scene" modules. If the module is controlled by UI, there no need for this function as you have to restore the controls anyway as @Lindon did above, and so is the module consequently.
-
@ustk Awesome. I'm still trying to work out how it would be done using a combo box with a list of presets inside instead of buttons
-
@SteveRiggs I haven't had a look to it but my guess is (if you have multiple values to recall):
- Store the values in a 2D array
- Recall them with the ComboBox index and a for loop
-
@ustk Thanks man! I had a feeling it would be an array of some sort. I'll try and work out how to set up a 2D array and a loop :)
-
@SteveRiggs A quick tip:
You don't necessarily need a for loop, in fact it depends on your structure...array = [[val1, val2, val3], [val1, val2, val3], [val1, val2, val3]];
then read it like this in the comboBox CB:
module.setAttribute(attribute, array[value - 1][0]); module.setAttribute(attribute, array[value - 1][1]); module.setAttribute(attribute, array[value - ][2]);
-
@ustk Ahhh! It's starting to make sense now. Thanks mate. I'll try a few things and see how it goes :) Much appreciated!