# Suggestion: Host using range.interval in AudioProcessorValueTreeState Parameter::getNumSteps()

**URL:** https://forum.juce.com/t/suggestion-host-using-range-interval-in-audioprocessorvaluetreestate-parameter-getnumsteps/18448
**Category:** Audio Plugins
**Created:** [July 16, 2016, 5:43pm UTC](https://forum.juce.com/t/suggestion-host-using-range-interval-in-audioprocessorvaluetreestate-parameter-getnumsteps/18448 "2016-07-16T17:43:05Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![john\_henry](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/john_henry/32/560_2.png) [@john\_henry](https://forum.juce.com/u/john_henry)
#### Post date: [July 16, 2016, 5:43pm UTC](https://forum.juce.com/t/suggestion-host-using-range-interval-in-audioprocessorvaluetreestate-parameter-getnumsteps/18448/1 "2016-07-16T17:43:05Z")

</div>

Hi there,

we wondered, why the automation values in the host didn’t snap to the interval value of the NormalisableRange of the Parameter. This seems like an easy fix in AudioProcessorValueTreeState.cpp in Line 66 getNumSteps().

`int getNumSteps () const override { if (range.interval > 0) return (((range.end - range.start) / range.interval) + 1); else return AudioProcessor::getDefaultNumParameterSteps (); }`

Maybe we’re missing something…  
Johannes

---

<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: [July 19, 2016, 10:05am UTC](https://forum.juce.com/t/suggestion-host-using-range-interval-in-audioprocessorvaluetreestate-parameter-getnumsteps/18448/2 "2016-07-19T10:05:56Z")

</div>

Sounds like a reasonable change. I’ve added this to the develop tip. Thanks for the suggestion.

---

<div class="post-metadata">

### Author: ![john\_henry](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/john_henry/32/560_2.png) [@john\_henry](https://forum.juce.com/u/john_henry)
#### Post date: [July 21, 2016, 11:19am UTC](https://forum.juce.com/t/suggestion-host-using-range-interval-in-audioprocessorvaluetreestate-parameter-getnumsteps/18448/3 "2016-07-21T11:19:04Z")

</div>

thanks! and thanks for spotting the missing cast 😉
