Changing parameters range

In my vst i use just one slider, who changed his range. It is slider wavetable position. When wavetable has for example 22 subtables, range is from 1 to 22, and so on. Slider range i can change when loading different wavetable. But. How i can say DAW propertly values to modulate this slider? I try to used AudioParameterInt, but as i know audioParameter create parameter only once in constructor, addParameter(parameter = new AudioParameterInt(“wtPos”, “WTPOS”, 1, 22, 1)); Mayby who nows how to resolve my problem? I`ll be wery appreciated.

1 Like

You cannot change the range after creation for a good reason: the host sees all parameters normalised and cannot know, which range you mean, when jumping in the timeline for instance.

What you can do is to map the parameter yourself to your preset specific range…

I get around this by holding multiple mappings inside of the parameters, and keeping everything 0-1 generic to the host, then swapping the mapping internally based on settings. You miss out on the nice host specific stepped or whatever automation lanes, but my personally feeling is that it’s worth it. The other option is to have multiple parameters for each type, and then hide/show the actual parameter based on the range.

The downside to this is that automation data might not be read correctly if the range changes after the data has been written.

Yeah, it definitely takes some consideration. The way I handle that is to make sure all the applicable ranges generally share the same direction & slow, so that if the mapping changes the automation generally moves the knobs in the same manner. Of course, changing the mapping my require tweaking the automation lane, but from my experience a musician would be aware of that.

I figure than changing range of parameter is nonsence. So i create wavetablePosition Slider with range from 0 to 100. Than i simple convert value from slider to sub wavetable pointer. For example if i have multitable with 33 subtables, than value of slider equal 0 convert in 1 subtable, value of slider equals 100 convert in 33 subtable.