Skip to content

Ignore/Remove percussion clefs when preprocessing MusicXML files #79

@napulen

Description

@napulen

It seems that when a MusicXML file has a percussion part, the content of that part will be interpreted as nonsensical pitch content
image

{0.0} <music21.instrument.Instrument 'P10: Drumset: Acoustic Bass Drum'>
{0.0} <music21.stream.Measure 1 offset=0.0>
    {0.0} <music21.layout.SystemLayout>
    {0.0} <music21.layout.StaffLayout distance 104.07, staffNumber 1, staffSize None, staffLines None>
    {0.0} <music21.clef.PercussionClef>
    {0.0} <music21.key.KeySignature of no sharps or flats>
    {0.0} <music21.meter.TimeSignature 4/4>
    {0.0} <music21.note.Rest rest>
{4.0} <music21.stream.Measure 2 offset=4.0>
    {0.0} <music21.stream.Voice 1>
        {0.0} <music21.note.Rest rest>
        {1.0} <music21.note.Rest rest>
        {1.5} <music21.note.Rest rest>
        {1.75} <music21.note.Rest rest>
        {1.875} <music21.note.Rest rest>
        {1.9375} <music21.note.Rest rest>
        {1.9688} <music21.note.Note C>
        {2.0} <music21.chord.Chord C4 C4>
        {3.0} <music21.note.Note C>
    {0.0} <music21.stream.Voice 2>
        {0.0} <music21.note.Rest rest>
        {2.0} <music21.note.Rest rest>
        {3.0} <music21.note.Note C>
    ...

I am not sure how many edge cases one can run into for this.

For now, I think catching parts with a PercussionClef object in them and removing them from the score should be a safe preprocessing step.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions