Help on ValueTree parameter freezing issue

I saved a 10MB wave raw file into a property in my AudioProcessorValueTreeState so it can get recalled next time, then I found when I change a parameter which is attached to a valueTree SliderAttachment, the cpu is really high and have freezing issue, but if I remove it from the AudioProcessorValueTreeState, the issue is gone. So I assume it’s the file size making it hard to sync value, but how do I improve it, any suggestions? Thanks in advance!!!

store the file somewhere on the users pc and save the location as a string in the apvts

Thanks, this is definitely one option, but I want to remain the portability, like letting user share their daw project with ease, so I want this imported file to be included in the daw project. Any suggestion on how to achieve this?

If your project file format doesn’t need to be XML, you could gather all the files in a zip file (and even give it whatever suffix you like to make it more proprietary). I’ve seen this kind of stuff done. Actually on MacOS you see such bundles all over the place.

I know it’s not as convenient, but on the other hand, storing large amounts of raw binary/numerical data into an XML seems like a bad idea.

Ok, the main issue I came across is the DAW like Reaper calls the getStateInformation() function really frequently, if I save the file into a valuTreeState, then even when I turn a knob, the saving time will be huge for a audio plugin, which leads to loading and freezing, so I’m really curious how I can maintain the portability for the daw project and improve the efficiency, I’m not sure how zip file can help on the efficiency side.

Btw I did saved the audio data into memoryblock instead of XML, hearing it can be more efficient.

Ah, sorry. Didn’t realize you were talking about 3rd party DAW like Reaper. I assumed you were exporting the ValueTree as XML from your own software. Yes i would imagine just about any format to be more space efficient than XML. I suppose there’s still quite some overhead if the MemoryBlock is serialized in a portable way.

I don’t know any tricks to save 10MB of plugin state into a generic DAW efficiently. Maybe someone else does?