MusicXML: Convert grace notes from MusicXML to Lilypond
Grace notes are normal <note> elements in XML, only with a <grace/>
child element. I append these notes to a special array of EventChord
and try to take care of the zero duration of grace notes (which
come before the real note and thus also create the EventChord with
duration zero!)
There is still one problem with things like beams or articulations on
grace notes (they are printed after the whole cord (not inside the
\grace!), but this is a general problem that musicxml2ly inserts
slurs, ties, beams, articulations, etc. as separate events not assigned
to any particular note/EventChord. The code should be changed to
assign these ornaments/settings directly to the note or the chord they
apply to. This would (1) get rid of e.g. triple [ with beamed chords,
(2) make it possible to combine multiple MusicXML articulations into
single lilypond articulations, (3) apply fingerings and ties to notes
inside chords rather than the whole chord, and (4) fix the grace notes.
The other problem is when a chord is used as a grace chord in MusicXML.
Due to the whole structure of musicxml2ly, this problem goes very deep
and I don't know of any way to fix this short of a big rewrite.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
In MusicXML, a rest can also have a pitch, given as
<display-step>A</display-step><display-octave>3</display-octave>
If given, convert these into ordinary lilypond pitches and print them
out as "a4 \rest" instead of "r4".
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
MusicXML: Reset measure position on backup elements, print => sys.stderr.write
-) Replace all relevant (i.e. non-testing outputs; these are still in there
in the main() functions for testing) occurrences of print by
sys.stderr.write
-) If a <backup> element is encountered (e.g. when there are two voices in
the measure), correctly reset the measure position to the desired
position after the backup.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
MusicXML: Fix regression when adding expressions like octave shifts
Octave shifts in lilypond (like in MusicXML) are not associated with a
particular note but their position in the measure. So far, I simply
inserted them like a note, but unfortunately that reset the current
starting position in the measure (needed to find the correct position
for chords). So I added a method dedicated to inserting such commands
without resetting the position (of course, pending multi-bar rests
still need to be inserted before the music command).
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
MusicXML: Cleanup of span start/end and direction, coding style
Follow Han-Wen's tips:
-) Split the type of spanners into direction (start/stop) and type
(crescendo/decrescendo, up/down octave-shifts, ...)
-) Get rid of some ifs and use dicts instead
-) Get rid of unnecessary empty cases in dicts
-) Treat hairpins like all other spanners
-) Invert logic of quoting of lyrics and header fields to always quote unless
the text consists entirely of letters.
-) Implement all durations from MusicXML
-) If an ouput filename is given, the include needs to use only the basename
of the file, not the whole path
-) Change logic of adding .xml to the input file: First try the supplied
filename, then with .xml appended and only then with xml (no dot) appended.
-) Use progress (..) for the error message when input file does not exist.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
John Mandereau [Thu, 13 Sep 2007 20:39:58 +0000 (22:39 +0200)]
Fix some French translation nitpicks and typos
- add Gilles Thibault to THANKS for his comments on Changing defaults
French translation,
- also add P.E. Brame to THANKS for his (older) suggestions on
Instrument-specific notation French translation,
- update French literature.itely.
MusicXML: No crash on note without <duration>, escape lyrics with parentheses
If lyrics syllables contain parentheses ( or ), we also need to wrap that
syllables in quotes.
It seems that some scanning applications write out some notes without a
<duration> child element. Work around this case and use a default value
instead of crashing. The user has to adjust the .ly file anyway.
MusicXML: Sample .xml files for regression and converage testing
Add sample MusicXML files generated with Finale, Rosegarden, Noteedit
and JScore to test for regressions and feature coverage. Currently,
these files are only converted to .ly files, but not processed further.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
MusicXML: Allow .xml to be left out on input files, allow .ly on output files
The output file name is assumed to be without the .ly suffix, which is
counterintuitive: As as user I would expect the option "-o test.ly" to
generate a file test.ly. However, .ly was always appended to the filename,
so remove a possible .ly suffix if given on the output filename.
Similarly, the input file name was assumed to be the full file name. In
particular with tab-completion in a shell, this means several more keystrokes.
If the input file given does not exists, I now also check if a file
exists with the .xml suffix appended. This is similar to the behavior of
lilypond, where "lilypond test" will also convert a file test.ly.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
John Mandereau [Thu, 6 Sep 2007 18:04:40 +0000 (20:04 +0200)]
Merge branch 'master' into lilypond/translation
* master:
LSR: update.
Misc small updates from bugs and mailist.
Bugfix in \showKeySignature
Put list of os-cpu back as found at http://lilypond.org/download/binaries.