MuseScore 3.6.2 & 3.7—Is there a way to make a Range Selection in the Piano Roll Editor?
When I select "notes" in the PRE they appear in score view as if Control/Command-click selected (no rectangle surrounding them) rather than Shift-click selected (where a rectangle surrounds the selection.) In other words, the PRE makes a List Selection by default.
Any advice on making a Range Selection in the Piano Roll Editor?
It's not that I need or expect the PRE to display some sore of range selection indication. I just need a range selection before I can accomplish the next task and I'd rather not switch back to score view just for the purpose of making a range selection.
Thanks!
scorster
Comments
Greetz. "3.7" Mouse-lasso provides only list-selection in PRE. You're probably familiar with the fact that there are plenty of operations capable of being performed within list-selection, so unless your operation demands range selection, that will have to suffice for now. Just make sure the default "Select Notes" button is activated:
For the sake of onlookers, you could describe what the desired outcome is to see if something could be done about it (if list-selection isn't sufficient).
In reply to "3.7" Mouse-lasso provides… by worldwideweary
The lasso does indeed select a range of notes but these do not show as a selected range in the score. Is this what you mean by them being a "list-selection"?
The operation is plugin related and the plugin checks for, and then processes, a range. In the absence of detecting a range the plugin processes the whole score. Is there something in the plugin API that can instead detect a "list-selection"?
The desired outcome is the same as doing the following actions in the score:
(1) selecting a note then
(2) holding the shift key whilst selecting a later note.
This selects a range of contiguous notes and draws a rectangular box around them.
(FYI: This is something that I am working on with scorster)
In reply to The lasso does indeed select… by yonah_ag
The status bar below shows as a list-selection when a selection exists of multiple elements without a range-lasso.
If you're in control of the plugin's programming, alternatively you could take a list-selection (which is what exists from the lasso or ctrl+clicking inside of the PRE).... and get the appropriate elements (notes) from the elements container of the curScore:
QQmlListProperty < Ms::PluginAPI::Element > elements
These are graphical UI elements, so they're noteheads only and not ChordRests. You could create a range-selection within the plugin before doing whatever operation upon a range-selection, but you'll need the start and end ticks along with staff information.
curScore.selection.startSegment + endSegment only work for a valid range selection, so you'd have to take the curScore.selection.elements (which will be the list-selection) and get the first and last elements from there (check that they're notes), grab their ticks and their staffs, then you could synthesize a range-selection from the list selection. Notes don't have ticks, but they have Chord() method which has a staff. Grab that. Then call the parent() of the chord which will result in an element that will have a tick() (I've gone through this jazz myself before). Again, the chord itself will have a staff element. Those ticks and staves can be used to form a range:
curScore.startCmd();
curScore.selection.selectRange(beginTick, endTick, startStaff, endStaff);
curScore.endCmd();
After that, you should be good to do whatever the range-based operation is.
in 3.7 (Qt 5.15) If I remember correctly, I had to use startCmd() and endCmd() to get the range selection to work or something,. but in 3.6 with Qt 5.9 it didn't need it, whatever that means.
In reply to If you're programming the… by worldwideweary
Thanks, that makes sense. I am already processing segment ticks and ChordRest elements and I have been using selection.isrange to detect a range of selected notes at the start of the processing. Since ctrl-clicking and PRE do not set this property to true I will go for the above approach.
Edit : It is probably a bug in PRE that using shift-click does not produce a range but just a list selection: this is atypical behaviour in Windows apps and is inconsistent with shift-clicking in the actual score.
In reply to Thanks, that makes sense. I… by yonah_ag
IMO, the shift-click behavior manifests as by design, since a range-selection is bound to be contiguous, but with list-selections there are no such constraints. Shift-clicking within the PRE allows for adding "blocks" of note events to a list-selection which can't be had in the main score without [Ctrl-click] or [Select all similar] activity, since a new lasso in the [score view] will create a new range-selection and lose any former selection-state, which is not what a user would probably want in the PRE more often than not. Put in another way, why deal with stems, dynamic marks, even rests etc. when only operating upon Note Events within the PRE?
Either way, you guys have yet to explain the modus operandi of your plugin in-the-works.
Let me ask a stupid question: should I be curious ? :)
In reply to IMO, the shift-click… by worldwideweary
@ worldwideweary wrote >you guys have yet to explain the modus operandi of your plugin in-the-works.**
There's a discussion about it here.
And thank you very much for your input about processing List Selected items!
scorster
In reply to IMO, the shift-click… by worldwideweary
If you play guitar, particularly fingerstyle, then you may find the plugin helpful. It fulfills the discussion in the thread that scorster linked and replaces the current Excel plugout version which works on the mscx file.
Thanks for all your comments. I was able to quickly add the code needed to deal with list selections so now the plugin handles both ranges and lists. :-)
In reply to If you play guitar,… by yonah_ag
Sweet. Sounds useful, especially, I'd imagine, for midi exporting.
In reply to Sweet. Sounds useful,… by worldwideweary
Good point! I hadn't thought about that at all but only had improved score playback in mind. The plugin modifies the Play Event data so I would expect this to be reflected in the midi export.
In reply to Good point! I hadn't thought… by yonah_ag
MuseScore indeed exports MIDI according to note duration (not face value) so I've been using the plugin to groom playback for MIDI export and that allows me import believable guitar parts from MuseScore into Logic.
"En score" the plugin transforms guitar parts from a choppy "sounds like the playback of every other notation app" to an extremely realistic and natural guitar Laisser Vibrer playback. Talk about improving the sound of a MuseScore project! I only have to do minor cleanup. See the attached sound file where the bass, drums, chords, organ) and the 3-3-2 pattern (guitar/piano part) all came from MuseScore, with the latter processed through the plugin.
scorster