Strange behavior with Presets
-
Hi everyone! Have a problem: When I change presets with buttons - everything works great and presets are changing. But at the same time if I trying to change presets by clicking on themselves - nothing happens. In this example I have 2 presets and each of them has panel with button or slider in those panels. So you can see: if you click on buttons (preset_1 and preset_2) - panels are changing and button and slider too. But if you will click on presets in preset_browser - panels won't change and presets too. There you will find Engine.loadUserPreset function - I use this one for handling articulations (like in the video from David Healey).
HiseSnippet 1656.3ocsXslaaaDDdksoSnZRSBPN.D9Wx.tNhOzqFzF4mEFI1QvJIs.FFozjqjVXpcEHWYG2BCDzSPOB8nzqRA5AH2f1YIoDWJQRY65xe3jcd9MyNyti1N9LGbP.yGUR8cWMBiJ8HktWQ4C1YfMghNXWTokUpg19pQ1AAXWToRK+CBFkTWAE98kWsssmM0AmPBg9.i3feCYHgmPsS6WS77121E+NxPIosZefCitCyiM1W3rpnQ1Nma2GejsPrkTPkVcOWBm42kaywAnRqrMy8ptCXWRij+Cj.xYdXwBcTWvPQj2m44JPrfJZmADO2NSB1.DXkNIg9xQg9yUNj3RlROIE7zPFZIZHmOJsTZ3sbJ3oKCupRvKCHURBRqDAomoz0wmLhmvQfmuR4.JG62yFR6xPIRVzRG9PEscXfHT9lCsOGuuOrXpJUpWs5FZveV+kk0J+hoecroXufxvtQ.W6BaesQgDz9NsSlXr9X9NrgiXTXQk0BUPes02Pq.9Fqs9oR1LjlEXyBTwZM.YynRshUolPkjPY6wbNnujQhnXjqUh4m1yQD0WfR5Ypj4hzxLS0rVjZVohzcr87NC5WBz5wlXifxDpGgh05Ml5vILpFiFGdBK6y7p3Lwra.91aLd8x+ZYM3izSqRLAwxHhhunRgSzOcy.nxdhY39fjubpPwHby.L+CBiTomsWfr.g+mqC+KXMbY0bs7DMu9kkyMZzKJZTukgxrPMVpp2f.1H+.dxVchDUmmqU1biZEJDjQk94JR5Lcgagh77BpwEnLVqIUcUlcq.rzBZuJxJFIVQpWN5K+p.y6yxfY1fytJHysAqhryB1nVTyip5dz9PzuoGy188AX+N9XPtJqo+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odUKwCWAc+7qjGv5d6U2toP7YJcHbmAYiwkx.iv3a+efw32p7wJ60qG1gm.vUT1+m9+4gIQGyFKtv3PatOAJCTfim5Bmj6fAuSE+tMfVokDWYDstpXsHCzEScCW7OvWLScw5RwL0mvDMz1wm8QmnwlEuF5CCo.XhF9PvpJGJVqMcdYEkpaVEMj3R9niiH7+FXtkr0w3Nni4cPGq6fN0tC5T+NnSi6fNMKTGwahu0XNaXT6.Pnydg2pWpzdTanxJrJD8ufO+nqz
And I think this is why I have a problem in my exported plugin: my compiled plugin, when I open it in DAW - always starts with preset which was the last one before I saved and export VST/AU and that's what I wanted. But, when I save my project in DAW with my plugin with a different preset from initial preset, close any DAW and re-open it after - it sounds like it should - with the last one used preset, but all controls, knobs, wallpapers etc are from initial preset.
-
@nouslou Please :crying_face:
-
@nouslou Seems to work here
-
@d-healey no, it's not what I meant) I try to explain this: for example I have 2 articulations, each of them has they own panel with different controls. When I choose one of the articulations (by pressing a button) - there is callback on the button, which trigger Engine.loadUserPreset and then show or hide panels. When I only pressing the buttons - all works fine, presets are changing and panels are changing too. BUT when I click on the presets themselves in the preset browser - they almost work, sample maps are changing, stored values on knobs too, BUT panels (with controls related specifically to this articulation) don't. And I can't understand at all why?I changed my code 100 times but it still doesn't work properly.
HiseSnippet 2435.3oc4ZstaabbEdWIu1docbrSSA5eJvBghB5HEQxcot35VDJpKFBIxlPT1oEtFNC2cH4TsbG1YGJKk.gFzmj9HzGA+Vz+lGA+FzdlYuvYWtjhTNNHAU+PVy4Lm47c9lyYtstEi5hCCoLMcyStXHVS+tFsuHf2e29HRf1g6ooeOi2P38aNhyoAg1ZMuXHJLD6ooqu7SD8Q27FZxed2WzD4iBbwiEoo8BJwE+UjAD9XosZ7kDe+CPd3SHCT5c8FG5RC1k5SGA3YYipZCQtmh5geJRzskLzzu49dDNk0li33PM8azj5cQ69z2DD0+WPBIc7whF0zZCCTj3Cn9dBDKjpsaehuWqj3NTSS2n0XVX4HV3SMNh3QRkOlMtuTg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4q4n59eaj6+Di1bH+a.jEE+JsRLTxH44a+w36rMbt+NavRdxmHl7sJc6sMZNB3HVVo+6FRWsy.HWNiuhQ9w3gXDGllUr41MN9X4Qgxa0uugLo3DFx8TfJTiwmEfAtlqFi6xnggcgvQNVgppZMh0SvUikbL9LLKLqLwpM8QAhGqJ4FCOODKleItGg3LRlC5I8R0SPx43kLhZWKWa6bscx0tdt1ajq8l4Zu031o28IJyH8dL4e4maNeu7CLPxcQU5YSRuwWvRJ4J9Ro27mceozeArBYlOlqYBFaSDD+9AmAUdfDAF+Di8vcQi74IRytJvQz.5v9z.ha17bHusWOLSE6EFP6v4PYl5U6NF1wFEhUOKzWQBfcqxV9tPbQsE9CaW370uwHBtVhktr9k6NaK++M6rMKJ5dw6qYAdjw+Y3b3cMjq9ZI1r7mR3cLcj3FJoa9.6P0F1U1EqtOkvuwsql7f3swAdxF+W3mXk0Ds0iUVKmRaUKsyozQ0RmDkZtIf.RXi+a4sYzWFtF.Dfxit4Caz5qlbGBmZPDL2xv0mBqtns3ldSCFkNXB5wnP5Yo2K5Qa.xkQec7+sWDg5skR.jFH+ucjowQh1VouusgQ00qpM.1b60tthpqOG1qrXaruF13bMro90vlMtF1r40vlstF1r8LsQbthcFwoChVsEDzZ+njK88SStVV6+M7zXBO
Could you pleeease check this snippet of my code?:folded_hands_light_skin_tone:
-
@nouslou Post a minimal project, it's no good posting a snippet in this case because I don't have your presets
-
@d-healey you mean this project in .zip on any file hosting?
-
@d-healey it's only 3 mb :)
-
@nouslou said in Strange behavior with Presets:
@d-healey it's only 3 mb :)
That seems to be some project related to tabbed interfaces...
I mean make a new minimal project - minimal = the project only contains the essential components required to demonstrate the problem.
-
@d-healey here it is, David
-
In your
changeTab2
callback you are hiding/showing panels and also changing the preset.When changing preset through the preset browser though you haven't set anything up to hide/show the panels. The
UserPresetHandler.setPostCallback()
might be the way to go.https://docs.hise.audio/scripting/scripting-api/engine/index.html#createuserpresethandler
https://docs.hise.audio/scripting/scripting-api/userpresethandler/index.html#setpostcallback -
@d-healey I totally don't understand how to implement this) I wrote this code. But every time I choose preset manually or with buttons - Hise crashes. Where should I exactly put it?
const var presetHandler = Engine.createUserPresetHandler(); presetHandler.setPostCallback(postPreCallback); inline function postPreCallback() { Panel3.showControl(true); Panel4.showControl(false); }
-
@nouslou I think you need to use a real function here (not an inline one).
presetHandler.setPostCallback(function() { // Your code here });
-
@d-healey and how can I declare each preset? Because for every specific preset there are different panels need to show/hide . I mean how to tell Hise for example : if I choose this preset_1 manually from preset Browser - do this, but when I manually from preset browser choose preset_2 - do that
-
@nouslou There are a number of ways to do that. If you are using buttons to hide/show each combination of panels you could set the buttons to saveInPreset = true, then it would happen automatically (but not if those buttons are also changing presets because that would create an infinite loop). Another way is to hardcode it in the postCallback, but this could get ugly quickly. Another way is to store the configuration in an external JSON file and read it in after the preset loads and do the hiding/showing then.
-
@d-healey Thank you so much, David, as usual!! I managed to solve this