I have run into an edge case problem which may have been answered before but is hard to search for since it’s quite specific, so sorry if this has been answered before elsewhere.
I am making a plugin with a custom 2dSlider gui component for my plugin interface.
Basically the same one here
I am using the APVTS to handle automation of my other gui components including the position of my 2dSlider.
I’ve built the 2dSlider the recommended way by making 2 slider and 2 SliderAttachment s, one for each axis.
The problem I’m having is that when you move the slider position the undo history of Ableton becomes extremely bloated.
I wouldn’t post on here if it wasn’t really bad, as soon as you move the cursor around a little you have hundreds of undo events in Ableton and loose any chance of getting back to where you were previously.
My first hunch was that
beginChangeGesture for the respective parameters was not being called since the sliders never get the
mouseDown call in my component.
However I’ve just coded a whole 2dSlider class and 2dSliderAttachment class to do this safely and it doesn’t fix the problem.
What I believe is going on is that Ableton collects parameters changes into a new undo event from that parameter’s first
setValueNotifyingHost function call.
And so, if you call
setValueNotifyingHost for a different parameter is starts to create a new undo event for that parameter.
I’ve recreated this behavior by only moving the slider position along one axis which means it only changes one of the sliders values and it creates a one undo event for the whole gesture.
But as soon as you move it linearly along both axes, moving both sliders, your undo history represents hundreds of little changes for each parameter/slider movement on it’s own axis.
So my question is what would be the best way of still being able to automate my 2dSlider position in a DAW but not having it’s movement clog up the undo history?
I know I can still save it’s position in the APVTS externally for preset and such, but I’d quite like to automate it like any normal slider.
Thanks in advance!