# Attaching other parameters to a ValueTreeState

**URL:** https://forum.juce.com/t/attaching-other-parameters-to-a-valuetreestate/29482
**Category:** General JUCE discussion
**Created:** [September 18, 2018, 9:52am UTC](https://forum.juce.com/t/attaching-other-parameters-to-a-valuetreestate/29482 "2018-09-18T09:52:16Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![DaveH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daveh/32/4924_2.png) [@DaveH](https://forum.juce.com/u/DaveH)
#### Post date: [September 18, 2018, 9:52am UTC](https://forum.juce.com/t/attaching-other-parameters-to-a-valuetreestate/29482/1 "2018-09-18T09:52:16Z")

</div>

Hi, I have a bunch of sliders / combo boxes and buttons attached in my plug-in editor, and everything works great with the processor. I’m currently building an EQ with XY coordinates that I want to associate them with the processor. I don’t mind adding X & Y separately, but I want to know how I use the same kind of AudioProcessorValueTreeState setup.  
It only has ‘ButtonAttachment’ & ‘SliderAttachment’ etc? Is there a way of doing this with non standard components? It seems obvious at first, but I can’t find it, sorry.

---

<div class="post-metadata">

### Author: ![daniel](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daniel/32/790_2.png) [@daniel](https://forum.juce.com/u/daniel)
#### Post date: [September 18, 2018, 9:59am UTC](https://forum.juce.com/t/attaching-other-parameters-to-a-valuetreestate/29482/2 "2018-09-18T09:59:22Z")

</div>

There are two ways to do it, the easiest is to create two invisible sliders, that you connect using the SliderAttachment, and then you can use the two [Value](https://docs.juce.com/develop/classSlider.html#a40ceae44fd94f912fc10d8a5803b9b01) objects of the sliders as model of your drawing, connecting to it using [Value::referTo()](https://docs.juce.com/develop/classValue.html#a127b52830b5d62b478224b670d9e78f9).

The other is by hand using the [AudioProcessorValueTreeState::addParameterListener()](https://docs.juce.com/develop/classAudioProcessorValueTreeState.html#a350478cad727aa6ceac20e1c933446fc)…

Hope that helps

---

<div class="post-metadata">

### Author: ![DaveH](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/daveh/32/4924_2.png) [@DaveH](https://forum.juce.com/u/DaveH)
#### Post date: [September 18, 2018, 10:02am UTC](https://forum.juce.com/t/attaching-other-parameters-to-a-valuetreestate/29482/3 "2018-09-18T10:02:38Z")

</div>

Thank-you for the swift answer I’m going to try the addParamterListener route as it seems a little cleaner to me.  
Thanks again.  
Dave H.
