How to store interface object/button value/state without updating Live's undo history. How to avoid "Undo Change" in Live undo history.
I'm just posting this so that next time I google how to do this, I'll hopefully be able to find my own forum post LOL. And maybe this helps you too.
How to store interface object/button value/state without updating Live's undo history
In the device I'm working on, I have a few live.text buttons that I'm using to expand/collapse bpatchers. I wanted the state of these buttons to persist when the Live set was saved/loaded and when the device was duplicated or copy/pasted. But I didn't want the Live undo history to add a new entry every time one of these buttons were clicked.
The solution?
Set the live.text attributes:
- Parameter Visibility: Visible
- Undo When Visible: Off (0)
You'll also likely want to set:
- Visible to Mapping: Off (0)
How to avoid "Undo Change" in Live undo history
When I load my device in Ableton, I'd get a random "Undo Change" added to the undo history after the "Undo Insert Device". I don't want my undo history plagued with useless entries so I went on the hunt.
I ended up finding the culprit in my audio routing subpatch. You know the one from the cycling 74 example that populates umenu's with audio channels and tie in points? Well, I went in there and found all live.observer & live.object and set their "Use Persistent Mapping" attributes to off.
Now the useless "Undo Change" was gone. Success! But just to be sure, I tested:
- Duplicating the device (Ctrl/Cmd+D, Ctrl/Cmd drag and drop)
- Copying and pasting the device to the same channel/to a different channel
- Reordering/adding/deleting/grouping/ungrouping/renaming channels in Live
- Saving and loading the Live set
- Renaming channels
The umenu's selections and audio routing persisted every time.
I hope this helps you out!