]> git.donarmstrong.com Git - lilypond.git/blobdiff - python/musicexp.py
MusicXML: Add a way to force a pitch output to be in absolute pitch
[lilypond.git] / python / musicexp.py
index 22cfcdcd53888461e0020fd778ed0eae861b8cf2..e0f3f52c979ab50e5a97e85842af2fbe697bc19c 100644 (file)
@@ -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 ()