This is the home page of xml2ly, a converter from MusicXML to Lilypond.
It is a set of XSLT stylesheets, written by a non programmer who believes in the importance of
open and standard formats.
xml2ly is a set of XSLT stylesheets that convert a MusicXML file into Lilypond format.
I'm writing it because I believe in the importance of open standards and free software: MusicXML
is a chance to have one open format for music (in a similar way as it is with MathML for Mathematics,
SVG for vector graphics, XHTML for HTML and so on...) and Lilypond is an incredible piece of software
to write music.
Obviously I'm aware of the differences between those situations and the musical one, but this is
not the right place to speak about them: if you like you can go to
(which is under construction at present...)
where I'll gather my mind on the matter as well as information about musical codes I've found on the web.
Requirements and Usage
You need an XSLT processor
is written in XSLT 1.0 and uses only two Exslt extensions, which should be supported
by quite all XSLT processors.
Anyway I mostly use xsltproc, so it is possible I trust its XSLT implementation too much:
Sometimes I realize I'm using a feature not completely standard and/or correct and
in most situations I've been able to change something, but I cannot be sure to always be able to do that.
If you test xml2ly with a XSLT processor and find strange behavior, please
tell me abuout it.
If you use Linux, MacOSX with Fink or (I think) Windows with Cygwin, you can use
- as I do - xsltproc.
It is a command line utility based on libxml and libxslt: rpm or debs for your distribution
can be found anywhere.
If you don't know or understand what to do, write to me: I'll try to help you as best I can.
Simply download and expand the tarball, change the new directory
and run the XSLT processor on
xml2ly.xsl and the MusicXML
file you want to convert (relative o full path!) - in a way depending on the processor you're using.
Here is an example of what I do with xsltproc:
xsltproc --novalid xml2ly.xsl schubert.xml > schubert.ly
[in this situation schubert.xml is in the directory where xml2ly.xsl is and the output
is redirected to schubert.ly, lying in the same place: but you can specify the paths you need!!]
I suggest that you not let your processor validate the MusicXML file
[above, by the --novalid option], otherwise it will
take even more time to do the conversion!
Features and Limitations
Limitations firts :-)
But there is something working, too!
- it is sloooow...
- the lilypond output is very verbose (e.g.: pitch notation is not "relative"
- in Lilypond language - so each note has it's own octave mark,
tuplets are grouped within each bar...)
- slurs starting from a voice and ending on a different one
are not correctly handled: perhaps it is a Lilypond limitation,
I don't know whether there is any way to get around this
- the same happens with wedges (crescendo and diminuendo)
- pickup bars at the very beginning of a piece are managed in a dirty
way: silent rests are written after - not before - the first
real note: graphic result is the same, while sound output should
be wrong - not to speak of logical nonsense!
- multi-parts score
- multi-voices parts
- multi-staves parts (piano parts)
- clef and time changes
- slurs and ties
- key changes in multi-voices and multi-staves parts
- Lilypond 1.7 syntax for chords
- octave shifts
- technical indications
- cue notes
- general improvements
Some known bugs are:
- different types of tuplets within a bar should not work
- nested slurs
Download the current version
go to the
Read the ReleaseNotes in case there is something important (expecially known
incompatibilities with XSLT processors different from xsltproc)
Copyright (C) 2002 Guido Amoruso
xml2ly is licensed under the terms of the GNU General Public License Version
2 as published by the Free Software Foundation.
This gives you legal permission to copy, distribute and/or modify xml2ly under
certain conditions. Read the 'COPYING' file in the xml2ly distribution or read
the online version of the license
for more details. xml2ly is provided AS IS with NO WARRANTY OF ANY KIND,
INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
Here are some interesting links that have guided me.
Free sheet music on the Net
Here is where I started from: I was looking for free sheet chamber music,
but found only [relatively] little collections. Then I decided to
give the music world a hand by writing by myself the music I
like. But I was hardly able to turn a computer on - not to speak
about music codes, programming and so on...
Music notation codes
...so I started the trip!
Free music notation programs
And eventually I found the means that will let me gain my original goal
Music Optical Character Recognition software
This piece of software has a very accurate recognition engine and an
intelligent and logical way of use. I discovered it at the beginning
of my inquires, but in those times it could only export to Niff format:
now it exports into MusicXML, which makes it usable by Lilypond users, too.
My only regret is that there is no Linux version: its author said that it was
due to the lack of requests, so if you find my xml2ly useful, please
ask SharpEye's author for a Linux version - it is a personal thanksgiving for my program!
If you have any question, problem or suggestion you can
write to me:
I'd be very pleased to discuss musical notation issues and to hear your feedback
about my ideas.