The MIDI block currently provides components to generate XMidi from a MIDI file, and to serialize XMidi back to a MIDI file. XMidi is an XML format that was developed several years ago by Peter Loeb (see http://www.palserv.com/XMidi/ for more information about the original code).

There are also simple XSLT stylesheets to perform transposition and inversion.

Future plans include:

  1. Create more difficult transformers of the XMidi, e.g. retrograde etc.
  2. Create some XMidi to SVG transformers so that graphical (e.g. Western musical notation, or Schenkerian analysis perhaps!) representations of MIDI files can be rapidly generated.

The MIDI format itself provides very little presentation information thus limiting the scope of my second aim, but this block could well provide the catalyst for developments that encompass other XML formats for music (such as MusicXML, NIFF XML, MusicML, or perhaps a new markup for music).

Usage

To use the X!MidiGenerator you must declare it as usual in your sitemap's <map:components> section thus:

{{{<map:components>

</map:components>}}}

To use the X!MidiGenerator in your own pipelines just specify the location of the MIDI file in the src attribute of the <map:generate> element. To serialize the XMidi back to MIDI just use the serializer in the normal way. The following pipeline generates a SAX stream representation in XMidi, and then serializes it back to MIDI: a round trip. I'll leave it to you to create the transformations that make this useful!

{{{<map:match pattern="prelude.xmi">

</map:match>}}}

Sample XMidi

{{{<?xml version="1.0" standalone="yes"?> <XMidi VERSION="1.2">

</XMidi>}}}

MIDI (last edited 2009-09-20 23:42:06 by localhost)