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.
MusicXML: Fine-tune chord detection in combination with dynamics
When trying to find the corresponding notes for notes with the <chord>
indicator, we need to skip all dynamics, but must not cross bar lines. In
particular, since we now also add dynamics events, we cannot automatically
take the last event, but have to look for the last EventChord.
Also some small bug fixes (need to quote texts with _, missing param in dead
code, style, etc.)
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
In my cleanup I accidentally removed the Staff entry from the dict, which
caused all PianoStaff objects to not be detected (as it checked for the
Staff class, which was not generated whn marshalling the xml)
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
In lyrics, use \skip4 to indicate a note has not syllable attached. So far,
I had "", which caused lilypond to print out several warnings "cannot align
on self: empty element".
As lilypond seems to ignore the time attached to a \skip (but requires some
time indiation), I simply use 4.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
MusicXML: Fix issues with dynamics attached to notes (not measure position)
-) Implement the missing musicxml_dynamics_to_lily_event function (simply
moving code around!), so that dynamics attached to a single note (as
opposed to given in a <direction> element) are also correctly converted.
-) When we convert unknown dynamics texts using \markup, we need to prepend
"-".
-) Handle multiple <direction-type> children in a <direction> element.
Fix the conversion of chords from MusicXML to lilypond. The problem was
that the #text entries in the XML tree (converted to a musicxml.Hash_text
python instance) messed up the tracking of the current positions
in Part.interpret. As soon as these children are ignored, the original
algorithm to assign measure positions works again.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
MusicXML: Always quote texts (header, lyrics) that contain periods or commas
While lyrics syllables might contain periods or commas without requiring
quotes around the syllables, header fields need quotes. Wrap the quotes
around just to make sure for the lyrics and to fix header fields.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
MusicXML: Convert all clefs, escape " in header fields, code simplification
-) Extend the ClefChange class to convert all different clefs (G,C,F,
percussion,tab) to the corresponding lilypond clef names. MusicXML
also allows a "None" key, which lilypond does not :-(
-) In the header fields and the lyrics, escape all quotes by \". Only
wrap the whole string in quotes if it is necessary (string contains
numbers, spaces, quotes, or starts with a period or comma). This makes
it much easier to edit the lyrics later on.
-) Several coding style issued pointed out by Han-Wen
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>
MusicXML: Conversion of various types of spanners (octave, pedals, trills)
-) Implement Octave-shift (8va, 8vb, 15ma, 15mb) and pedal spanners
-) Implement trill spanners. It seems that in MusicXML, a trill span does
not include the trill sign, so they are duplicated in many cases.
-) Attempt to implement dashed slurs. Does not work yet, because the
corresponding \slurDashed needs to be before the note, which the
current code structure does not allow.
-) Implement Glissando. Explicitly setting the type to wavy does not
work yet, because that command needs to be before the note in lilypond
which is not yet supported by the structure of the musicxml2ly
application.
-) Implement bends ("-\bendAfter #nr" in lilypond)
-) Use short notation where appropriate for articulations (e.g.
"-." instead of "\staccato" or "->" instead of "\accent")
Open problem:
In MusicXML, a trill span consists of a trill sign plus a wavy-line spanner,
while in Lilypond \startTrillSpan will create both. This means that in the
future musicxml2ly needs to be changed to combine various kinds of Events.
Also, MusicXML allows a trill spanner to start and end at the same note,
which is not possible in lilypond.
Signed-off-by: Reinhold Kainhofer <reinhold@kainhofer.com>