LMMS / LMMS/lmms

`AutomatableModel`s of cloned tracks have duplicate IDs

Open
#8,527 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C++
Stars
10.4k
Forks
1.3k
Avg merge
2d 13h
Merged PRs (30d)
7

Description

### System Information

Windows 10

### LMMS Version(s)

1.3.0-alpha.1.1033+dff0fbd (win32/x86_64, Qt 5.15.18, GCC 15.2.0)

### Most Recent Working Version

_No response_

### Bug Summary

Cloning tracks is currently done by serializing the track to XML, and then reloading that XML as a new track. This causes the IDs of the `AutomatableModel`s stored in each track to get duplicated when a track is cloned, since both tracks come from the same XML data. This can cause issues in LMMS, because `JournallingObject` IDs are expected to be unique. For example, once the project is saved and loaded again, these duplicate IDs cause automation clips that are connected to a track and one of its clones to become disconnected from the cloned tracks, since all of those connections have the same ID and will therefore lead to only one of the tracks.

### Expected Behaviour

`AutomatableModel`s in cloned tracks should have unique IDs.

### Steps To Reproduce

1. Create a new track
2. Attach a knob of the track (for example, the volume knob) to an automation clip
3. Clone the track
4. Attach the same knob of the cloned track to the automation clip

If you now save the project as a .mmp file, you will be able to see the duplicate IDs that have been saved.

### Logs

_No response_

### Screenshots / Minimum Reproducible Project

[project.zip](https://github.com/user-attachments/files/31600324/project.zip)

### Please search the issue tracker for existing bug reports before submitting your own.

- [x] I have searched all existing issues and confirmed that this is not a duplicate.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue with a track, an automation clip, and a cloned track, then inspect the track-cloning path that serializes and reloads XML and the AutomatableModel ID handling. Save and reload the project to verify the cloned models retain distinct IDs and both automation connections remain attached.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.