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

Arpeggios #6

Closed craigsapp closed 1 year ago

craigsapp commented 1 year ago

It would be useful to implement arpeggios in the Humdrum-to-MusicXML converter. Here is some example Humdrum data:

**kern  **kern
*part1  *part1
*staff2 *staff1
*clefF4 *clefG2
=1  =1
4C: 4E: 4G: 4cc: 4ee: 4gg:
4C:: 4E:: 4G::  4cc:: 4ee:: 4gg::
=   =
*-  *-

Expected rendering:

Screen Shot 2022-06-18 at 11 33 53 PM

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

Currently when exporting to MusicXML, there are no arpeggiations:

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

Here is the same example entered by hand in Musescore:

Screen Shot 2022-06-18 at 11 37 01 PM
MusicXML export from Musescore for the above example ```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 629.14 170.00 65.00 1 0 2 G 2 F 4 C 5 1 1 quarter down 1 E 5 1 1 quarter down 1 G 5 1 1 quarter down 1 C 5 1 1 quarter down 1 E 5 1 1 quarter down 1 G 5 1 1 quarter down 1 2 C 3 1 5 quarter down 2 E 3 1 5 quarter down 2 G 3 1 5 quarter down 2 C 3 1 5 quarter down 2 E 3 1 5 quarter down 2 G 3 1 5 quarter down 2 ```

Musescore cannot directly represent an arpeggio that spans two chords, so I created a single arpeggio on the bottom chord, and then clicked on it to move the top of the arpeggio to the other chord. The MusicXML data does not record this adjustment, so reloading into Musescore loses the cross-staff arpeggio:

Screen Shot 2022-06-18 at 11 40 22 PM

This problem is discussed in this issue: https://github.com/w3c/musicxml/issues/281

gregchapman-dev commented 1 year ago

Yes, I haven't implemented Humdrum arpeggios yet. I'll put it next on my list.

gregchapman-dev commented 1 year ago

I've started working on this.

gregchapman-dev commented 1 year ago

Well dang it, music21 doesn't support arpeggios! So I'm stuck (unless I go over there and implement that feature).

gregchapman-dev commented 1 year ago

Actively working on this (in music21 and converter21).

gregchapman-dev commented 1 year ago

Well, it works... waiting for final review and merge in music21, so I can merge my changes in converter21. You can try it if you like: the branch in converter21 is gregc/arpeggios, and the PR in music21 is PR 1337. I would note that no renderer I've tried (Musescore, Finale, Dorico) handles multi-chord arpeggios correctly when parsing MusicXML. You end up with separate arpeggio marks. But the MusicXML is correct. The elements that are supposed to go together as one big arpeggio mark, all have the same number.

gregchapman-dev commented 1 year ago

Arpeggio support has been merged into music21 (v8.0.0a9). I have merged arpeggio support into converter21 main branch, and it carefully checks for music21 support before trying anything. So this will work once music21 v8 is released and a new version of converter21 is released.

gregchapman-dev commented 1 year ago

This is all implemented. music21 v8.0.0a9 has arpeggio support, and converter21 (latest release) also has it, but it will only work if you are using music21 v8.0.0a9 or better.