Drum input palette: notes set to enter as voice 2 are entered into voice 1 in error

• Jan 2, 2017 - 10:58
Reported version
P1 - High
S3 - Major

2.0.3 (portable) / Win /10

If you enter voice 2 drum notes (e.g. kick drums) from the drum input palette by double-clicking, (1) the notes turn from green to blue in the palette and (2) The notes entered on the staff show up in the wrong voice.

1. Open the attached file. There should be no other file open in the program (important).
2. Navigate to the first empty measure. Enter note input mode. The Drum input palette opens at the bottom.
3. Double-click a bass drum (voice 2 shown in green) in the palette.

Expected result: The note is entered in voice 2. The note in the palette stays green.
Actual result: The note is wrongly entered in voice 1. The bass drum note in the palette wrongly turns blue!

4. Close the file without saving. Now open and enter note input mode again.

Result: The colours of the voice 2 notes in the drum input palette have been restored.

Note: Double-clicking cannot be used as a method of entry because of this bug. However, entry by (computer keyboard) shortcut is unaffected.

Recommended behaviour: Double-clicking notes from the palette or using (computer keyboard) shortcuts should have the same result.

Attachment Size
drums_voice_bug.mscz 5.96 KB


This is intentional - otherwise there would be no easy way to override the default voice assignment. Keyboard uses the default, mouse uses whatever your voice control is set to. A single click in the palette automatically sets the vopice control appropriately, but you can then override it and your change sticks.

I take that back, there does seem to be a problem, it doesn't work to select voice 2. That is, double clicking seems to force everything to voice 1 regardless of the default for the drumset or the state of the voice control.

Title Drum input palette: Double-clicking notes does not work Drum input palette: Double-clicking notes always enters into voice 1
Status (old) by design active

Not sure how this managed to escape notice until now?

A number of weird things with voices and stem directions in unpitched percussion entry didn't quite escape my notice, but I got so used to them I didn't notice anymore.

What's odd is I know I fixed an issue specifically relating to this before the initial release of 2.0, and that section of code doesn't appear to have changed since then. So apparently my fix didn't do what I thought it did. I need to investigate further.

See #39456: Double clicking icon on drum palette enters note at wrong location / voice, undo moves cursor to wrong staff - this is the issue I supposedly fixed, via https://github.com/musescore/MuseScore/pull/1463. Also see discussion in https://musescore.org/en/node/39366 that led to the issue being filed. Nowhere in any of this discussion do I now see a clear statement about what expected results should be - just general observation that it should be possible to override the default voice.

What I find now is that the current behavior depends on the "input position" - the chord or rest that the next note input would otherwise replace. If you currently have voice 2 selected on the note input toolbar, *and* there is already a rest (or note) for voice 2, then double click will enter the drum note into that voice. At least, it will until you try entering a voice 2 note somewhere that doesn't already have a rest or note there, which does indeed appear to change the palette itself, and now things are a bit more messed up going forward.

I rather doubt this was this the behavior I thought I was implementing, but looking at my code, it pretty much seems to be what I wrote, so I must have been thinking *something*. Does someone have access to the original 2.0 release to see if this works the same way there?

More importantly, I guess now we get to consider again how this really *should* work. I'm open to suggestions.

FWIW, the bug where the voice of the palette itself changes is possibly the result of unrelated change to applyDrop(), might also have been something I did while making double click work for more palette items. Hard to be sure since I don't have a 2.x build environment set up, so my investigation thus far is on master where there have already been other significant changes (and the drum palette is quite messed up in terms of stems, BTW).

FWIW, simply doing an score->expandVoice() call before we check for a chord/rest at the current input position here:


fixes the behavior to be more consistent what I think I expect. Not sure it is exactly perfect, but the lack of this call is why currently you can't enter anything into voice 2 by double click unless there is something there already. The call to score->inputState().cr() returns null, so we go with the selection instead, which is likely to be something in voice 1 (since there is nothing in voice 2), and drop the new note there.

There's a little more to good fix than this - I'm also concerned about the possible voice change within the palette itself - and I am sure there are other ways of dealing with this. Mostly, though,I'd still love to hear more input on expected behavior. Should I move this to the forum? Maybe revisit the original thread from two years ago (https://musescore.org/en/node/39366)?

What you described sounds good to me. I'm not sure what you mean by "I'm also concerned about the possible voice change within the palette itself," though—could you elaborate?

See the part in the original report about the color (and indeed, the actual default voice assignment) of the drum icon *in the palette* changing upon double-click. My one-line "fix" does improve the situation but still leaves cases (*) where the note is entered into the wrong voice, and in those cases the drum icon does still change.

(*) The case fix doesn't address is where there is content in voice 2 but not on the specific beat you are trying to enter on. That is, a half rest in voice 2 on beat one, cursor currently on beat 2 (possibly if there is something in voice 1 on that beat and voice 1 is currently selected in the toolbar) and then you double click a an icon assigned to voice 2. I'm not really sure what the expected result *should* be in that case - maybe convert the half rest in voice 2 to a quarter rest so the new note can be entered on beat two? Or maybe back the cursor up to beat 1 and enter the new note there? Or move it forward to beat 3 and enter it there?

Right now, what would happen is that the new note gets entered into voice 1 because that is what you have selected in the toolbar - that is, with double click, the current voice in the toolbar "wins" in this particular case, but not in the general case. I'm still torn on the business of this voice override. On one hand it should be *possible* to override the default voice, but right now that's doable if you single click the icon then click in the score - this uses the current voice selection. And of course, once you select a voice, the cursor moves, if necessary, to a place where it is actually possible to enter a note, so the issue I am talking about here never arises.

So I'm still trying to understand at a basic level here: say your voice selector - and hence the cursor - is on voice 1, then you double click an icon in the drum palette that is set to voice 2. What do we really expect to happen? Said another way, should double click honor the default voice for the icon or the current voice selection? I'm leaning now toward honoring the default, as it seems that would more commonly be how I would want notes entered. If I have a drumset definition that has bass drum in voice 2, that's where I want it 99% of the time. So while it needs to be *possible* to override it, I think the most basic note entry methods should probably take advantage of the defaults. Otherwise what is the point of having them (which is itself a good question...)

Good detail! Speaking for myself, I would expect the note to be entered in its default voice if double-clicking, whatever is selected in the toolbar. In the "(*)" case, I think ideally the preceding half rest in voice 2 would be shortened and the new note entered at the selected point.

IMV, it would be easier if you removed the voice pre-allocation of notes altogether, so that the drum input palette always enters in the selected voice (whether double-clicking or using shortcut). That way the palette mirrors the behaviour of the virtual piano keyboard and an external MIDI keyboard.

I'm not talking about removing the ability to enter percussion notes into different voices. I'm just suggesting that it would be easier, and more consistent, if percussion voice selection was always via the voice toolbar above the score window. After all, the virtual piano keyboard and an external MIDI keyboard always enter percussion this way, so why should the note input palette be different?

The current plan for percussion input seems to be a very logical alternative to having to click a note on a toolbar. It is the equivalent of entering notes in any other staff. You just have to remember what A, B and C mean on a/your drumset. The input palette is bascially a diagram of what keys make which instruments in the drum set, with the option of double clicking it if you like. The "notes" are simply the shortcuts available on many other palette actions.

The plan is good in my opinion, it just needs to work properly. When you select a percussion that is supposed to go into voice 2, it should. MS should also pad the measure with the appropriate rests in the correct voice to accommodate the location of the cursor in the measure. So if you start with an instrument in voice 2 and at beat 2.5 you enter a note that should be in voice 1 MS should change the voice 1 measure rest to a 1/2 rest and an 1/8th rest and then enter the selected note. If note C goes into a different voice than the current note, then shift-C should put the note in the correct voice at the current location. This is the percussion idea of a chord on any other instrument.

Title Drum input palette: Double-clicking notes always enters into voice 1 Drum input palette: notes set to enter as voice 2 are entered into voice 1 in error
Severity S4 - Minor S3 - Major
Reported version 2.1  
Regression No
Workaround No

This issue has carried over into MS 3. Further investigation has revealed more:

  1. Open the attached file in the OP, and go into Note Input mode in the first blank measure (M3).
  2. Double-click the first note in the Drum Input palette (DIP) – Ac. Bs. Drum.
    Expected result: Entered in Voice 2 (as set in the Edit Drumset dialog).
    Actual result: Note entered into Voice 1.
  3. Now enter the same instrument with a single click on the staff.
    Expected result: The note should be entered in Voice 2.
    Actual result: The note is still entered in voice 1.
  4. Click on the second note in the DIP: Bass Drum 1. Now click on the staff to enter the note.
    Expected result: The note should be entered in Voice 2.
    Actual result: The note is entered in voice 2. It appears that selecting a new drum sound has restored the correct behaviour for single-click entry.

Not only does double-click entry force the voice 2 note into voice 1 in error, but it primes any subsequent single-click entry to make the same error.

Priority P1 - High

Although I started a discussion of this on the forum and get little response, I still feel there should be more discussion of the desired behavior, especially in light of MDL. What is happening here is definitely a bug (nd I'm not sure why it works sometimes but not other times), but I feel we should be looking at the bigger picture here as well.

We’re reverting that change for the drum palette. But, this issue still applies either way, just differently. Eventually we want to think of some better designs, and the info in this thread will remain good for reference.