gregchapman-dev / converter21

A music21-based music notation file format converter CLI app, and some new sub converter plug-ins
Other
16 stars 1 forks source link

Voices/staves in multi-staff parts #5

Closed craigsapp closed 1 year ago

craigsapp commented 1 year ago

The voice/staff assignments for the Humdrum-to-MusicXML converter needs to be adjusted to allow import into Dorico. Otherwise, the voice/staff system being used is non-standard, although Musescore can understand it. The problem is that the voice numbers should be unique and not repeated for each staff in a multi-staff part. The traditional way of doing this in Finale export is to assign voices 1-4 to staff 1, and voices 5-8 to staff 2. In other words, the first voice on staff 2 is voice 5 (where you are reusing voice 1 on staff 2 as a different voice than voice 1 on staff 1).

For this Humdrum data:

**kern  **kern
*clefF4 *clefG2
=1  =1
4C  4cc
4D  4dd
4E  4ee
4F  4ff
=   =
*-  *-

The expected rendering is:

Screen Shot 2022-06-18 at 10 44 56 PM

https://verovio.humdrum.org?t=KiprZXJuCSoqa2VybgoqY2xlZkY0CSpjbGVmRzIKPTEJPTEKNEMJNGNjCjRECTRkZAo0RQk0ZWUKNEYJNGZmCj0JPQoqLQkqLQo=

Here is the current MusicXML conversion:

Click to view MusicXML conversion of above Humdrum data. ```xml 2022-06-18 7 40 1 2 G 2 F 4 C 5 1 1 quarter 1 D 5 1 1 quarter 1 E 5 1 1 quarter 1 F 5 1 1 quarter 1 4 C 3 1 1 quarter 2 D 3 1 1 quarter 2 E 3 1 1 quarter 2 F 3 1 1 quarter 2 regular ```

Rendering in Musescore is mostly correct:

Screen Shot 2022-06-18 at 10 44 48 PM

although there is a problem with one staff having a final barline and the other a single barline (they should both be single barlines).

Click to view MusicXML data from Musescore ```xml MuseScore 3.6.0 2022-06-18 7 40 1697.14 1200 85.7143 85.7143 85.7143 85.7143 85.7143 85.7143 85.7143 85.7143 1 1 78.7402 0 64.90 579.58 170.00 65.00 1 0 2 G 2 F 4 C 5 1 1 quarter down 1 D 5 1 1 quarter down 1 E 5 1 1 quarter down 1 F 5 1 1 quarter down 1 4 C 3 1 5 quarter up 2 D 3 1 5 quarter down 2 E 3 1 5 quarter down 2 F 3 1 5 quarter down 2 ```

Musescore likes to assign 4 voices to each staff, with staff 1 containing voices 1-4, and staff 2 with voices 5 -8 (This is similar to Finale). So the best situation would be to start with voice 5 as the first voice on a second staff of a two-staff part, rather than calling it voice 1 on staff 2.


In Dorico, there is a significant rendering problem:

Screen Shot 2022-06-18 at 10 43 53 PM

Dorico prioritizes the <voice> element over the <staff>, and it is seeing two notes for the same voice at the same time, so it is merging them into a chord as illustrated above. Here is the same music entered by hand in Dorico:

Screen Shot 2022-06-18 at 10 56 28 PM
Click to view MusicXML export from Dorico ```xml Untitled Project 3 Flow 1 Dorico 4.0.31.1060 2022-06-18 Piano 4 0 none 0 none 2 G 2 F 4 C 5 4 1 quarter down 1 D 5 4 1 quarter down 1 E 5 4 1 quarter down 1 F 5 4 1 quarter down 1 16 C 3 4 2 quarter up 2 D 3 4 2 quarter down 2 E 3 4 2 quarter down 2 F 3 4 2 quarter down 2 ```

Dorico is creating a voice 1 on staff 1 and voice 2 on staff 2 when it exports to MusicXML.

Here is the Musescore MusicXML export loaded into Dorico, which renders as expected:

Screen Shot 2022-06-18 at 11 15 12 PM
gregchapman-dev commented 1 year ago

This is a music21 bug (written up in music21 issue # 1335) for which I have proposed PR # 1336. Please track this bug there. Thank you for the report!

gregchapman-dev commented 1 year ago

I am re-opening this. I am working on a music21 fix (that's the right place for it, in music21's MusicXML writer), but I can work around this in converter21 as well (for music21 v7), so I'll keep this issue open for that work.

gregchapman-dev commented 1 year ago

music21 v8 (currently in alpha) fixes this. Keeping this open to work around it in converter21.

gregchapman-dev commented 1 year ago

music21 v8 shipped a few months back, and this is completely fixed there.