# AudioParameterFloat parameter change notification

**URL:** <https://forum.juce.com/t/audioparameterfloat-parameter-change-notification/24823>\
**Category:** Audio Plugins\
**Created:** [October 26, 2017, 9:47am UTC](https://forum.juce.com/t/audioparameterfloat-parameter-change-notification/24823 "2017-10-26T09:47:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [October 26, 2017, 9:47am UTC](https://forum.juce.com/t/audioparameterfloat-parameter-change-notification/24823/1 "2017-10-26T09:47:28Z")

</div>

There is absolute no way to detect a parameter change in this class, also setValue() is private.  
(The demos are using some timer-based approach in GenericEditor, which isn’t very cool if you have hundreds of parameters)

Please move setValue to public, so someone can do this

```
virtual void setValue(float newValue) override
{
	AudioParameterFloat::setValue(newValue);
	// do stuff to handle parameter change
};

```

Or, if this is not an option, please add a virtual callback

```
public:
	virtual void valueChanged() {};

private:

	void AudioParameterFloat::setValue(float newValue)
	{
		value = range.convertFrom0to1(newValue);
		valueChanged()
	};
```

---

<div class="post-metadata">

**Author:** ![fr810](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/fr810/32/841_2.png) [@fr810](https://forum.juce.com/u/fr810)\
**Post date:** [October 26, 2017, 4:57pm UTC](https://forum.juce.com/t/audioparameterfloat-parameter-change-notification/24823/2 "2017-10-26T16:57:04Z")

</div>

OK I’ve added a `valueChanged` callback to the parameter classes on develop with commit [544d328](https://github.com/WeAreROLI/JUCE/commit/544d3284e3b637f79e3cfcc7fd875256281848e5).

---

<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:** [October 26, 2017, 8:22pm UTC](https://forum.juce.com/t/audioparameterfloat-parameter-change-notification/24823/3 "2017-10-26T20:22:45Z")

</div>

A useful addition to that could be to check if the value actually changed:

```auto
void AudioParameterFloat::setValue (float newValue)                      
{ 
    auto unnormalised = range.convertFrom0to1 (newValue); 
    if (value != unnormalised)
    {
        value = unnormalised;
        valueChanged (get()); 
    }
}

```

(edited variable hiding)

---

<div class="post-metadata">

**Author:** ![chkn](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/chkn/32/3862_2.png) [@chkn](https://forum.juce.com/u/chkn)\
**Post date:** [October 26, 2017, 9:31pm UTC](https://forum.juce.com/t/audioparameterfloat-parameter-change-notification/24823/4 "2017-10-26T21:31:24Z")

</div>

Cool, second newValue should be renamed 😉

Btw: in the meantime i returned to AudioProcessorParameterWithID because I prefer storing the parameter as normalized value for various reasons (mostly get/set integrity)

---

<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:** [October 26, 2017, 9:38pm UTC](https://forum.juce.com/t/audioparameterfloat-parameter-change-notification/24823/5 "2017-10-26T21:38:19Z")

</div>

Ah, silly me 😉  
I’ll edit that…
