AudioProcessorValueTreeState vs CachedValue

Am trying to figure out whether to use AudioProcessorValueTreeState or cached value for my standalone app. The data model has a nested hierarchy with several layers (4-5) of depth. So far, from what I can tell, the following is the case: (and please correct me if this is not so!)

  • AudioProcessorValueTreeState with the various connections works well for handling individual parameters. Reading the values directly from the parameters is fast and does not hit the ValueTree; writes to the ValueTree happen less frequently, about roughly 20 ms (if something has been updated recently) to 50-500 ms (if not).
  • CachedValue provides fast access to the cached value, with the tradeoff that updates happen on the message thread.
  • Both of these provide a way of safely decoupling shared values on the audio and message threads. (since reading from a ValueTree on the audio thread is not a good idea)
  • AudioProcessorValueTreeState seems better suited to systems with flat hierarchies, since it stores all of its parameters in a flat format.
  • AudioProcessorValueTreeState is better for creating plugins (which need AudioProcessorParameters for automation)

Any recommendations on the circumstances where one is better than the other? Do you find that one is more responsive than the other for controls?

I also looked at ValueTreeSynchroniser, but this seems to be for communicating between two trees on the message thread.


I am also interested in this. I am making a DAW-type app and was originally designing it to use a single AudioProcessor at the top level. I want to add tracks and add instruments/effects to those tracks, having a hierarchical ValueTree with flat sets of parameters for each instrument/effect at the nodes. I would like to avoid using a separate AudioProcessor/AudioProcessorValueTreeState for each “node” since it seems like unnecessary overhead. What I want is behavior just like AudioProcessorValueTreeState, but with the ability to add/nest onto the same internal ValueTree and have different parameters reference different descendants in that tree.

Even if I did want to put up with the overhead of a separate AudioProcessor/AudioProcessorValueTreeState pair for each instrument/effect/etc., I’m not sure if I could easily do that with a root ValueTree?