Chowdhury-DSP / chowdsp_utils

JUCE module with utilities for ChowDSP
Other
236 stars 24 forks source link

PresetManager query #535

Open 7sharp9 opened 4 months ago

7sharp9 commented 4 months ago

Hi, Im just looking at your PresetManager implementation anddd Im wondering about some of the details like why there is a set of state from the presetmanager and another from the AudioProcessorValueTreeState?

Is this to do with preserving dirty presets outside of normal state?

Thanks! Dave.

jatinchowdhury18 commented 4 months ago

Just to be clear, I imagine you're referring to the chowdsp_presets module, not chowdsp_presets_v2 (v2 doesn't use the APVTS)?

The main idea is that I wanted the "current preset" to basically always have a value, and for the plugin state to always be "relative" to the current preset (which helps to manage the "dirty" state). Usually when starting up the plugin, the programmer would manually set the current preset (usually to an "Init" preset), and then from there, the plugin will always save/load the preset as part of its state. This does end up with the state sometimes being loaded twice (once from setting the current preset and once from loading the saved APVTS state). I haven't had any issues with that, but if it's causing problems, there might be a more "elegant" solution that we could find.

7sharp9 commented 4 months ago

While debugging ChowTapeModel, it did seem to take a while to save and load presets but thats not necessarily any issue, could just be debug slowing things down a lot. I was just trying to get to grips with the code. As that part was BSD license it made sense to use it rather than write my own, and I was just tryign to be clear on everything it was doing.

7sharp9 commented 4 months ago

It woudl be nice to reduce unnecessary loading as my plugon has a few areas that take a while to init, i find the ChowTapeModel takes a while to load on first opening the DAW, not sure if its preset related though as Ive not profiled it yet :-)