Python classes for reading/writing/parsing MIDI files

nigel at pc714.maths.usyd.edu.au nigel at pc714.maths.usyd.edu.au
Mon Dec 10 09:28:52 EST 2001


Will Ware <wware at alum.mit.edu> writes:

> Garry Hodgson wrote:
> > i'm interested in being able to display/print sheet music from a given
> > midi file.  does anyone know:
> > 
> >      a) if any of the above packages provide for this?
> >      b) if this is a particularly hard problem?
> 
> Something to look into is a text-based music notation language called
> ABC. There is a collection of utilities called abc2midi which can
> produce both MIDI and printable sheet music in Postscript format. If
> you're running on Linux, you can use ps2pdf to convert to a PDF
> document.

Also have a look at

* http://www.lilypond.org --- lilypond is the GNU music typesetter,
  based on TeX, and advertises the midi2ly midi -> lilypond converter.

>From the docs for midi2ly....

  It is possible to record a MIDI file using a digital keyboard, and
  then convert it to .ly. However, human players are not rhythmically
  exact enough to make a MIDI to LY conversion trivial. midi2ly tries to
  compensate for these timing errors, but is not very good at this. It
  is therefore not recommended to use midi2ly for human-generated midi
  files.  Correcting the quantization mistakes of the human player takes
  a lot of time.
  
  Hackers who know about signal processing are invited to write a more
  robust midi2ly. midi2ly is written in *Python*, using a module written
  in C to parse the MIDI files.

So there you go. See also

* http://abc.sourceforge.net/abcMIDI/  --- ABC to midi and back, ABC to
  postscript. Same thing as referred to above.

* http://www.gmd.de/Misc/Music/  --- lots of TeX related links, including
  a link to midi2tex which (1) seems not have been updated since 1994 and
  (2) is based on MusicTeX, which has been superceded by the
  confusingly-similarly-named MusiXTeX. Otherwise you can apparently
  go midi -> ABC -> MusiXTeX.

* Chapter 7 of the "LaTeX Graphics Companion" (Goossens, Rahtz & Mittelbach,
  pub. Addison-Wesley) covers typesetting music in TeX, as well as some of
  the available input filters and ABC.

Nigel



More information about the Python-list mailing list