cuthbertLab / music21j

Javascript port of music21 -- Toolkit for Computational Musicology
Other
142 stars 40 forks source link

Two voices per staff not rendered in parallel #250

Open gregchapman-dev opened 3 months ago

gregchapman-dev commented 3 months ago

See attached MusicXML file: four vocal parts (two per staff). Musescore (and Finale) render them correctly, music21j renders them as if the two voices are interleaved as one voice, ending up with twice as many beats per measure as there should be.

Here's MuseScore (correct):

Behind_MuseScore3

Here's music21j (not correct):

Behind_music21j

Here's the MusicXML file:

Processed-2.musicxml.txt

gregchapman-dev commented 3 months ago

If you give me a pointer or two, I'd be happy to work on this.

gregchapman-dev commented 3 months ago

@mscuthbert @jacobtylerwalls Interesting! It actually plays correctly in music21j, it's just the visual rendering that's weird.

jacobtylerwalls commented 3 months ago

Have you compared the result to the same thing without a grand staff?

gregchapman-dev commented 3 months ago

Hmmm... not sure how to do that in MusicXML. I tried deleting the <part-group> elements, changing this:

  <part-list>
    <part-group number="1" type="start">
      <group-symbol>bracket</group-symbol>
      <group-barline>no</group-barline>
    </part-group>
    <score-part id="P221c7a70916db2b49fc9794328148cc3">
      <part-name />
    </score-part>
    <score-part id="P4f3444e6d4f094bc75a62ea5a2d63b59">
      <part-name />
    </score-part>
    <part-group number="1" type="stop" />
  </part-list>

to this:

  <part-list>
    <score-part id="P221c7a70916db2b49fc9794328148cc3">
      <part-name />
    </score-part>
    <score-part id="P4f3444e6d4f094bc75a62ea5a2d63b59">
      <part-name />
    </score-part>
  </part-list>

and the resulting rendering weirdness was identical.

gregchapman-dev commented 3 months ago

Oh WAIT. It's not exactly the same. Still wrong, but the first measure is improved.

NoPartGroup
gregchapman-dev commented 3 months ago

@jacobtylerwalls, any pointers? I'd really like to fix this; this style of score is 90% of what my website will be displaying/messing with.

jacobtylerwalls commented 3 months ago

Sorry, I don't plan to debug it myself in the near term. I do wonder if comparing it to a fresh example composed in Musescore without grand staves would be illuminating (rather than hand-editing the musicxml).

gregchapman-dev commented 3 months ago

No worries, I will see what I can figure out.

mscuthbert commented 3 months ago

This is what I meant by the beta status. There's no one actively working on the project. Contributions are just coming as people need them for their own projects.

gregchapman-dev commented 3 months ago

Hmmm.... I dropped this same MusicXML file on the OSMD demo site (they parse the MusicXML and use VexFlow to display it), and it has the same bug! So I'm guessing this is actually a VexFlow issue. Yikes. I'll still try to figure it out, but I'll be focused in a different direction.

mscuthbert commented 2 weeks ago

btw -- multi-voice music does work in music21j -- I use it a lot.

gregchapman-dev commented 2 weeks ago

I'm sure that's true.

I think there is something weird about the scores I am creating that is triggering Vexflow misbehavior.

As mentioned above, the MusicXML renders fine in Musescore. I have also found that export to MEI (via converter21) renders fine with Verovio.

I'll get back to this in time. I'm distracted by some other projects at the moment.

gregchapman-dev commented 2 weeks ago

If you want to close this issue, that's ok with me. It really seems like it's either my bug or Vexflow's (or both), not music21j's.