- (if (= octavation 0)
- (let ((where (ly:context-property-where-defined context 'middleCPosition))
- (oc0 (ly:context-property context 'originalCentralCPosition)))
- (ly:context-set-property! context 'middleCPosition oc0)
- (ly:context-unset-property where 'originalCentralCPosition)
- (ly:context-unset-property where 'ottavation))
- (let* ((where (ly:context-property-where-defined context 'middleCPosition))
- (c0 (ly:context-property context 'middleCPosition))
- (new-c0 (+ c0 (* -7 octavation)))
- (string (cdr (assoc octavation '((2 . "15ma")
- (1 . "8va")
- (0 . #f)
- (-1 . "8vb")
- (-2 . "15mb"))))))
- (ly:context-set-property! context 'middleCPosition new-c0)
- (ly:context-set-property! context 'originalCentralCPosition c0)
- (ly:context-set-property! context 'ottavation string)))))
+ (begin
+ (if (number? (ly:context-property context 'originalMiddleCPosition))
+ (let ((where (ly:context-property-where-defined context 'middleCPosition)))
+
+ (ly:context-set-property! context 'middleCPosition
+ (ly:context-property context 'originalMiddleCPosition))
+ (ly:context-unset-property where 'originalMiddleCPosition)
+ (ly:context-unset-property where 'ottavation)))
+ot
+ (let* ((where (ly:context-property-where-defined context 'middleCPosition))
+ (c0 (ly:context-property context 'middleCPosition))
+ (new-c0 (+ c0 (* -7 octavation)))
+ (string (cdr (assoc octavation '((2 . "15ma")
+ (1 . "8va")
+ (0 . #f)
+ (-1 . "8vb")
+ (-2 . "15mb"))))))
+ (ly:context-set-property! context 'middleCPosition new-c0)
+ (ly:context-set-property! context 'originalMiddleCPosition c0)
+ (ly:context-set-property! context 'ottavation string)))))