(***************************************************************************)
(****************Copyright 2015,2016,2017 Dieter Gloetzel ******************)
(***************************************************************************)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
1. Introduction
"MusicXML", ( http://www.musicxml.com/ ) originally developed by Recordare INC
and now owned by Finale ( https://www.finalemusic.com/ ), is the leading
musical data exchange format. XML2PMX provides an import facility for
sheet music stored in MusicXML format to PMX and MusiXTeX, the leading free
software for musical typesetting. Thus we are now able to import published MusicXML sources
as well as MusicXML sources created by OCR scanning,
e.g. with Sharpeye of VISIV ( http://www.visiv.co.uk ).
2. PMX
developed by Don Simons (dsimons(at)roadrunner(dot)com) is an easy to use,
yet powerful preprocessor for the musical typesetting system MusiXTeX.
http://icking-music-archive.org/software/htdocs/index.html
An excellent introduction to using PMX is
http://icking-music-archive.org/software/pmx/pmxccn.pdf
3. XML2PMX
has been developed by the author with "Oberon Plugin for Windows
Version 2.5" of ETHZ Zürich on Windows 10.
https://github.com/Spirit-of-Oberon/ETH-Oberon-PlugIn-Win32
XML2PMX is available as Windows-EXE (32 Bit) and as Linux binary (32 Bit).
XML2PMX requires a TeX, MusiXTeX and PMX installation.
For Unix please see: https://tug.org/texlive/
For Windows please see: https://miktex.org/2.9/setup
4. Coverage of MusicXML
The following MusicXML features are detected and translated to PMX:
- maximum of 24 staves/voices and 400 measures
- two voices per staff
- maximum of two staves per instrument
- notes and rests up to 64th, including tuplets and grace notes,
- maximum of 2 dots
- chords, accidentals
- some annotations like Fermata, Staccato, Tremolo etc.
- ties, slurs and beams
- definition of meter, fifths, clefs and their changes on the fly
- dynamic marks: hairpins, "ff" etc., piano damping pedal
- title and composer, and texts above or below the staff
- barlines, repeats, volta
- instrument names,
- origin of XML file copied to the resulting PMX file
- accepts Windows files (records ended by 0DX OAX)
as well as Unix files (records ended by 0AX)
- resulting PMX-file on Unix has records ended by 0AX.
- resulting PMX-file on Windows has records ended by 0DX 0AX.
5. New features:
- There is a new command line field "options",
which may contain one or several of the five letters "PDVSL"
in arbitrary sequence in upper or lower case.
- Lyrics are extracted and stored in a separate file (option L=Lyrics)
- several options for console output (P=parsed data, D=directions, V=voices, S=statistics,)
- automatic detection of pickup
- incomplete measures or voices are automatically filled with blind rests
6. Limitations
Some more elaborate situations like beams crossing staves or chords crossing staves
have not yet been covered.
7. Usage on MS Windows command line:
===================================================================
XML2PMX "xml-file with path" "pmx-file with path" "options"
===================================================================
The doublequotes are required.
"options" contains a sequence (without blanks) of one or several of
the letters "p", "d", "v", "s" and "l" .
Their meaning is the following:
_______________________________________________________________
| p | XML parser output; not recommended unless the terminal |
| | window process has enough storage |
|-------------------------------------------------------------|
| d | information on "directions" (dynamical marks etc) |
|-------------------------------------------------------------|
| v | distribution of voices over instruments and measures |
|-------------------------------------------------------------|
| s | statistics of MusicXML tags like , etc|
|-------------------------------------------------------------|
| l | for extracting lyrics in a separate file |
|_____________________________________________________________|
The generated PMX file will in general be complete and can be processed by "musixtex".
If not, you can often solve the problem with minor changes in the PMX code.
After the XML2PMX run you will find intermediate results in the
terminal window which may be helpful for debugging.
Once you have a generated PMX file with all of the notes extracted, the bulk work has been done.
It is then easy to improve the results on the PMX side.
8.1 MusicXML test data
You will find MusicXML-sources for testing under:
http://www.musicxml.com/music-in-musicxml/example-set/
The following pieces from this source (and a few more) have been tested:
- Schubert: "Ave Maria" (Ellen’s Gesang III), D. 839 "SchbAvMaSample.xml"
- Beethoven: "An die ferne Geliebte", Op. 98 "BeetAnGeSample.xml"
- Lee Actor "Prelude to a tragedy": "ActorPreludeSample.xml"
sample with 22 instruments and 41 measures
- Mahler: "Lieder eines fahrenden Gesellen", "MahlFaGe4Sample.xml"
8.2 OCR scanned sheet music
The MusicXML results from the tool Sharpeye from VISIV
(http://www.visiv.co.uk/) have been tested successfully.
Contact:
Feel free to contact me at
in order to report errors, propose improvements or
other comments.