# Add or remove ValueTree parameters while running

**URL:** <https://forum.juce.com/t/add-or-remove-valuetree-parameters-while-running/42221>\
**Category:** Audio Plugins\
**Created:** [October 14, 2020, 8:31am UTC](https://forum.juce.com/t/add-or-remove-valuetree-parameters-while-running/42221 "2020-10-14T08:31:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![StijndK](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@StijndK](https://forum.juce.com/u/StijndK)\
**Post date:** [October 14, 2020, 8:31am UTC](https://forum.juce.com/t/add-or-remove-valuetree-parameters-while-running/42221/1 "2020-10-14T08:31:31Z")

</div>

Hi, I am working on a plugin in which I want the user to be able to add or remove voices. Every voice has a voice editor with some slider components that I would like to add a valuetree parameter for when the voice is created. However, after initialising the tree.state and trying to add a parameter later on, I get this jassert:

> All parameters must be created before giving this manager a ValueTree state

Is there a way to be able to add parameters to a valuetree after setting the AudioProcessorValueTreeState.state? Or would the only workaround be to add a certain amount of parameters beforehand?

Thanks!

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [October 14, 2020, 10:58am UTC](https://forum.juce.com/t/add-or-remove-valuetree-parameters-while-running/42221/2 "2020-10-14T10:58:10Z")

</div>

I can’t answer specifically as I haven’t used the AudioProcessorValueTreeState class much, but in general it’s not possible to dynamically add new plugin parameters. So it looks like the thing to do in this instance to make sure you have enough to begin with, and then assign them accordingly.

---

<div class="post-metadata">

**Author:** ![StijndK](https://avatars.discourse-cdn.com/v4/letter/s/848f3c/32.png) [@StijndK](https://forum.juce.com/u/StijndK)\
**Post date:** [October 15, 2020, 4:42pm UTC](https://forum.juce.com/t/add-or-remove-valuetree-parameters-while-running/42221/3 "2020-10-15T16:42:37Z")

</div>

Allright I’ll do that, thank you!
