4.3.2 Invoking musicxml2ly

MusicXML is an XML dialect for representing music notation. It is the de-facto standard for interchanging scores between notation programs. However, some of its elements are rather low-level and graphic-oriented, which makes it non-trivial (and sometimes even impossible) to automatically convert them to LilyPond.

The Python script musicxml2ly extracts notes, articulations, score structure, and lyrics from ‘part-wise’ MusicXML files, writing them to a .ly file. It is run from the command line as follows.

musicxml2ly [option]… file

Note that by ‘command line’ we mean the command line of the operating system. See Converting from other formats, for more information about this.

By default, musicxml2ly strips off the extension from file and appends .ly to construct the output file name. If file is ‘-’, the script reads from standard input (and writes to standard output) instead.

If the file called file cannot be found, file.xml, file.musicxml, and file.mxl are also tried as input files.

The following options are supported by musicxml2ly.

-a, --absolute

Convert pitches in absolute mode.

--book

Put the top-level score into a \book { ... } block. This might be useful for further processing with lilypond-book.

--ds, --dynamics-scale=factor

Scale <dynamics> elements by a non-negative factor; value 0 means to use LilyPond’s standard size for dynamics. This option might be needed for MusicXML files that use a music font like ‘Maestro’, where the size of dynamics symbols like ‘f’ or ‘p’ differ greatly from LilyPond’s ‘Emmentaler’ glyphs.

--fb --fretboards

Convert <frame> events to a separate FretBoard voice instead of markups.

-h, --help

Print usage information and a summary of all the available command-line options.

-l, --language=lang

Use lang for pitch names, e.g., deutsch for note names in German. Allowed values are the note input languages supported by LilyPond, see Note names in other languages.

--loglevel=log-level

Set the output verbosity to log-level. Possible values are NONE, ERROR, WARN, PROGRESS (which is the default), and DEBUG.

-m, --midi

Activate the MIDI block in the output LilyPond file.

--nb, --no-beaming

Do not convert beaming information, use LilyPond’s automatic beaming instead.

--nd, --no-articulation-directions

Do not convert directions (‘^’, ‘_’, or ‘-’) for articulations, dynamics, etc.

--npb, --no-page-breaks

Ignore page breaks.

--npl, --no-page-layout

Do not convert the exact page layout and breaks. This is a shortcut for options --npb, --npm, and --nsb.

--npm, --no-page-margins

Ignore page margins.

--nrp, --no-rest-positions

Do not convert exact vertical position of rests.

--nsb, --no-system-breaks

Ignore system breaks.

--nsd, --no-stem-directions

Ignore stem directions given in the MusicXML file, use LilyPond’s automatic stemming instead.

--nt, --no-tagline

Don’t emit a LilyPond tagline (at the bottom of the last page).

-o, --output=file

Set the output file name to file. If file is ‘-’, the output will be printed to standard output.

--oe, --ottavas-end-early=t[rue]/f[alse]

Expect <octave-shift> end elements before the associated <note> (as in the ‘Finale’ notation software) if value is ‘t’ (or true). Default is ‘f’ (or false).

-r, --relative

Convert pitches in relative mode (this option is set by default).

--sm, --shift-duration=value

Shift durations and time signatures by value; for example, value -1 doubles all durations, and value 1 halves them.

--sn --string-numbers=t[rue]/f[alse]

Control output of string numbers; value ‘f’ (or false) disables them. Default is ‘t’ (or true).

--tc, --tab-clef=tab-clef-name

Switch between two versions of tab clefs. Possible values for tab-clef-name are tab (the default) and moderntab.

--transpose=to-pitch

Set pitch to transpose by the interval between pitch ‘c’ and to-pitch.

-v, --verbose

Be verbose.

--version

Show version number and exit.

-z, --compressed

Input file is a compressed MusicXML file. By default, this option is active if the input file has .mxl as the extension.


LilyPond: manual d’utilització del programa v2.25.23 (development-branch).