When-in-Rome icon indicating copy to clipboard operation
When-in-Rome copied to clipboard

DCML>RNTXT conversion (bug). Metric distortions due to empty labels

Open johentsch opened this issue 3 years ago • 3 comments

Hi @MarkGotham and @malcolmsailor,

The m21 stream of Tchaikovsky op37a08 has a metric bump in m. 5 whose offset comes an eighth early:

{0.0} <music21.metadata.Metadata object at 0x7f402fad6d40>
{0.0} <music21.stream.Part 0x7f40dccc9d20>
    {0.0} <music21.stream.Measure 0 offset=0.0>
        {0.0} <music21.key.Key of b minor>
        {0.0} <music21.meter.TimeSignature 6/8>
        {0.0} <music21.roman.RomanNumeral i6 in b minor>
    {1.0} <music21.stream.Measure 1 offset=1.0>
        {0.0} <music21.roman.RomanNumeral i in b minor>
        {1.0} <music21.roman.RomanNumeral #viio6 in b minor>
        {2.0} <music21.roman.RomanNumeral VI6 in b minor>
    {4.0} <music21.stream.Measure 2 offset=4.0>
        {0.0} <music21.roman.RomanNumeral VI6 in b minor>
        {1.0} <music21.roman.RomanNumeral V6 in b minor>
        {2.0} <music21.roman.RomanNumeral vo6 in b minor>
    {7.0} <music21.stream.Measure 3 offset=7.0>
        {0.0} <music21.roman.RomanNumeral vo6 in b minor>
        {1.0} <music21.roman.RomanNumeral IV6 in b minor>
        {2.0} <music21.roman.RomanNumeral #viio2 in b minor>
    {10.0} <music21.stream.Measure 4 offset=10.0>
        {0.0} <music21.roman.RomanNumeral V[no5][add6] in b minor>
        {1.0} <music21.roman.RomanNumeral #viio64 in b minor>
        {1.5} <music21.roman.RomanNumeral i in b minor>
    {12.5} <music21.stream.Measure 5 offset=12.5>
        {0.0} <music21.roman.RomanNumeral VI in b minor>
        {1.0} <music21.roman.RomanNumeral iv65 in b minor>
        {1.5} <music21.roman.RomanNumeral Ger6 in b minor>

Inspecting the rntext reveals an empty label at the end of m. 4:

https://github.com/MarkGotham/When-in-Rome/blob/30b3240d8ac58b72b417cbd37523b40486e9606b/Corpus/Keyboard_Other/Tchaikovsky%2C_Pyotr/Seasons%2C_Op.37a/8/analysis.txt#L11-L13

The problem is caused by non-harmony labels such as { and seems to be happening systematically, e.g.:

https://github.com/MarkGotham/When-in-Rome/blob/30b3240d8ac58b72b417cbd37523b40486e9606b/Corpus/Keyboard_Other/Tchaikovsky%2C_Pyotr/Seasons%2C_Op.37a/7/analysis.txt#L24

The problem can easily be avoided by skipping all rows that have an empty value in the column chord while converting, e.g.

https://github.com/DCMLab/tchaikovsky_seasons/blob/b1cd416d972cca31349d348bc8383f2e16d73269/harmonies/op37a07.tsv#L45

johentsch avatar Feb 07 '23 01:02 johentsch

Thanks @johentsch for clear and detailed bug report! @malcolmsailor will you field this one over on music21, please?

MarkGotham avatar Feb 07 '23 09:02 MarkGotham

Thanks @johentsch .

@malcolmsailor this commit is a "warts and all" with several of these metric distortions included.

E.g., Piano_Sonatas/Mozart,_Wolfgang_Amadeus/K282/3/.

To replicate, run python3 -m Code.collect_convert --update_all_DCML_analyses_from_json

Thanks for all / any help.

MarkGotham avatar Feb 07 '23 16:02 MarkGotham

Classic. This issue has become a double issue, leading to predictable confusion.

  • This issue as per the title "metric distortions ..." (medium priority)
  • New issue for metadata here (low priority). I'm deleting comments about metadata from here and summarising them over there.

Both are really issues for music21 but I'm happy to use this space for working up a proposal if that helps.

MarkGotham avatar Jul 18 '23 09:07 MarkGotham