Feature request: save state of zoom settings and (vertical) scrollbar in editors

MusE is a DAW for Linux with both MIDI and Audio editing. https://muse-sequencer.github.io

Moderators: MattKingUSA, khz, spamatica

Post Reply
User avatar
electrocoder
Posts: 2
Joined: Tue Apr 30, 2019 9:14 pm
Location: Hamburg, Germany

Feature request: save state of zoom settings and (vertical) scrollbar in editors

Post by electrocoder »

I work much with the pianoroll editor. Almost always I start by changing zoom settings (increase zoom level) when fine-tuning event positions and sizes. For tracks with very high or low notes I also sometimes have to scroll vertically to find the events at all then. This basically works. But unfortunately, whenever I close the pianoroll editor and reopen it on another part (or the same one), it opens with default zoom levels and vertically centered again. Zoom + vscroll state is not kept. Only window positions and sizes are kept + saved.

It would be perfect if the zoom and vscroll state settings could be maintained per track and saved in .med files. However, since I suspect this being not that easy to achieve, keeping the state of zoom and vertical scrollbar just during the session would be rather helpful already.

Of course, when working on saving GUI state, saving the current selection of custom controller views added in the pianoroll editor would be welcome as well. Though I'd consider this a little less easy to achieve and important.
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: Feature request: save state of zoom settings and (vertical) scrollbar in editors

Post by Tim E. Real »

Hi, I have been looking into this since another user has requested it. Been super busy with latency correction branch though...
But it is near the top of my mind though because true, it is annoying.
We currently save the position and size only. It can be seen that these are carried over to any new window opened.

If I recall correctly (can't quite remember ATM) we use QSettings features for that, and I was looking at
whether we could store these other desired settings.
Otherwise we have to find a different way to carry the desired settings over.

Tim.
alex stone
Established Member
Posts: 350
Joined: Fri Jun 06, 2008 7:39 am
Has thanked: 61 times
Been thanked: 53 times

Re: Feature request: save state of zoom settings and (vertical) scrollbar in editors

Post by alex stone »

Yes, this would be very nice. Sorting out the zoom levels each time i open the window is a major time consumer.

Alex.
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: Feature request: save state of zoom settings and (vertical) scrollbar in editors

Post by Tim E. Real »

Ehm... hey there! Progress!

I wanted to start by at least experimenting with increasing the default vertical zoom level.
But the value which controls this had no effect regardless of what I put there.
Whoa... took me a few days to figure out why. No wonder no one's tried it yet.

Hopefully this is a good first step for y'all.
I have increased the vertical zoom by one step.
Stay tooned...

ChangeLog:

Code: Select all

      - Pianoroll Editor: Increased default vertical zoom level from 1 to 2.
        Was challenging. The global variable 'yscale' in pianoroll.cpp had no effect
         no matter what I put there. Fixed class ScrollScale (the slider!), had a
         problem with the initial scale. Replaced its curious successive approximation
         log() code with an actual log10() call, rounded up! Tested OK.
Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

[DONE]: Feature request: save state of zoom settings and (vertical) scrollbar in editors

Post by Tim E. Real »

In github master now.

Check it out!

Open a piano roll editor on a part.
Adjust vertical zoom and scroll position, and horizontal zoom, and add some controllers to the view, as desired.
Now close the window.
Now open an editor on the part again.
Settings should be preserved.
Opening further windows on that part keeps the settings.
It will keep the settings from the last active window. Similar to how our size is kept depending on the last active window
It works with multiple parts open in one editor as well.

Opening further windows on another part starts with fresh, default settings.
It operates on a per-part basis, for now.
If you want to affect more than one part's settings, for now just select all of them and open them in one editor,
and fiddle with the settings. It will store the settings in all the open parts.

I believe this is in general what everyone has been waiting for since... day one. N'est pas?

TODO: Fix horizontal scroll position not keeping setting. Support Drum Editor as well. A few teaks and fixes perhaps...

Cheers, ye Musers.
Tim.

From ChangeLog:

Code: Select all

        Midi Editor now keeps state (zoom, pos, controllers) after closing:
        Works on a per-part basis: Whatever you set on a part it remembers.
        Pianoroll Editor is done, tests OK. TODO: Drum Editor.
User avatar
oscillator
Established Member
Posts: 1127
Joined: Sat Jan 17, 2015 6:07 pm
Location: SWEDEN
Has thanked: 725 times
Been thanked: 296 times
Contact:

Re: Feature request: save state of zoom settings and (vertical) scrollbar in editors

Post by oscillator »

Tried it out -- works awesome!

This will save a lot of time and improve the overall feeling of my workflow.

Big thanks!

/Staffan

MusE DAW running on Debian 11 Testing/XFCE4.
https://oscillator.se/musik

Tim E. Real
Established Member
Posts: 660
Joined: Sat Sep 15, 2012 12:36 am
Has thanked: 36 times
Been thanked: 105 times

Re: Feature request: save state of zoom settings and (vertical) scrollbar in editors

Post by Tim E. Real »

In git master now:
- Improvements to 11.10. Fix accuracy problems (re)storing view state.
Horizontal zoom and position were drifting with each new opened window.
Tested rock solid so far, saving and restoring views.

Drum Editor is done as well.

Took me two days to find a line in class ScrollScale::mag2scale()

Code: Select all

scale_val = - ( int ( 1.0 / scale ) );
and change it to:

Code: Select all

scale_val = floor ( 1.0 / ( -scale ) );
Normally that would not have been required.
But the unique, ingenious nature of some of our controls representing fractional values
with negative numbers required this particular fix. Tested OK so far.

Note: About the horizontal scroll position:
I was going to save the state of the horizontal scroll position as well.
But I discovered that there was already a feature which manipulates the position,
but it was broken. So I fixed it. :)
:!: The feature is this:
There is a little black vertical line on the timescale bar. It follows your mouse movements.
Double-clicking on a part opens the part in an editor, already scrolled at the black line's position.

Unlike the horizontal zoom, and vertical zoom and scroll position, I felt this feature was more important
than remembering the horizontal scroll position of the last window you had open.
A strong argument is this:
Suppose you have one long part, the entire length of a track.
If you scroll the Arranger to a new place, and double-click on the part, do you really want the new window to
open at the scroll position of the last window you had open?
No, it is more likely you would find it convenient that the window opens at a scroll position
where you clicked on the part (the little black line).

If you have any strong arguments to save the position instead, present them :wink:

Try it out, lemme know what you think.
TODO: I could try to expand on this and save the heights of the controller graphs.
TODO: The mixer strip on the left does not keep it's width for the next opened window unless it is closed first.
User avatar
oscillator
Established Member
Posts: 1127
Joined: Sat Jan 17, 2015 6:07 pm
Location: SWEDEN
Has thanked: 725 times
Been thanked: 296 times
Contact:

Re: Feature request: save state of zoom settings and (vertical) scrollbar in editors

Post by oscillator »

Works fine at my end! Thanks!

MusE DAW running on Debian 11 Testing/XFCE4.
https://oscillator.se/musik

Post Reply