DAW undo history bloat with my custom 2d slider gui component

Hi Jucers,

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!

1 Like

Hi @viadoe, have you or anyone figured out how to prevent a DAW from adding parameter changes to its undo list?

I don’t know about preventing the host from seeing parameter changes, but regarding the original post here, we issue a beginChangeGesture() for each of our X/Y parameters upon the mouseDown call, issue setValueNotifyingHost() for each change, then issue endChangeGesture() upon mouseUp. That makes sure that the whole set of changes is seen as one. I personally haven’t tested this in Ableton, but I don’t have problem reports about filled-up Undo stacks.

@HowardAntares thanks for your message!
@leleswam I never tried to make a work around for this and just sat on the behaviour but from what Howard has said it looks like I must be doing something wrong because I have implemented what he has written.

Well, I just tested in Live 11 Suite, and, like yours, I get a large number of items on their Undo stack, apparently, even though I don’t issue the endChangeGesture until I am in mouseUp. You might want to ask them about it. (This was with a VST3 version, by the way. Not sure if an AU version would behave the same or not.)

It seems that recently this issue has also occurred in other DAWs, like Reaper. So we have to find a solution to prevent the host from seeing parameter changes. Maybe someone on the JUCE team has a suggestion to what could be done?