Audiveris / audiveris

Latest generation of Audiveris OMR engine
https://audiveris.github.io/audiveris
GNU Affero General Public License v3.0
1.51k stars 224 forks source link

The same rhythm should have bigger priority in voicing #356

Open oleedd opened 4 years ago

oleedd commented 4 years ago

It chooses the long note to the green voice instead of the notes with the same rhythm. Why? The half note should come to a new voice. image

hbitteur commented 4 years ago

To manually correct the problem, you can simply select the last 1/16th note of previous measure and the first 1/16th note of the following measure. Then a right click opens a popup menu, in which you can select the "chords" submenu and the menu item "same voice".

Or if you prefer, the other way around: select the two notes that should not be on the same voice and in the popup menu / chords / select separate voices.

oleedd commented 4 years ago

The first way works, thanks. But I want to try out the second but there isn't "separate voices". image

oleedd commented 4 years ago

I found that "separate voices" doesn't work (appear) through any bar line. A bug?

hbitteur commented 3 years ago

You need to grab 2 chords (for which there is no "same voice" relation set) We would need the input image to investigate.

oleedd commented 3 years ago

We would need the input image to investigate.

It is in the first post here: https://github.com/Audiveris/audiveris/issues/336

hbitteur commented 3 years ago

OK, I think I understand now.

oleedd commented 3 years ago

It was about "separate voices", not about "Separate time slots". The key problem is in the first post.

hbitteur commented 3 years ago

Oops, my mistake! I played with your example, and picking two chords across a barline, the chords menu offered me several options, including the "Separate Voices" action, see below: image

oleedd commented 3 years ago

Separate voices is already available, but no result. image It is on page 4.

hbitteur commented 3 years ago

image

So, I have to investigate why the "Separate voices" had no effect.

oleedd commented 3 years ago

So, I have to investigate why the "Separate voices" had no effect.

Yes. And also the voicing problem in the first post.

hbitteur commented 3 years ago

the voicing problem in the first post.

Could you point me to the precise issue number?

(I'm currently reviewing and cleaning up the whole backlog of issues, so I get lost rather quickly)

oleedd commented 3 years ago

I mean this issue.

hbitteur commented 3 years ago

But I just told you how to fix it. Here is the result: image

oleedd commented 3 years ago

It is not about manual fixing, it is about improvement of the voicing algorithm.

hbitteur commented 3 years ago

That's a different story! :-) Because voicing algorithm is a true nightmare

hbitteur commented 3 years ago

FYI, main code for time slot and voice is in MeasureRhythm class. Have a look.

oleedd commented 3 years ago

I don't understand why. I know only Javascript, not Java, to help you. But this would be interesting. The same beam direction && the same rhythm = the same voice. Btw, if you do the most difficult things, other things become much easier.

oleedd commented 3 years ago

Moreover, if there are 2 notes with the same direction in the next measure, what should it choose in voicing? It should choose the most close duration to previous. Choosing a note with another stem direction (what it does) should be forbidden if there are >= 2 voices further. So what we have in priorities: 1) stem direction (decisive); 2) close duration. There will be a big mess if to allow voices to change stem directions at >= 2 voices. And the true changing (detected by the same rhythm) can occur in extremely virtuoso compositions - better to not support this because some simple 2-voice compositions may have an incorrect voicing result.

hbitteur commented 3 years ago

OK, I will give this a try.

oleedd commented 3 years ago

If there was several voices but currently only 1, it should ignore changing the stem direction. image

And the true changing (detected by the same rhythm) can occur in extremely virtuoso compositions

This can be supported too via an addition setting like put beamed groups to the same voice: image