Alignment of multiple selected objects

• Mar 5, 2015 - 10:51
Type
Graphical (UI)
Severity
S5 - Suggestion
Status
active
Project

Hello, I would love to have the ability to align multiple selected elements, for example dynamics.

User would select multiple elements (presumably only slightly vertically/horizontally misaligned) and click a button (vertical or horizontal align) in the inspector. The elements would then be aligned on the baseline of the first selected element (assuming selection numbering is possible).

Another button would align the elements relative to their distance from the staff.

I will start working on this as soon as possible.


Comments

Have you checked MuseScore 2.0 Beta 2 or a more recent nightly build?
There, in a combination of Inspector( to adjust the settings) and 'Select al similar in range' this should work already, so I guess you could mark this issue fixed ;-)

That works if they are already aligned to start with. Otherwise, you'd first need to hit the Reset button to start them at the same place. But indeed, the Inspector definitely provides a way of doing this. And it won't work if the elements are of different types that wouldn't naturally have been aligned in the first place. From IRC discussions, I think the intent here is to provide a more automatic and reliable method. My sense is, it would not be a lot of code to handle the easy cases at least.

assuming selection numbering is possible
It could be possible, currently in the code a selection is a list.But AFAIK, the list is always considered unsorted.

I realize this is an old topic, so sorry to dredge it up—but it would be a very handy function, IMHO.

In Sibelius, you could simply select multiple objects (symbols, text—anything other than notes/rests), then type Ctrl+Shift+R to align them horizontally ("Row") or Ctrl+Shift+C to align them vertically ("Column"). It simply averaged out their positions, and was easily Undone with Ctrl+Z in case the results weren't what one wanted.

Any chance of adding something like this to MS? I'd be using it all the time, so perhaps others would find it useful too.

Along similar lines (NPI), is there some reason multiple objects can't be selected and moved as a unit, either with the mouse or arrow keys? That too would be very useful when one needed to keep their relative positions consistent, not to mention being much quicker and easier than moving them individually. Thanks!

Multiple objects can be moved as a unit in MuseScore 4, by dragging, if you want to keep the relative positions constant. Or, if you wish to reset them all to the same offset, use the Properties panel.

For objects that have the same baselines, it would be pretty trivial to write code to align them by simply assigning them the same offset. A plugin could do that easily enough., Of course, it's also very easy to simply assign them the same offset in Properties, so not a huge win. The real trick would be handling cases where the baselines are not the same - where some objects are positioned relative to the top of the staff but others to a specific notehead, etc.

An example of where you'd see yourself using this would be useful in understanding how a feature could be designed that was sufficiently useful.

In reply to by Marc Sabatella

Marc S > Multiple objects can be moved as a unit in MuseScore 4, by dragging, if you want to keep the relative positions constant...

You're right, Marc! I don't know how I got the idea they couldn't be. I must've still been learning some aspect of using MS and been confused—sorry about that.

Marc S> For objects that have the same baselines, it would be pretty trivial to write code to align them by simply assigning them the same offset... An example of where you'd see yourself using this would be useful in understanding how a feature could be designed that was sufficiently useful.

There are two places where I've used it most often:

• Aligning dynamic marks (which can wander here and there, especially between piano staves)

• Aligning chord symbols (as the music under them changes, requiring them to be slightly higher than other symbols on the system, or no longer be higher)

To be clear, multiple objects could not be dragged together in earlier releases; this was added sometime within the last few years (I originally wrote in MU4, but that's wrong, works in 3.6.2 also).

Chord symbols can be aligned automatically system by system, just set the maximum amount of shift you want in Format / Style / Chord symbols.

Dynamics normally shouldn't be aligned across a whole system, so there is no automatic facility, But since that is a case where the element types - and hence the baselines - are all the same, - then simply setting the same offset in Properties accomplished the job already. So, no separate command would be needed, but indeed, a plugin could potentially save a click or two. I've been exploring these more lately, maybe I'll give it a shot at some point...

Here is a WIP plugin.

EDIT: much improved from the first version posted earlier today :-)

This works for basic text elements like staff text or dynamics, also for fingering, and for articulations. Elements above the staff and below the staff are aligned separately - always to match the element further from the staff.

For elements below the staff, it assumes a standard five line staff; I haven't yet figured out a way to correctly account for staff height. If your staff is taller or shorter than 4 sp, you'll get inconsistent results.

Anyhow, select the elements you want to align and run the plugin (which you can give a keyboard shortcut for simplicity).

Attachment Size
align.qml 2.25 KB

It's the vertical position of the elements that is altered - they are moved to the same vertical position - so to me that's vertical alignment. It's true that this means a line drawn through them would appear to be a horizontal line, so that is indeed a potential source of confusion.

Anyhow, here is another version, this one does handle staves of different heights (including one-line percussion and six-line tablature), but at a slight cost: undo requires two steps sometimes.

Attachment Size
align.qml 2.72 KB