]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-music-types.scm
Fix 442.
[lilypond.git] / scm / define-music-types.scm
index e9dcee38cf2bc0a02893e109c437af936888a1c1..d9a5f09ac872f35ada7bd598e54115864cf53d73 100644 (file)
@@ -32,6 +32,24 @@ to be used by the sequential-iterator"
          (make-music 'BarCheck
                      'origin location))))
 
+(define (make-ottava-set music)
+  "Set context properties for an ottava bracket."
+  (let ((octavation (ly:music-property music 'ottava-number)))
+
+    (list (context-spec-music
+          (make-apply-context
+           (lambda (context)
+             (let ((offset (* -7 octavation))
+                   (string (assoc-get octavation '((2 . "15ma")
+                                                   (1 . "8va")
+                                                   (0 . #f)
+                                                   (-1 . "8vb")
+                                                   (-2 . "15mb")))))
+               (set! (ly:context-property context 'middleCOffset) offset)
+               (set! (ly:context-property context 'ottavation) string)
+               (ly:set-middle-C! context))))
+          'Staff))))
+
 (define-public music-descriptions
   `(
     (AbsoluteDynamicEvent
@@ -80,7 +98,7 @@ Syntax: @var{note}@code{-\\arpeggio}")
 
 Syntax: @var{note}@code{x}@code{y}, where @code{x} is a direction
 (@code{^} for up or @code{_} for down), or LilyPond's choice
-(no direction specified)), and where @code{y} is an articulation
+(no direction specified), and where @code{y} is an articulation
 (such as @code{-.}, @code{->}, @code{\\tenuto}, @code{\\downbow}).
 See the Notation Reference for details.")
        (types . (general-music event articulation-event script-event))
@@ -119,6 +137,11 @@ Syntax for manual control: @code{c8-[ c c-] c8}")
        (types . (general-music event beam-forbid-event))
        ))
 
+    (BreakDynamicSpanEvent
+     . ((description . "End an alignment spanner for dynamics here.")
+       (types . (general-music break-span-event break-dynamic-span-event event))
+       ))
+
     (BendAfterEvent
      . ((description . "A drop/fall/doit jazz articulation.")
        (types . (general-music bend-after-event event))))
@@ -331,6 +354,13 @@ Note the explicit font switch.")
        (types . (general-music event note-grouping-event))
        ))
 
+    (OttavaMusic
+     . ((description . "Start or stop an ottava bracket.")
+       (iterator-ctor . ,ly:sequential-iterator::constructor)
+       (elements-callback . ,make-ottava-set)
+       (types . (general-music ottava-music))
+       ))
+
     (OverrideProperty
      . ((description . "Extend the definition of a graphical object.