+ if self.display_bracket == None:
+ 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.newline ()
+
+ base_number_function = {None: "#f",
+ "actual": "tuplet-number::calc-denominator-text",
+ "both": "tuplet-number::calc-fraction-text"}.get (self.display_number, None)
+ # If we have non-standard numerator/denominator, use our custom function
+ if self.display_number == "actual" and self.display_denominator:
+ base_number_function = "(tuplet-number::non-default-tuplet-denominator-text %s)" % self.display_denominator
+ elif self.display_number == "both" and (self.display_denominator or self.display_numerator):
+ if self.display_numerator:
+ num = self.display_numerator
+ else:
+ num = "#f"
+ if self.display_denominator:
+ den = self.display_denominator
+ else:
+ den = "#f"
+ base_number_function = "(tuplet-number::non-default-tuplet-fraction-text %s %s)" % (den, num)
+
+
+ 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\")" %
+ (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 \\omit TupletNumber")
+ func.newline ()
+ elif self.display_number == "both":
+ den_duration = self.normal_type.ly_expression (None, True)
+ # If we don't have an actual type set, use the normal duration!
+ if self.actual_type:
+ num_duration = self.actual_type.ly_expression (None, True)
+ 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\")" %
+ (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\")" %
+ (den_duration, num_duration))
+ func.newline ()
+ else:
+ if self.display_number == None:
+ func ("\\once \\omit TupletNumber")
+ func.newline ()
+ elif self.display_number == "both":
+ func ("\\once \\override TupletNumber.text = #%s" % base_number_function)
+ func.newline ()
+