From: Reinhold Kainhofer Date: Fri, 4 Apr 2008 17:39:44 +0000 (+0200) Subject: MusicXML: Convert to lilypond X-Git-Tag: release/2.11.44-1~37^2 X-Git-Url: https://git.donarmstrong.com/lilypond.git?a=commitdiff_plain;h=b5c384a4a44449decd630a48eb3c7a33ffffcfe8;p=lilypond.git MusicXML: Convert to lilypond Lilypond does not have its own eyeglasses articulation, but one can simply draw it in postscript and insert that in musicxml2ly... --- diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index e8ae92c219..155697ff3a 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -52,14 +52,28 @@ additional_definitions = { (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 - ) - ) - ) -)""" + '(-0.1 . 0.1) '(0.1 . 1))) + 0.7 X))))""", + "eyeglasses": """eyeglassesps = #"0.15 setlinewidth +% 255 0 0 setrgbcolor +-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 }""" } def round_to_two_digits (val): @@ -1144,6 +1158,10 @@ def musicxml_rehearsal_to_ly_mark (mxl_event): ev = musicexp.MarkEvent ("\\markup { %s }" % text) return ev +def musicxml_eyeglasses_to_ly (mxl_event): + needed_additional_definitions.append ("eyeglasses") + return musicexp.MarkEvent ("\\eyeglasses") + # translate directions into Events, possible values: # -) string (MarkEvent with that command) # -) function (function(mxl_event) needs to return a full Event-derived object @@ -1153,7 +1171,7 @@ directions_dict = { 'coda' : (musicexp.MusicGlyphMarkEvent, "coda"), # 'damp' : ??? # 'damp-all' : ??? -# 'eyeglasses': ?????? + 'eyeglasses': musicxml_eyeglasses_to_ly, # 'harp-pedals' : # 'image' : # 'metronome' :