Preset selector in plugin and/or host?


Is it safe to assume that all hosts can call getParameter and setParameter with any number of presets, e.g. thousands of presets (on VST/Windows, VST/Mac and AU/Mac)? There are hosts out there which have non-functioning preset selectors. I haven’t checked Logic 9 yet, but in earlier versions they supported a maximum of 255 presets. And then manufacturers had to implement their own preset selectors in the plugin if it had more than 255 presets… causing a few problems as the plugin’s preset selector needs to be in sync with the preset selector in the host (e.g. to avoid problems such as the host loading a saved project with the wrong preset etc.).

So what’s the recommendation with juce? That I implement and supply an additional custom made preset selector in the plugin? And if yes, then should the host be notified when the user changes a preset from the plugin’s selector? And how are recursions avoided? E.g. the plugin changing preset and notifying the host which also changes the preset and then notifies the plugin about the change.


I’d recommend always to assume that hosts are rubbish, and take the safest approach. So yes, if there are hosts that, for some idiotic reason, can’t cope with more than 255 presets, it’s best to stick to that.

But really, if you’ve got thousands of presets, you probably need to have a more advanced selector anyway, don’t you? Showing the user a pop-up menu with 1000 items isn’t going to win any design awards!

For recursion, again, you’d need to assume that the hosts will be too stupid to cope with that, so put in a quick recursion safety check.

Thanks Jules.

I called it “program”, not “preset”, but it’s the same thing.

int getCurrentProgram()
void setCurrentProgram (int index)

Yup, sorry I found it 1 minute after posting.