Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a option to ignore unknown event type. #97

Open
elonzh opened this issue Mar 27, 2022 · 0 comments
Open

Give a option to ignore unknown event type. #97

elonzh opened this issue Mar 27, 2022 · 0 comments

Comments

@elonzh
Copy link

elonzh commented Mar 27, 2022

I tried to open the file with jazz-soft/JZZ, mido/mido and other MID players, everything looks good.

Maybe the parser has some usability issue?

MID file:

Mondstadt.mid.zip

...
File ~\AppData\Local\pypoetry\Cache\virtualenvs\venti-EiNbpQ-n-py3.9\lib\site-packages\mingus\midi\midi_file_in.py:276, in MidiFile.parse_track(self, fp)
    274 (delta_time, chunk_delta) = self.parse_varbyte_as_int(fp)
    275 chunk_size -= chunk_delta
--> 276 (event, chunk_delta) = self.parse_midi_event(fp)
    277 chunk_size -= chunk_delta
    278 events.append([delta_time, event])

File ~\AppData\Local\pypoetry\Cache\virtualenvs\venti-EiNbpQ-n-py3.9\lib\site-packages\mingus\midi\midi_file_in.py:303, in MidiFile.parse_midi_event(self, fp)
    300 # I don't know what these events are supposed to do, but I keep finding
    301 # them. The parser ignores them.
    302 if event_type < 8:
--> 303     raise FormatError(
    304         "Unknown event type %d. Byte %d." % (event_type, self.bytes_read)
    305     )
    307 # Meta events can have strings of variable length
    308 if event_type == 0x0F:

FormatError: Unknown event type 3. Byte 60.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant