Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long sequences with no fingerings #33

Open
Cool-Joe opened this issue Jan 22, 2021 · 11 comments
Open

Long sequences with no fingerings #33

Cool-Joe opened this issue Jan 22, 2021 · 11 comments

Comments

@Cool-Joe
Copy link

Cool-Joe commented Jan 22, 2021

Several songs produce long sequences with no fingerings, what is the reason?
The example below was downloaded from https://www.mutopiaproject.org/ftp/JoplinS/original/original.mid
(I added some debug output values in your code.)

python.exe pianoplayer original.mid --verbose -d 9

music21: Certain music21 functions might need these optional packages: matplotlib, numpy;
                   if you run into errors, install them by following the instructions at
                   http://mit.edu/music21/doc/installing/installAdditional.html
Your hand span set to size-M which is 17.22 cm
(max relaxed distance between thumb and pinkie)
Reading beam 0 with 613 objects in stream.
time:0.0        meas.None       finger:1 on B-5 duration:0.3    v=27.9  [1, 5, 1, 5, 1, 5, 1, 5, 4]
time:-0.05      meas.None       finger:5 on B-6 duration:0.3    v=31.5     [5, 1, 5, 1, 5, 1, 5, 1, 5]
time:0.25       meas.None       finger:1 on B5  duration:0.55   v=31.5        [1, 5, 1, 5, 1, 5, 1, 5, 1]
time:0.2        meas.None       finger:5 on B6  duration:0.55   v=32.4           [5, 1, 5, 1, 5, 1, 5, 1, 5]
time:0.75       meas.None       finger:1 on B-5 duration:0.3    v=32.8              [1, 5, 1, 5, 1, 5, 1, 5, 3]
time:0.7        meas.None       finger:5 on B-6 duration:0.3    v=37.7                 [5, 1, 5, 1, 5, 1, 5, 1, 5]
time:1.0        meas.None       finger:1 on B6  duration:0.55   v=35.7                    [1, 5, 1, 5, 1, 5, 1, 5, 5]
time:0.95       meas.None       finger:5 on B5  duration:0.55   v=37.7                       [5, 1, 5, 1, 5, 1, 5, 1, 5]
time:1.5        meas.None       finger:1 on B-5 duration:0.3    v=34.0                          [1, 5, 1, 5, 1, 5, 1, 5, 3]
time:1.45       meas.None       finger:5 on B-6 duration:0.3    v=31.3  [5, 1, 5, 1, 5, 1, 5, 1, 5]
time:1.75       meas.None       finger:1 on B5  duration:0.3    v=30.6     [1, 5, 1, 5, 1, 5, 1, 5, 2]
time:1.7        meas.None       finger:5 on B6  duration:0.3    v=32.1        [5, 1, 5, 1, 5, 1, 5, 1, 5]
time:2.0        meas.None       finger:1 on F#5 duration:0.3    v=24.8           [1, 5, 1, 5, 1, 5, 1, 5, 1]
time:1.95       meas.None       finger:5 on F#6 duration:0.3    v=22.5              [5, 1, 5, 1, 5, 1, 5, 1, 5]
time:2.25       meas.None       finger:1 on G6  duration:0.55   v=20.3                 [1, 5, 1, 5, 1, 5, 1, 5, 4]
time:2.2        meas.None       finger:0 on G5  duration:0.55   v=-1                      [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:2.75       meas.None       finger:0 on E5  duration:1.3    v=-1                         [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:2.7        meas.None       finger:0 on E6  duration:1.3    v=-1                            [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:4.0        meas.None       finger:0 on F#5 duration:0.3    v=-1    [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:3.95       meas.None       finger:0 on F#6 duration:0.3    v=-1       [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:4.25       meas.None       finger:0 on G5  duration:0.55   v=-1          [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:4.2        meas.None       finger:0 on G6  duration:0.55   v=-1             [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:4.75       meas.None       finger:0 on F#6 duration:0.3    v=-1                [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:4.7        meas.None       finger:0 on F#5 duration:0.3    v=-1                   [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:5.0        meas.None       finger:0 on G5  duration:0.55   v=-1                      [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:4.95       meas.None       finger:0 on G6  duration:0.55   v=-1                         [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:5.5        meas.None       finger:0 on F#5 duration:0.3    v=-1                            [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:5.45       meas.None       finger:0 on F#6 duration:0.3    v=-1    [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:5.75       meas.None       finger:0 on G5  duration:0.3    v=-1       [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:5.7        meas.None       finger:0 on G6  duration:0.3    v=-1          [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:6.0        meas.None       finger:0 on C#6 duration:0.3    v=-1             [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:5.95       meas.None       finger:0 on C#5 duration:0.3    v=-1                [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:6.25       meas.None       finger:0 on D5  duration:0.55   v=-1                   [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:6.2        meas.None       finger:0 on D6  duration:0.55   v=-1                      [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:6.75       meas.None       finger:0 on B4  duration:1.3    v=-1                         [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:6.7        meas.None       finger:0 on B5  duration:1.3    v=-1                            [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.0        meas.None       finger:0 on C5  duration:0.4    v=-1    [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:7.95       meas.None       finger:0 on E5  duration:0.4    v=-1       [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:7.9        meas.None       finger:0 on C6  duration:0.4    v=-1          [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:7.85       meas.None       finger:0 on A4  duration:0.4    v=-1             [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.25       meas.None       finger:0 on A4  duration:0.65   v=-1                [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.2        meas.None       finger:0 on C6  duration:0.65   v=-1                   [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.15       meas.None       finger:0 on E5  duration:0.65   v=-1                      [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.1        meas.None       finger:0 on C5  duration:0.65   v=-1                         [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.75       meas.None       finger:0 on C5  duration:0.4    v=-1                            [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.7        meas.None       finger:0 on E5  duration:0.4    v=-1    [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.65       meas.None       finger:0 on C6  duration:0.4    v=-1       [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.6        meas.None       finger:0 on A4  duration:0.4    v=-1          [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:9.0        meas.None       finger:0 on C5  duration:0.65   v=-1             [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.95       meas.None       finger:0 on E-5 duration:0.65   v=-1                [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.9        meas.None       finger:0 on C6  duration:0.65   v=-1                   [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:8.85       meas.None       finger:0 on G4  duration:0.65   v=-1                      [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:9.5        meas.None       finger:0 on C5  duration:0.65   v=-1                         [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:9.45       meas.None       finger:0 on E-5 duration:0.65   v=-1                            [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:9.4        meas.None       finger:0 on C6  duration:0.65   v=-1    [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:9.35       meas.None       finger:0 on G4  duration:0.65   v=-1       [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:10.0       meas.None       finger:0 on F#4 duration:0.48333333333333334    v=-1          [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:9.95       meas.None       finger:0 on C6  duration:0.48333333333333334    v=-1             [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:9.9        meas.None       finger:0 on D5  duration:0.48333333333333334    v=-1                [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:9.85       meas.None       finger:0 on C5  duration:0.48333333333333334    v=-1                   [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:31/3       meas.None       finger:0 on G#4 duration:0.25   v=-1                      [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:10.5       meas.None       finger:0 on A4  duration:0.5    v=-1                         [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:11.0       meas.None       finger:0 on D4  duration:1.0    v=-1                            [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:12.0       meas.None       finger:0 on C4  duration:0.35   v=-1    [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:11.95      meas.None       finger:0 on E4  duration:0.35   v=-1       [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:11.9       meas.None       finger:0 on C5  duration:0.35   v=-1          [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:12.25      meas.None       finger:0 on C4  duration:0.6    v=-1             [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:12.2       meas.None       finger:0 on E4  duration:0.6    v=-1                [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:12.15      meas.None       finger:0 on C5  duration:0.6    v=-1                   [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:12.75      meas.None       finger:0 on C5  duration:0.35   v=-1                      [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:12.7       meas.None       finger:0 on E4  duration:0.35   v=-1                         [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:12.65      meas.None       finger:0 on C4  duration:0.35   v=-1                            [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:13.0       meas.None       finger:0 on C4  duration:0.6    v=-1    [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:12.95      meas.None       finger:0 on E-4 duration:0.6    v=-1       [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:12.9       meas.None       finger:0 on C5  duration:0.6    v=-1          [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:13.5       meas.None       finger:0 on C4  duration:0.6    v=-1             [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:13.45      meas.None       finger:0 on E-4 duration:0.6    v=-1                [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:13.4       meas.None       finger:0 on C5  duration:0.6    v=-1                   [0, 0, 0, 0, 0, 0, 0, 0, 0]
time:14.0       meas.None       finger:0 on C5  duration:0.6    v=-1                      [0, 0, 0, 0, 0, 0, 0, 0, 0]

@marcomusy
Copy link
Owner

Hi @Cool-Joe - thanks for reporting. That happens when the algorithm fails to find a possible combination..
I'm afraid curing it implies revising some core part of the code..

@Cool-Joe
Copy link
Author

Cool-Joe commented Jan 22, 2021

Yes, would be a good idea. There are also several "unplayable" combinations later in that song, the algorithm has to be checked.
Is the song too complex or what could be reasons? The song is not very hard to play...
I could try to fix something, but I don't understand the functionality of your code.

@marcomusy
Copy link
Owner

I still don't know the reason.. but it seems a perfect bug to hunt for.

I could try to fix something, but I don't understand the functionality of your code.

i cannot blame you... even though the code looks easy& short (~200 lines of code) it is horribly difficult to follow because the problem itself is extremely tricky ! give it a try if you wish!

@marcomusy
Copy link
Owner

I managed to spot a few problems but I couldn't really fix the original.mid file you posted.. which is strange because on a very similar test it seems to work fine:
https://github.com/marcomusy/pianoplayer/blob/master/scores/test_octaves.xml

pianoplayer scores/test_octaves.xml

image

I'll give it a second try .. but this might take a while..
In the latest release chords with >=3 notes are internally computed but not shown in the output as they are not generally reliable.
Thanks again for reporting the issue.

@Cool-Joe
Copy link
Author

Cool-Joe commented Jan 25, 2021

Thanks for the update! Seems to run a little bit better now, but we have serious other issues:
temp
In the right hand part, thumb and pinky are very often "flipped", even in simple octaves. Is that a known issue?
Thanks anyway for your effort.

@marcomusy
Copy link
Owner

that's for sure a serious issue - does that happen also in the previous version?
(to check: pip install pianoplayer==2.1.0)
Can you share the score above?
Btw what do you use for rendering the score? the fingering font looks much nicer than the musescore one :)

I need to reserve a couple of days at least to dig into the code more and see what's wrong..

@Cool-Joe
Copy link
Author

Cool-Joe commented Jan 25, 2021

The score is still the same as in my 1st post. I also tried to convert it to musicxml first, but the results were even worse.
Rendering is done by musescore, actual version.
I just tried the same with ver 2.1.0, it looks a bit different, but not much:
temp
Seems to be a good score for further testing. ;-)

@marcomusy
Copy link
Owner

thanks ... this definitely needs more work!

@marcomusy marcomusy added the bug label Jan 25, 2021
@PRamoneda
Copy link
Collaborator

mmm I think chords have to be read from down to up or up to down. However, they are read randomly

see here...
Captura de pantalla 2021-05-27 a las 16 02 42

Notseq is in the right hand..... [C, G, E].... If I change it to [C, E, G].... fingers should be [1, 3, 5] or something else...

Self assigned to me!

@PRamoneda
Copy link
Collaborator

ok, Jajaja I can not assign it to myself... but I do it in #39

@marcomusy
Copy link
Owner

@PRamoneda I added you as collaborator to the repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants