X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=python%2Fmusicexp.py;h=e8cbcb016769301209d51af8a4f8283537959b37;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=40b58c81f48598e229e12cb4fbac2642b3b02e48;hpb=1ad144eca54df3c4e5f43b555c01606e0cfd82b6;p=lilypond.git diff --git a/python/musicexp.py b/python/musicexp.py index 40b58c81f4..e8cbcb0167 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -341,6 +341,10 @@ def pitch_italiano (pitch): def pitch_catalan (pitch): return pitch_italiano (pitch) +def pitch_francais (pitch): + str = pitch_generic (pitch, ['do', 'ré', 'mi', 'fa', 'sol', 'la', 'si'], ['b', 'sb', 'sd', 'd']) + return str + def pitch_espanol (pitch): str = pitch_generic (pitch, ['do', 're', 'mi', 'fa', 'sol', 'la', 'si'], ['b', None, None, 's']) return str @@ -358,8 +362,10 @@ def set_pitch_language (language): "norsk": pitch_norsk, "svenska": pitch_svenska, "italiano": pitch_italiano, + "français": pitch_francais, "catalan": pitch_catalan, "espanol": pitch_espanol, + "español": pitch_espanol, "vlaams": pitch_vlaams} pitch_generating_function = function_dict.get (language, pitch_general) @@ -589,11 +595,11 @@ class TimeScaledMusic (MusicWrapper): def print_ly (self, func): if self.display_bracket == None: - func ("\\once \\override TupletBracket #'stencil = ##f") + func ("\\once \\omit TupletBracket") func.newline () elif self.display_bracket == "curved": ly.warning (_ ("Tuplet brackets of curved shape are not correctly implemented")) - func ("\\once \\override TupletBracket #'stencil = #ly:slur::print") + func ("\\once \\override TupletBracket.stencil = #ly:slur::print") func.newline () base_number_function = {None: "#f", @@ -617,12 +623,12 @@ class TimeScaledMusic (MusicWrapper): if self.display_type == "actual" and self.normal_type: # Obtain the note duration in scheme-mode, i.e. \longa as \\longa base_duration = self.normal_type.ly_expression (None, True) - func ("\\once \\override TupletNumber #'text = #(tuplet-number::append-note-wrapper %s \"%s\")" % + func ("\\once \\override TupletNumber.text = #(tuplet-number::append-note-wrapper %s \"%s\")" % (base_number_function, base_duration)) func.newline () elif self.display_type == "both": # TODO: Implement this using actual_type and normal_type! if self.display_number == None: - func ("\\once \\override TupletNumber #'stencil = ##f") + func ("\\once \\omit TupletNumber") func.newline () elif self.display_number == "both": den_duration = self.normal_type.ly_expression (None, True) @@ -632,20 +638,20 @@ class TimeScaledMusic (MusicWrapper): else: num_duration = den_duration if (self.display_denominator or self.display_numerator): - func ("\\once \\override TupletNumber #'text = #(tuplet-number::non-default-fraction-with-notes %s \"%s\" %s \"%s\")" % + func ("\\once \\override TupletNumber.text = #(tuplet-number::non-default-fraction-with-notes %s \"%s\" %s \"%s\")" % (self.display_denominator, den_duration, self.display_numerator, num_duration)) func.newline () else: - func ("\\once \\override TupletNumber #'text = #(tuplet-number::fraction-with-notes \"%s\" \"%s\")" % + func ("\\once \\override TupletNumber.text = #(tuplet-number::fraction-with-notes \"%s\" \"%s\")" % (den_duration, num_duration)) func.newline () else: if self.display_number == None: - func ("\\once \\override TupletNumber #'stencil = ##f") + func ("\\once \\omit TupletNumber") func.newline () elif self.display_number == "both": - func ("\\once \\override TupletNumber #'text = #%s" % base_number_function) + func ("\\once \\override TupletNumber.text = #%s" % base_number_function) func.newline () func ('\\times %d/%d ' % @@ -892,7 +898,6 @@ class Paper: printer.newline () printer.dump ('\\paper {') printer.newline () - printer.dump ("markup-system-spacing #'padding = #2") printer.newline () self.print_length_field (printer, "paper-width", self.page_width) self.print_length_field (printer, "paper-height", self.page_height) @@ -1225,7 +1230,7 @@ class GlissandoEvent (SpanEvent): "wavy" : "zigzag" }. get (self.line_type, None) if style: - printer.dump ("\\once \\override Glissando #'style = #'%s" % style) + printer.dump ("\\once \\override Glissando.style = #'%s" % style) def ly_expression (self): return {-1: '\\glissando', 1:''}.get (self.span_direction, '') @@ -1355,7 +1360,12 @@ class TextEvent (Event): return { 1: '^', -1: '_', 0: '-' }.get (self.force_direction, '-') def ly_expression (self): - base_string = '%s\"%s\"' + # self.text will be enclosed by quotes, and the direction + # modifier must be separated from the opening quote by a space. + # This is so that subsequent line breaking for the output file + # using utilities.split_string_and_preserve_doublequoted_strings() + # properly detects the opening quote. + base_string = '%s \"%s\"' if self.markup: base_string = '%s\markup{ ' + self.markup + ' {%s} }' return base_string % (self.direction_mod (), self.text) @@ -1524,7 +1534,7 @@ class NotestyleEvent (Event): #class changed by DaLa: additional attribute color return return_string def pre_note_ly (self, is_chord_element): if self.style and is_chord_element: - return "\\tweak #'style #%s" % self.style + return "\\tweak style #%s" % self.style else: return '' def ly_expression (self): @@ -1863,7 +1873,7 @@ class TimeSignatureChange (Music): if self.style == "common": st = "\\defaultTimeSignature" elif (self.style != "'()"): - st = "\\once \\override Staff.TimeSignature #'style = #%s " % self.style + st = "\\once \\override Staff.TimeSignature.style = #%s " % self.style elif (self.style != "'()") or is_common_signature: st = "\\numericTimeSignature" @@ -1962,9 +1972,9 @@ class StaffLinesEvent (Music): self.lines = lines def ly_expression (self): if (self.lines > 0): - return "\\stopStaff \\override Staff.StaffSymbol #'line-count = #%s \\startStaff" % self.lines + return "\\stopStaff \\override Staff.StaffSymbol.line-count = #%s \\startStaff" % self.lines else: - return "\\stopStaff \\revert Staff.StaffSymbol #'line-count \\startStaff" + return "\\stopStaff \\revert Staff.StaffSymbol.line-count \\startStaff" class TempoMark (Music): def __init__ (self): @@ -2147,7 +2157,7 @@ class StaffGroup: if self.instrument_name or self.short_instrument_name: printer.dump ("\\consists \"Instrument_name_engraver\"") if self.spanbar == "no": - printer.dump ("\\override SpanBar #'transparent = ##t") + printer.dump ("\\hide SpanBar") brack = {"brace": "SystemStartBrace", "none": "SystemStartBar", "line": "SystemStartSquare"}.get (self.symbol, None) @@ -2161,7 +2171,7 @@ class StaffGroup: self.print_ly_context_mods (printer) for m in self.context_modifications: printer.dump (m) - printer.dump ("} <<") + printer.dump ("}") printer.newline () #print a single << after StaffGroup only when the with-block is not needed. #This doesn't work. << is printed before and after StaffGroup!