bug-lilypond
[Top][All Lists]

## Re: musicxml2ly bar-line support

 From: Reinhold Kainhofer Subject: Re: musicxml2ly bar-line support Date: Sun, 12 Oct 2008 23:32:29 +0200 User-agent: KMail/1.9.10

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am Sonntag, 12. Oktober 2008 schrieb Valentin Villenave:
> hiding/modifying bar lines; it seems that this is not fully supported
> yet, as (reportedly) demonstrated by the attached files.

Actually, this not a problem with bar line styles. The

<barline location="right">
<bar-style>none</bar-style>
</barline>

elements of the MusicXML file are correctly converted to
\bar ""
in Lilypond...
This can also be seen in the hidden bar lines at the beginning of each stanza.

The issue is rather the different handling of measure length of lilypond and
MusicXML. The MusicXML file uses one measure (of variable length) for each
stanza.

Now, the issue is as following: In MusicXML a measure consists of everything
between <measure ...> ... </measure>, no matter how long/short the timing of
the contents is and how many beats this measure contains. The first file
(Psalm_bar-lines_1.xml) for example contains 10 double beats (quartes and
half notes summing up to 10 half notes) in the first measure, and 9 double
beats in the remaining measures.
However, it does NOT contain any time signatures. MusicXML treats those 9 or
10 double beats as one long measure, but LilyPond uses a default time
signature of 4/4 if no time signature is given (the .xml file does not
contain any time signature, of course).
So when processing the .ly file, LilyPond internally splits a stanza like

g2 a4 b4 c2 r2 c2 b4 a4 b4 c4 a2 g2 r2 \bar "" % 0

up into 5 measures with 4 beats when processing the file, while MusicXML
treats it as one large measure and does not keep track of any timing
information...
It's these additional bar lines that make it look like musicxml2ly would not
support barline styles.

The file Psalm_bar-lines_2.xml inserts the correct time signatures, so that
lilypond uses the same measure lengths as the .xml file and no measures are
split internally in lilypond. If you look at the .pdf file, you'll see that
now there are really no bar lines present.

Unfortunately, i don't see any way to work around this different understanding
of how measure work in MusicXML and LilyPond...

You might want to take a look at cadenzas, though, in the LilyPond
Documentation:
http://kainhofer.com/~lilypond/Documentation/user/lilypond/Displaying-rhythms.html#Unmetered-music

If you add \cadenzaOn at the beginning of the music defined in the
PartPOneVoiceOne variable, you'll get exactly what you want. (Actually,
musicxml2ly writes out an additional bar number check (the "|" characters on
a line on their own), which does not make sense inside a cadenza, so either
you delete those pipe symbols or you live with the warnings that LilyPond
generates for them.

Also note that things like line or page breaks are NOT converted from MusicXML
to LilyPond, since LilyPond will do the page layout itself, so trying to
force the same line breaks as the file in Finale will in most cases simply

I hope this clears up a little bit...

Cheers,
Reinhold

- --
- ------------------------------------------------------------------
Reinhold Kainhofer, Vienna University of Technology, Austria
* Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
* K Desktop Environment, http://www.kde.org, KOrganizer maintainer
* Chorvereinigung "Jung-Wien", http://www.jung-wien.at/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFI8mzuTqjEwhXvPN0RAhSCAKDQQEZrQYZo1rwRZIw+Kp0TlLXqGwCgyre4
wHpD2GrEykzE6QBoDLKbbj0=
=B3FW
-----END PGP SIGNATURE-----