How to obtain stem direction from plugin?

• Mar 25, 2016 - 11:55

Hello,

I'm some familiar with MuseScore and recently tried some score analysis from MuseScore2 plugin.
I know to obtain the chords (in terms of a plugin) and they have a stem property. But how can I obtain the stem direction (up/down) from it?

What I want to achieve is some voice splitting where there's only one voice available in MuseScore terms.
What I have is a SATB score obtained from Capella Scan where SA and TB share a staff.
Capella Scan can only split S and A or T and B if the S and T notes/chords have stem up, and the S and B notes/chords have stem down. But in my score this varies.
When importing into MuseScore via XML, consequently this shows up as correctly splitted voices for sections with different stem directions but just chords for one voice for sections with single stem direction.

So I wonder If I could do some voice splitting according to rules which also applies to humans when they sing from the score:
- for chords with stems of different direction, the stem up chord belongs to upper voice and the stem down chord belongs to lower voice
- for chords with one stem the upper note belongs to upper voice and the lower note belongs to lower voice

Thanks for your ideas!

Michael


Comments

In reply to by Jojo-Schmitz

> stemDirection() is not exposed to the plugin Framework

Thank you, I expected this answer. Would be nice to have this in a future version.

> But maybe you can walk the score and all chords with 2 notes change the lower note to voice 2?

Yes, of course. For most parts of the score this will become the correct result. There are few cases where the upper voice falls below the lower. These notes have to be corrected manually.

Do you still have an unanswered question? Please log in first to post your question.