needed_additional_definitions = []
additional_definitions = {
- "snappizzicato": """#(define-markup-command (snappizzicato layout props) ()
- (interpret-markup layout props
- (markup #:stencil
- (ly:stencil-translate-axis
- (ly:stencil-add
- (make-circle-stencil 0.7 0.1 #f)
- (ly:make-stencil
- (list 'draw-line 0.1 0 0.1 0 1)
- '(-0.1 . 0.1) '(0.1 . 1)))
- 0.7 X))))""",
-
- "eyeglasses": """eyeglassesps = #"0.15 setlinewidth
- -0.9 0 translate
- 1.1 1.1 scale
- 1.2 0.7 moveto
- 0.7 0.7 0.5 0 361 arc
- stroke
- 2.20 0.70 0.50 0 361 arc
- stroke
- 1.45 0.85 0.30 0 180 arc
- stroke
- 0.20 0.70 moveto
- 0.80 2.00 lineto
- 0.92 2.26 1.30 2.40 1.15 1.70 curveto
- stroke
- 2.70 0.70 moveto
- 3.30 2.00 lineto
- 3.42 2.26 3.80 2.40 3.65 1.70 curveto
- stroke"
-eyeglasses = \markup { \with-dimensions #'(0 . 4.4) #'(0 . 2.5) \postscript #eyeglassesps }""",
-
"tuplet-note-wrapper": """ % a formatter function, which is simply a wrapper around an existing
% tuplet formatter function. It takes the value returned by the given
% function and appends a note of given length.
if "Dolet 3.4 for Sibelius" in software:
conversion_settings.ignore_beaming = True
progress (_ ("Encountered file created by Dolet 3.4 for Sibelius, containing wrong beaming information. All beaming information in the MusicXML file will be ignored"))
+ # ditto for Dolet 3.5
+ if "Dolet 3.5 for Sibelius" in software:
+ conversion_settings.ignore_beaming = True
+ progress (_ ("Encountered file created by Dolet 3.5 for Sibelius, containing wrong beaming information. All beaming information in the MusicXML file will be ignored"))
if "Noteworthy Composer" in software:
conversion_settings.ignore_beaming = True
progress (_ ("Encountered file created by Noteworthy Composer's nwc2xml, containing wrong beaming information. All beaming information in the MusicXML file will be ignored"))
actual_type = tuplet_elt.get_actual_type ()
if actual_type:
actual_note = musicexp.Duration ()
- (actual_note.duration_log, actual_note.dots) = normal_type
+ (actual_note.duration_log, actual_note.dots) = actual_type
tsm.actual_type = actual_note
# Obtain non-default nrs of notes from the tuplet object!
display_values = {"none": None, "actual": "actual", "both": "both"}
if hasattr (tuplet_elt, "show-number"):
tsm.display_number = display_values.get (getattr (tuplet_elt, "show-number"), "actual")
- if tsm.display_number == "actual" and tsm.display_denominator:
- needed_additional_definitions.append ("tuplet-non-default-denominator")
- elif tsm.display_number == "both" and (tsm.display_numerator or tsm.display_denominator):
- needed_additional_definitions.append ("tuplet-non-default-fraction")
if hasattr (tuplet_elt, "show-type"):
- if getattr (tuplet_elt, "show-type") == "actual":
- needed_additional_definitions.append ("tuplet-note-wrapper")
tsm.display_type = display_values.get (getattr (tuplet_elt, "show-type"), None)
return tsm
ev.type = mxl_event.get_text ()
return ev
-def musicxml_snappizzicato_event (mxl_event):
- needed_additional_definitions.append ("snappizzicato")
- ev = musicexp.MarkupEvent ()
- ev.contents = "\\snappizzicato"
- return ev
-
def musicxml_string_event (mxl_event):
ev = musicexp.NoDirectionArticulationEvent ()
ev.type = mxl_event.get_text ()
#"schleifer": "?",
#"scoop": "?",
#"shake": "?",
- "snap-pizzicato": musicxml_snappizzicato_event,
+ "snap-pizzicato": "snappizzicato",
#"spiccato": "?",
"staccatissimo": (musicexp.ShortArticulationEvent, "|"), # or "staccatissimo"
"staccato": (musicexp.ShortArticulationEvent, "."), # or "staccato"
def musicxml_eyeglasses_to_ly (mxl_event):
needed_additional_definitions.append ("eyeglasses")
- return musicexp.MarkEvent ("\\eyeglasses")
+ return musicexp.MarkEvent ("\\markup { \\eyeglasses }")
def next_non_hash_index (lst, pos):
pos += 1
# treated like an ordinary note pitch
rest = n.get_maybe_exist_typed_child (musicxml.Rest)
event = musicexp.RestEvent ()
- pitch = musicxml_restdisplay_to_lily (rest)
- event.pitch = pitch
+ if options.convert_rest_positions:
+ pitch = musicxml_restdisplay_to_lily (rest)
+ event.pitch = pitch
elif n.instrument_name:
event = musicexp.NoteEvent ()
if len (endslurs) > 1:
endslurs[0].message (_ ('Cannot have two simultaneous (closing) slurs'))
# record the slur status for the next note in the loop
- if not grace:
- inside_slur = False
+ inside_slur = False
lily_ev = musicxml_spanner_to_lily_event (endslurs[0])
ev_chord.append (lily_ev)
if len (startslurs) > 1:
startslurs[0].message (_ ('Cannot have two simultaneous slurs'))
# record the slur status for the next note in the loop
- if not grace:
- inside_slur = True
+ inside_slur = True
lily_ev = musicxml_spanner_to_lily_event (startslurs[0])
ev_chord.append (lily_ev)
p.version = ('''%prog (LilyPond) @TOPLEVEL_VERSION@\n\n'''
+
-_ ("""Copyright (c) 2005--2008 by
+_ ("""Copyright (c) 2005--2009 by
Han-Wen Nienhuys <hanwen@xs4all.nl>,
Jan Nieuwenhuizen <janneke@gnu.org> and
Reinhold Kainhofer <reinhold@kainhofer.com>
dest = "convert_directions",
help = _ ("do not convert directions (^, _ or -) for articulations, dynamics, etc."))
+ p.add_option ('--nrp', '--no-rest-positions',
+ action = "store_false",
+ default = True,
+ dest = "convert_rest_positions",
+ help = _ ("do not convert exact vertical positions of rests"))
+
p.add_option ('--no-beaming',
action = "store_false",
default = True,
dest = 'output_name',
help = _ ("set output filename to FILE, stdout if -"))
p.add_option_group ('',
- description = (_ ("Report bugs via")
- + ''' http://post.gmane.org/post.php'''
- '''?group=gmane.comp.gnu.lilypond.bugs\n'''))
+ description = (
+ _ ("Report bugs via %s")
+ % 'http://post.gmane.org/post.php'
+ '?group=gmane.comp.gnu.lilypond.bugs') + '\n')
return p
def music_xml_voice_name_to_lily_name (part_id, name):