From: Reinhold Kainhofer Date: Tue, 18 Nov 2008 19:16:19 +0000 (+0100) Subject: MusicXML: Add a way to force a pitch output to be in absolute pitch X-Git-Tag: release/2.11.65-1~44 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=377e93f7919c32e0f35c1f5c885e8704cbcf15b0;p=lilypond.git MusicXML: Add a way to force a pitch output to be in absolute pitch Even when we convert in relative pitch mode, some pitches will still need to be written out in absolute pitch. Examples are the arguments of \transposition or \transpose... --- diff --git a/python/musicexp.py b/python/musicexp.py index 22cfcdcd53..e0f3f52c97 100644 --- a/python/musicexp.py +++ b/python/musicexp.py @@ -271,6 +271,7 @@ class Pitch: self.alteration = 0 self.step = 0 self.octave = 0 + self._force_absolute_pitch = False def __repr__(self): return self.ly_expression() @@ -340,7 +341,7 @@ class Pitch: def ly_expression (self): str = self.ly_step_expression () - if relative_pitches: + if relative_pitches and not self._force_absolute_pitch: str += self.relative_pitch () else: str += self.absolute_pitch ()