Re: Issue 24 in mingus: MIDI loading needs to be better

44 views
Skip to first unread message

min...@googlecode.com

unread,
Jan 7, 2010, 10:12:03 PM1/7/10
to mingus...@googlegroups.com

Comment #3 on issue 24 by iammisc: MIDI loading needs to be better
http://code.google.com/p/mingus/issues/detail?id=24

I looked at the mingus MIDI loading support and realized it had absolutely
zero
support for running status, which is where midi events are chained
together. A
sequencer I'm using uses these for controller change events. I added some
support and
have uploaded a new MidiFileIn.py.

It's not pretty but it works. I haven't been able to find exact
documentation, but I
think controller change events that are specified in running status don't
have time
deltas.

Attachments:
MidiFileIn.py 13.4 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

min...@googlecode.com

unread,
May 18, 2011, 3:41:20 PM5/18/11
to mingus...@googlegroups.com
Updates:
Labels: -Milestone-Release0.5 Milestone-Release0.6

Comment #4 on issue 24 by Rhijnauwen: MIDI loading needs to be better
http://code.google.com/p/mingus/issues/detail?id=24

(No comment was entered for this change.)

min...@googlecode.com

unread,
Feb 6, 2012, 3:39:50 PM2/6/12
to mingus...@googlegroups.com

Comment #5 on issue 24 by gokcen....@gmail.com: MIDI loading needs to
be better
http://code.google.com/p/mingus/issues/detail?id=24

Any plans on committing running status support?

min...@googlecode.com

unread,
Oct 1, 2012, 7:08:58 AM10/1/12
to mingus...@googlegroups.com

Comment #6 on issue 24 by prolo...@shortcircuit.net.au: MIDI loading needs
Loading other MIDI files doesn't work for
a variety of reasons. Just bumping this Issue to
get some attention. Tried to load some MIDI files
from: http://www.schristiancollins.com/generaluser.php

min...@googlecode.com

unread,
Oct 9, 2012, 1:19:25 PM10/9/12
to mingus...@googlegroups.com

Comment #7 on issue 24 by shao...@gmail.com: MIDI loading needs to be better
http://code.google.com/p/mingus/issues/detail?id=24

I too ran into the running status problem. I wish I had come here first,
but alas, I coded up my own "fix" based on Will Ware's midi.py
(http://groups.google.com/groups?hl=en&selm=3C0F67FE.96E7CAE8%40alum.mit.edu)...see
the runningStatus parts.

It is a little smaller than the one posted in comment 3 above. It
addresses the following block in a way that prevents the block from being
hit.
" # I don't know what these events are supposed to do, but I keep finding
them.
# The parser ignores them.
if event_type < 8:
raise FormatError, "Unknown event type %d. Byte %d." % (event_type,
self.bytes_read)
"

While trying to figure out midi in python I ran across this link
(http://www.daniweb.com/software-development/python/code/216979/embed-and-play-midi-music-in-your-code-python)
which contains a midi file (FishPolka.mid) that mingus can not parse (also
attached).

The error is below...
m, bpm = mf.MIDI_to_Composition("FishPolka.mid")
File "/usr/local/lib/python2.7/dist-packages/mingus/midi/MidiFileIn.py",
line 64, in MIDI_to_Composition
header, track_data = self.parse_midi_file(file)
File "/usr/local/lib/python2.7/dist-packages/mingus/midi/MidiFileIn.py",
line 367, in parse_midi_file
events = self.parse_track(f)
File "/usr/local/lib/python2.7/dist-packages/mingus/midi/MidiFileIn.py",
line 257, in parse_track
event, chunk_delta = self.parse_midi_event(fp)
File "/usr/local/lib/python2.7/dist-packages/mingus/midi/MidiFileIn.py",
line 285, in parse_midi_event
raise FormatError, "Unknown event type %d. Byte %d." % (event_type,
self.bytes_read)
mingus.midi.MidiFileIn.FormatError: Unknown event type 4. Byte 123.


Attachments:
MidiFileIn.py 10.9 KB
FishPolka.mid 3.8 KB

min...@googlecode.com

unread,
Oct 9, 2012, 1:56:17 PM10/9/12
to mingus...@googlegroups.com

Comment #8 on issue 24 by shao...@gmail.com: MIDI loading needs to be better
http://code.google.com/p/mingus/issues/detail?id=24

There was an indent problem with a last minute edit in the version attached
above. Sorry!

Attachments:
MidiFileIn.py 11.1 KB

Reply all
Reply to author
Forward
0 new messages