[Trunk] Allow to change the voice of a chord containing an only one note

• Sep 25, 2011 - 23:39
S4 - Minor
by design

Hi. The current trunk do not allow to change the voice of a single note in a chord.
Then the trunk do not allow to create the score we can see on the documentation http://musescore.org/en/handbook/voices (there is single notes blue, and also green).
The image i send also show the same thing.

Looking the code, i think there is a typo in an "else if". I send a patch.
I edit a condition "else if (notes > 1 || (voice && chord->voice())) {"

* notes > 1 -> this is already tested few lines before in the first "if", which mean here this test is always false.
* voice && chord->voice() -> i dont understand it at all. 0 is an available value for the voice 1. The only thing usefull is to know if there is a change "voice != chord->voice()", but it is already tested before.

Attachment Size
voice-any-notes.png 7.22 KB
voice-any-notes.patch 761 bytes


The command implementation is incomplete and handles only some conditions. Especially it does not make sure that voice 0 has always to be complete and has no time gap. For this only voices 1+2+3 can be changed in a chord of only one note (thats the "voice && chord->voice()" which has to be read as "(voice > 0) && (chord->voice() > 0)".
The "notes > 1" is indeed a typo.

@lasconic, both. for example this one (http://musescore.org/sites/musescore.org/files/voices-diagram.png). I think, everytime there is a chord of an only one note in the voice green (voice 2 on the image -> voice 1 in the code? right?). But i should test again with the fix of werner (but imo, it do not change anything).

@werner then what can we do? for example to move an only one note from the voice 0 to the voice 1, can we add an hidden rest or something like that?

If a note/rest is moved from voice 0, it has to be replaced by a rest. You cannot move a note/rest to voice 0 as there will be already an element. Also there is no check if the destination is already occupied. The operation should not overwrite an existing chord/rest. For this "exchange voice" is better.

Ho, yes, you'r right, i am sorry to spend your time.
I am not in the same use case then the documentation. I work from an existing score. Then i want to "decorate" it.