lmms icon indicating copy to clipboard operation
lmms copied to clipboard

Save Scale/Key Highlighting, and Many More Editor Options.

Open regulus79 opened this issue 8 months ago • 6 comments

This PR makes it so that the scale/key/chord in the Piano Roll is saved with the project.

Also, while I was at it, I made it so that the zoom, vertical zoom, snap settings, quantization, and note lengths are saved too.

Aaand I also decided to save the zoom and snap size in the Song Editor because why not :D

However, the zoom/snap/etc are saved in the lmmsrc file, since it doesn't really make sense to save them per-project.

Note

It seems odd that the song editor is saved as a <trackcontainer> in the xml, since it's the Editor which does the saving, not the editor window. This means that I cannot save the state of the proportional zoom option, since that is not accessible from the editor object, only the window. However, the piano roll does it via the editor window. It feels like we should be doing it that way via the gui, since saving isn't something which should be in the core(?) (or should it? idk)

regulus79 avatar Apr 19 '25 23:04 regulus79

Tested, works well.

AW1534 avatar Apr 20 '25 17:04 AW1534

Also, currently I am saving the values as attributes of the editor's xml element. However, this means that any automation connections will not be saved. Are we okay with this? Or should I try to save each model using their own saveSettings/loadSettings functions? If so, I may need to edit them to add a way to specify a default value, since currently that's not possible (and we probably want that so that old projects get loaded with reasonable values.

regulus79 avatar Apr 20 '25 20:04 regulus79

Scale highlights are a good idea. For all the other stuff like zoom, scroll mode and stuff it seems like a more sensible solution would be saving currently used settings in something like lmmsrc.xml instead. Saving them per project doesn't make much sense because old projects will have to be adjusted one by one. These defaults are entirely user preference anyways, and in case of something like a collaboration, it will present an additional step user has to do every time the project is passed back and forth

Jernemies avatar Apr 29 '25 02:04 Jernemies

Scale highlights are a good idea. For all the other stuff like zoom, scroll mode and stuff it seems like a more sensible solution would be saving currently used settings in something like lmmsrc.xml instead.

After thinking about this, you're right. It doesn't make sense to save those kind of ui things per-project. I've changed it in the latest commit to save it in the lmmsrc file, so now whatever zoom/snap/quantization/notelength you have last will be restored when you open lmms again.

regulus79 avatar May 01 '25 21:05 regulus79

Wait, maybe these kind of settings should be project specific.

Currently just the scale, key, and chord are project specific. Are you saying you also want the zoom/snap/note length/quantization settings to be saved in the project?

regulus79 avatar May 03 '25 19:05 regulus79

Wait, maybe these kind of settings should be project specific.

Imo user preferences should not be project specific for reasons I outlined above. In an ideal world we would just have defaults in settings, but saving these in config does achieve this in the meantime

Jernemies avatar May 14 '25 21:05 Jernemies

This PR makes it so that the scale/key/chord in the Piano Roll is saved with the project.

Tested, works!

The zoom, vertical zoom, snap settings, quantization, and note lengths are saved too.

So, that's all the items left of the scale/key/chord and that one item to the right, correct? Tested. These properties seem to be saved globally, which is odd to me. Like, I run the PR, and the same properties are loaded.

I also decided to save the zoom and snap size in the Song Editor

Tested. This also seems to be saved globally.


However, the zoom/snap/etc are saved in the lmmsrc file, since it doesn't really make sense to save them per-project.

There we go, okay!

I'd think you want to set a different snap level for different projects; "1/4 bar" for electronic music and "1 bar" for slower, orchestral pieces, for example.

Or maybe someone wants 1/192 for music in odd time signatures and 1/8 for simple electronic music, etc.

So I'd vote for making everything per-project, and if you want it as default for your projects, just add it to your default template!

bratpeki avatar Jul 23 '25 19:07 bratpeki

I'd think you want to set a different snap level for different projects; "1/4 bar" for electronic music and "1 bar" for slower, orchestral pieces, for example.

Or maybe someone wants 1/192 for music in odd time signatures and 1/8 for simple electronic music, etc.

That also sounds reasonable, I could see how it would be useful to keep snap sizes per-project. I know Jernemies is in favor saving most of the things per-user rather than per-project, which is why I have it implemented the way it is currently. I suppose we could also add an option in the settings window for whether to use per-project or per-use snap sizes etc.

Unfortunately, I don't really have time at the moment to make any major code changes :sweat_smile:, so it would either have to wait a little while for me to find time to do it, or we could merge this now and deal with it in another PR.

regulus79 avatar Jul 23 '25 22:07 regulus79