music21.converter.parseFile mutates the file

122 Views Asked by At

These simple lines are supposed to parse midi and then show me the midi that is represented by score variable:

score = music21.converter.parseFile(midi_file)
score.show('midi')

How midi looks before parsing

How midi looks after parsing. All the instruments that play are perscussion ones for some reason and notes are slightly different

For some reason the midi I get after parsing a midi and immedately reassembling it is very different from the pre-parsing midi. I can't attach midi, unfortunately.

I tried to find alternatives to converter.parseFile in the docs, but seems that I shouldn't use anything different.

1

There are 1 best solutions below

0
Jacob Walls On

Like many programs, music21 quantizes MIDI files when parsing them. You can disable this by calling converter.parse with the quantizePost=False argument. This might rule out a major source of the discrepancies.