# Custom AudioProcessorValueTreeState attachment

**URL:** <https://forum.juce.com/t/custom-audioprocessorvaluetreestate-attachment/38194>\
**Category:** Audio Plugins\
**Created:** [March 21, 2020, 12:20pm UTC](https://forum.juce.com/t/custom-audioprocessorvaluetreestate-attachment/38194 "2020-03-21T12:20:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![thib03](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/thib03/32/12750_2.png) [@thib03](https://forum.juce.com/u/thib03)\
**Post date:** [March 21, 2020, 12:20pm UTC](https://forum.juce.com/t/custom-audioprocessorvaluetreestate-attachment/38194/1 "2020-03-21T12:20:14Z")

</div>

Hello,  
I have a question about listeners. I’m trying to attach a custom UI component to a plugin parameter. When the component’s value is modified by the user, the former sends the new value to the plugin parameter (using a broadcaster -\> listener event). Now I would like to implement the communication in the other direction, which means using the AudioProcessorValueTreeState::addParameterListener method to link the parameter to my custom UI component. But as the parameter sends a new value to the UI component, the latter will get changed, and therefore broadcast its change back to the parameter, resulting in an infinite loop… There is probably a simple workaround to this situation. Can someone help me?  
Best

---

<div class="post-metadata">

**Author:** ![t0m](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/t0m/32/16413_2.png) [@t0m](https://forum.juce.com/u/t0m)\
**Post date:** [March 27, 2020, 9:21am UTC](https://forum.juce.com/t/custom-audioprocessorvaluetreestate-attachment/38194/2 "2020-03-27T09:21:52Z")

</div>

We’ve got something in the pipeline that will make customising attachments much easier.

However, until that becomes available, can you simply `return` early if the new value is the same as the old value?
