pianoplayer icon indicating copy to clipboard operation
pianoplayer copied to clipboard

Enhancement: MIDI Output with encoded fingerings

Open Cool-Joe opened this issue 3 years ago • 9 comments

Because MusicXML is nice for further editing, printing oder PDF output, but not ideal (and sometimes tricky or buggy) for automatic reading e.g. in player applications. The idea is to provide an option to output the notes to a standard MIDI file with encoded fingerings. Music21 can output MIDI easily, however I do not know which features it supports. Fingerings could be stored as text events or (what I would prefer) just use the channel information: You could easily store the fingering (1 - 10) as MIDI channel information (1 - 16), what would be ideal for further processing.

Cool-Joe avatar Jan 25 '21 16:01 Cool-Joe

Hi! I am Pedro master student at MTG (Barcelona).

Do you have some idea of how to implement this enhancement?

Maybe extending the functionality of music21 midi classes? https://github.com/cuthbertLab/music21/blob/7498a6ee3ec2592a097ac243d6042da3b85e8b3d/music21/converter/subConverters.py#L1019 https://github.com/cuthbertLab/music21/blob/7498a6ee3ec2592a097ac243d6042da3b85e8b3d/music21/pitch.py#L2447

PRamoneda avatar Mar 06 '21 17:03 PRamoneda

Hola Pedro, to be perfectly honest I wouldn't know how to do it... maybe you can get help from the maintainers of music21, if they are interested in such a feature. On the pianoplayer side it's surely far from perfect (especially for chords) and will need some improvements as soon as i find the spare time to do it :)

marcomusy avatar Mar 06 '21 17:03 marcomusy

Maybe extending the functionality of music21 midi classes?

IMHO extending music21 isn't necessary as it already can output MIDI data. Instead the encoding of key fingerings as channel information would have to be implemented inside pianoplayer.

Cool-Joe avatar Mar 07 '21 10:03 Cool-Joe

ok yeah, I understand that. However, it's needed to create the fingers with the same duration (and then, the same resolution) as the music21 generated midi. Well, I think I can do that from pianoplayer! I will try to implement it in the following weeks :D

PRamoneda avatar Mar 07 '21 11:03 PRamoneda

what is beam?

PRamoneda avatar Mar 08 '21 20:03 PRamoneda

it's the staff. Typically beam=0 is the right hand and beam=1 the left.

marcomusy avatar Mar 08 '21 20:03 marcomusy

Ok thank you so much @marcomusy! And a last question in the reader class. What is the purpose of sfasam variable. here a direct link https://github.com/marcomusy/pianoplayer/blob/735ce50f89fa27896e373264ae2488c56b579687/pianoplayer/scorereader.py#L84

I understand the meaning but not the purpose :)

PRamoneda avatar Mar 08 '21 20:03 PRamoneda

the idea here is that notes in chords are never played really simultaneously, so the time of each note in the same chords is slightly modified to make them happen in a rapid sequence with time difference 0.05.

marcomusy avatar Mar 08 '21 21:03 marcomusy

I'm late to the party, I can not really help, but I also agree with OP, this enhancement will be a great addition to the projet: it's exactly what I'm looking for. Thanks!

MaximeHoude avatar Aug 08 '21 17:08 MaximeHoude