music-encoding / sibmei

Sibelius MEI Plugin
MIT License
39 stars 16 forks source link

Export fingering information #85

Open sonovice opened 7 years ago

sonovice commented 7 years ago

It would be nice to be able to export entered fingering information to the corresponding <fing> elements, see http://music-encoding.org/documentation/3.0.0/fing/

PRamoneda commented 3 years ago

Hi! First of all thank you for the development of this fantastic plugin!

I am very interested in this topic. How much time do do you think is needed to solve this problem? I have not experience working with ManuScript but I can learn it. I don't understand very well the Sibelius format (.sib files). Are the fingers associated with the notes in the .sib ?

ahankinson commented 3 years ago

The best place to look for the answer would be in the ManuScript documentation. That largely determines the data that can be pulled out of a score:

http://resources.avid.com/SupportFiles/Sibelius/2018.1/Sibelius_2018.1_ManuScript_Language_Guide.pdf

You would probably want to start by looking at the GuitarFrame objects. There is very minimal support for these objects in the current plugin:

https://github.com/music-encoding/sibmei/blob/9ba25171c51bde172ce448f2405336d7ab64ea08/src/ExportGenerators.mss#L670-L673

Which generates a <harm> element:

https://github.com/music-encoding/sibmei/blob/9ba25171c51bde172ce448f2405336d7ab64ea08/src/ExportGenerators.mss#L1770-L1782

I would suggest that any investigations start there?

th-we commented 3 years ago

Are we talking about textual fingerings here or about GuitarFrame fingerings? If we're talking about textual ones, the way to go is to register a new text handler for the style ID text.staff.space.fingering here:

https://github.com/music-encoding/sibmei/blob/e9dab0e48bf580d6169ab58eb60bc943bd1af992/src/TextHandler.mss#L10-L20

th-we commented 3 years ago

Or for text.staff.space.fingering.guitar. Not sure if GuitarFrames can actually show fingerings.

PRamoneda commented 3 years ago

Hi!!

Thank you so much for your answers! I am thinking about the textual fingerings (for example in the piano scores). And the idea would be to associate each of the fingers to the note which annotates.

I have seen uses of the harm annotations in the humdrum format. And yes! It would be a perfect way to annotate each note with her finger. RegisterHandlers could work too.

What I am not pretty sure is about if ManuScript will allow me to get each finger with his note associated easily. Or the "API" only will allow me to get each thing separately. Do you know, for example, if is easy to get "coordinates" of the (textual) fingers and the notes on the score?

As you can see I am not very familiarized with ManuScript but I can learn! . Do you know it is possible to do that? My plan, later, is to use that information with music21. And of course, I will PR this to this project whatever I add to the plugin!

Thank you so much for your time!

ahankinson commented 3 years ago

I think the answer is "it depends". Quite a lot of the Sibelius objects are visually placed, not necessarily attached to notes. If the fingerings are attached to the note or a chord then you should be able to get the data pretty precisely.

If they are not, you will need to use some of the magic methods that have been developed in this plugin to try and infer them. The GetNoteObjectAtPosition method is worth exploring here:

https://github.com/music-encoding/sibmei/blob/develop/src/Utilities.mss#L216

PRamoneda commented 3 years ago

I think that the fingers are not associated with the notes... They are "floating" in the score or "visually placed". In this scenario do you see the association difficult?

ahankinson commented 3 years ago

Not difficult, but probably somewhat error-prone. The plugin does a best-guess, but it may not always get it right.

PRamoneda commented 3 years ago

Ok, Thank you so much! I will evaluate what to do!