Remove song import global automation
Completes step 2 from #403
I've also removed the global automation <track> node from the templates. I noticed in default.mpt that there were <object> nodes, but no related id in any other nodes like there would normally be if there was a pattern connected. I believe this might be a bug in the automation editor.
I think DataFile is a better place to handle the upgrade stuff rather than Song.
I think
DataFileis a better place to handle the upgrade stuff rather thanSong.
I tried that initially, but it didn't do anything. I'll try playing with it some more.
@PhysSong okay it took some playing around with finding nodes, but I finally managed to get it working in DataFile.
@Veratil Could you look into factory project files to see if any of them has global automation tracks?
@Veratil Could you look into factory project files to see if any of them has global automation tracks?
@PhysSong I believe that's already taken care of in the second commit, or are there other ones that I missed?
It will be okay if you've checked all demo projects and confirmed that there are no global automation tracks that you need to remove.
It will be okay if you've checked all demo projects and confirmed that there are no global automation tracks that you need to remove.
I've gone through and found that some of the demos are still adding tracks that aren't linked to anything. I've updated the check to look for more than one <time> node now which has prevented adding extraneous automation tracks which aren't linked to anything.
There is one demo that has an unlinked automation track which has mulitple time nodes.
@PhysSong Would you like me to go through and update all the demo files in this patch to the "newest" save file version then?
@PhysSong Would you like me to go through and update all the demo files in this patch to the "newest" save file version then?
If you want to do so, I'd recommend not touching files without global automations. I'm also okay if you do that in a separate pull request.
@PhysSong Would you like me to go through and update all the demo files in this patch to the "newest" save file version then?
If you want to do so, I'd recommend not touching files without global automations. I'm also okay if you do that in a separate pull request.
Is there an easy way to read the mmpz files? That would be the easiest to see if there is any automation patterns that should be imported.
Is there an easy way to read the
mmpzfiles?
lmms -d input.mmpz prints the decompressed version of input.mmpz.
Is there an easy way to read the
mmpzfiles?
lmms -d input.mmpzprints the decompressed version ofinput.mmpz.
Would it be okay to run lmms upgrade [in] [out] on all the files? 😄
That makes sense, but Qt will mix the order of attributes in XML tags. You can write a simple program to compress/decompress .mmpz files with QByteArray::qCompress() and QByteArray::qUncompress().
The result of qCompress() consists of the size of the uncompressed data(in 4byte big-endian integer) and the Zlib-compressed data. It means you can use some other software to (de)compress the project files.
@Veratil Are you going to finish this PR?
Seconded. It would be superb if we could get this and step 3 (remove from the GUI) done for 1.3, and step 3 should be a quick and safe fix.
I need to go through all the demo files still.
@Veratil Bump.
- I rebased on master 😁
- I updated the update function to the new format.
- I removed the global automation save from Song's
saveSettings, no more hidden automations will be saved after this at all. - I went through each demo file and actually loaded them in lmms. Any that had an unused hidden automation tracks that actually created visible automation tracks I removed and saved over. Anything else I didn't touch. If they do have the block, it's either ignored or will get removed on future updates where we update the demos for whatever reason.
Regarding global automation clips with only one point: In many cases, they are just holding the model's value at time 0, but it's not guaranteed that they always do.
The rest looks good to me.
Regarding global automation clips with only one point: In many cases, they are just holding the model's value at time 0, but it's not guaranteed that they always do.
That's where thing are weird. Every global automation track that had one node was either a leftover that wasn't removed (file bloat because there wasn't a way to delete the global track), or didn't actually affect the model's value anymore (that value was saved as an attribute instead or didn't actually connect anymore).
I can make the change to load it regardless, and I'll go through all the projects again to see if anything else pops up.
I looked into this PR again. This PR will change some behaviors:
- Global automation patterns have lower priority than ordinary ones, but this PR will reverse it due to the order of XML nodes
- Global automation patterns with single point which "locks" the value of connected models will be removed
- Global automation patterns created by user will never be saved
The first one sounds undesirable, but the rest don't sound too bad once #5230 is merged and https://github.com/LMMS/lmms/pull/5223#issuecomment-759225962 is addressed.
Rebased on master and (hopefully) fixed conflicts (correctly). Tested build and it seemed to be working. I'll go back through all the demos to double check everything, those are the biggest changes for removing the hidden automation tracks.
Looks like everything is still good in the demos. 👍
Global automation patterns have lower priority than ordinary ones, but this PR will reverse it due to the order of XML nodes
I think this is now the only one which probably needs to be addressed. @Veratil any opinions?
Global automation patterns have lower priority than ordinary ones, but this PR will reverse it due to the order of XML nodes
I think this is now the only one which probably needs to be addressed. @Veratil any opinions?
I'm honestly not sure what you mean by priority here. If two automation clips are connected to the same object the global wins?
If two automation clips are connected to the same object the global wins?
Yes, I mean that case.
https://github.com/LMMS/lmms/blob/1f30ffc5e4dddbd6ffb843bd8c56a8b4de859675/src/core/Song.cpp#L841-L844
Here you can see the global automation track is the first element before removal. You can also see that TrackContainer::automatedValuesFromTracks uses the value from the last track connected to an object.
Okay I'll try to see what can be done for this to keep them in order. It never occurred to me that you could connect an object to multiple automations.
Update?
Update?
It's ready for review now.