Creating presets for some parameters

Hello, I’ve been developing an audio plug-in for the past few months, which means I’m relatively new to JUCE and object-oriented programming.

So far, I’ve managed to get it working fine, but I’m struggling trying to get a preset system to work. I’ve read tutorials and documentation, but I haven’t found an answer for creating presets that only update some of my plug-in’s parameters and not all of them.

Getting an XML file that then replaces the state of my apvts would also overwrite every other parameter if I’m not mistaken, but I want my presets to only alter a select group of parameters. I tried to hard-code it by having the preset combo box index value go into a switch statement that then changes each parameter’s value using apvts.getParameter().setValue(), but it’s just not working. Anyone knows how I could start to solve this?

suppose your current patch is always defined entirely by apvts.state. use DBG(apvts.state.toXMLString()); in different parts of your code to debug the state of your plugin. now say you want to have an alternative version of that state. you could just make a copy of it and modify that copy. every parameter is represented as a child of that juce::ValueTree. so you just modify the value for only group of the parameters you want to change. then you can write that to disc into an xml file or something. later when you reimport it it could replace the current state

Got it, that makes a lot of sense, thanks!