AlbertHart / ahlbapps_old

osmd_transpose is a .js file, (and .htm for testing) to transpose MusicXML files. osmd_transpose is a function to be used with OSMD - Open Sheet Music Display - an Open Source JavaScript engine to display and MusicXML using VexFlow.
https://alhartapps.com/osmd_transpose/transpose/transpose.htm
2 stars 3 forks source link

Stem Direction #13

Open AlbertHart opened 4 years ago

AlbertHart commented 4 years ago

I am going to rework my logic on Stem Direction - especially for staffs with multiple voices.

Here is a current xml_transpose output. Several of the stems are not correct, so I am going to rework the stem logic.

image

I found a pretty good article yesterday on the rules for stem directions, and I was planning to rework stem logic this week. Besides using the rules properly, I also need to process stems by staff and voice. Currently I am not processing them properly for pieces with two voices.

https://steinberg.help/dorico/v2/en/dorico/topics/notation_reference/notation_reference_stems_direction_c.html

Several of the rules want to look ahead at future notes, I am not going to look ahead yet because it is much easier to remember notes we have seen already rather than upcoming noites,

ice6 commented 4 years ago

Several of the rules want to look ahead at future notes, I am not going to look ahead yet because it is much easier to remember notes we have seen already rather than upcoming noites.

maybe post process concept can make it easier to implement.

loop 1 to parse all the information you need to deal with stem.

loop 2 to do it.

only rough idea :)

AlbertHart commented 4 years ago

I asked my teacher about stem positions today. He didn't really care about the look ahead for quarter notes, but he did think we needed to look ahead for beam groups, and choose the direction which matches the most notes in the beam group.

However, I just tested this with MuseScore and they do not follow the rule properly. The third beam group should have stems going up, because two of the three notes are below the middle line of the staff.

image

As you suggest, I can read the entire string (file) and store the information I need, and then read it again to process it. That will work pretty well.

Also, I entered a simple phrase in MuseScore and then transposed it in MuseScore, and Musescore did not handle stems well at all.

image

But just because other programs don't do a good job, doesn't mean that we can't do a better job.

I'll plan to add the look ahead by reading the entire scode, and storing the look-ahead values for beam groups and quarter notes.