]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-music-types.scm
new file.
[lilypond.git] / scm / define-music-types.scm
index 2ad125ac172aa50ebe993fb60d9a77f23b407279..757e9e3a1eee9ce876d1e9efccd6c3d984c3290d 100644 (file)
@@ -7,6 +7,20 @@
 
 ;; TODO: should link back into user manual.
 
+(define (mm-rest-child-list music)
+  "Check if we have R1*4-\\markup { .. }, and if applicable convert to
+a property set for MultiMeasureRestNumber."
+  (let ((location (ly:music-property music 'origin))
+       (duration (ly:music-property music 'duration)))
+    (list (make-music 'BarCheck
+                     'origin location)
+         (make-event-chord (cons (make-music 'MultiMeasureRestEvent
+                                             'origin location
+                                             'duration duration)
+                                 (ly:music-property music 'articulations)))
+         (make-music 'BarCheck
+                     'origin location))))
+
 (define-public music-descriptions
   `(
     (AbsoluteDynamicEvent
@@ -30,14 +44,13 @@ Call the argument with all current grobs during interpreting phase.
 
 Syntax
 
-\\applyoutput FUNC
+\\applyOutput #'Context FUNC
 
 arguments to func are 1. the grob, 2. the originating context,
 3. context where FUNC is called.
 
 ")
-       (iterator-ctor . ,ly:output-property-music-iterator::constructor)
-       (types . (general-music layout-instruction))
+       (types . (general-music event layout-instruction))
        ))
     (ArpeggioEvent 
      . (
@@ -91,10 +104,15 @@ Syntax for manual control:
 c8-[ c c-] c8")
        (types . (general-music event beam-event span-event))
        ))
+
+    (BendAfterEvent
+     . ((description . "A drop/fall/doit jazz articulation")
+       (types . (general-music bend-after-event event))))
+
     (BreakEvent
      . (
        (description .  "Create a line break, Syntax: \\break or page break, Syntax: \\pagebreak.")
-
+       
        (types . (general-music break-event event))
        ))
     (BreathingSignEvent
@@ -161,7 +179,12 @@ Syntax: @var{note}\\cr
        (types . (general-music extender-event event))
        ))
 
-    
+    (Event
+     . (
+       (description .  "Atomic music event.")
+       (types . (general-music event))
+       ))
+        
     (EventChord
      . (
        (description .  "Internally used to group a set of events.")
@@ -171,6 +194,7 @@ Syntax: @var{note}\\cr
        (types . (general-music event-chord simultaneous-music))
        ))
 
+    
     (FingerEvent
      . (
        (description . "Specify what finger to use for this note.")
@@ -233,17 +257,10 @@ Syntax: @var{note}\\laissezVibrer.")
        (span-type . ligature)
        (types . (general-music span-event ligature-event event))
        ))
-    
-    (OldLyricCombineMusic
+    (LineBreakEvent
      . (
-       (description .  "Align lyrics to the start of notes.
-
-Syntax @var{\\oldaddlyrics }@var{music} @var{lyrics}.")
-
-       (types . (general-music lyric-combine-music))
-       (length-callback . ,ly:lyric-combine-music::length-callback)
-       (start-callback . ,ly:music-sequence::first-start-callback)
-       (iterator-ctor . ,ly:old-lyric-combine-music-iterator::constructor)
+       (description .  "Allow, forbid or force a line break.")
+       (types . (general-music break-event event))
        ))
     
     (LyricCombineMusic
@@ -284,26 +301,22 @@ e.g. @code{\\mark \"A\"}.")
 Syntax: @code{c4\\melisma d\\melismaEnd}.")
        (types . (general-music melisma-span-event event))
        ))
-    
-    (MultiMeasureRestEvent
+
+    (MultiMeasureRestMusic
      . (
        (description . "Rests that may be compressed into Multi rests. 
 
 Syntax
-@code{R2.*4} for 4 measures in 3/4 time. Note the capital R.")
-       (types . (general-music event rhythmic-event multi-measure-rest-event))
+@code{R2.*4} for 4 measures in 3/4 time.")
+       (iterator-ctor . ,ly:sequential-iterator::constructor)
+       (elements-callback . ,mm-rest-child-list)
+       (types . (general-music multi-measure-rest))
        ))
-    
-    (MultiMeasureRestMusicGroup
-     . (
-       (description .  "Like sequential-music, but specifically intended
-to group start-mmrest, skip, stop-mmrest sequence. 
 
-Syntax @code{R2.*5} for 5 measures in 3/4 time.")
-       (length-callback . ,ly:music-sequence::cumulative-length-callback)
-       (start-callback . ,ly:music-sequence::first-start-callback)
-       (iterator-ctor . ,ly:sequential-music-iterator::constructor)
-       (types . (general-music sequential-music))
+    (MultiMeasureRestEvent
+     . (
+       (description . "Used internally by MultiMeasureRestMusic to signal rests")
+       (types . (general-music event rhythmic-event multi-measure-rest-event))
        ))
     
     (MultiMeasureTextEvent
@@ -324,22 +337,9 @@ Syntax
     (NoteEvent
      . (
        (description .  "A note.")
-
        (types . (general-music event note-event rhythmic-event melodic-event))
        ))
     
-    (OutputPropertySetMusic
-     . (
-       (description .  "Set grob properties in objects
-individually. 
-
-Syntax @code{\\outputproperty @var{predicate} @var{prop}
-= @var{val}}.")
-
-       (iterator-ctor . ,ly:output-property-music-iterator::constructor)
-       (types . (general-music layout-instruction))
-       ))
-    
     (OverrideProperty
      . (
        (description .  "Extend the definition of a graphical object.
@@ -351,6 +351,16 @@ SYNTAX
        (types . (general-music layout-instruction))
        (iterator-ctor . ,ly:push-property-iterator::constructor)
        ))
+    (PageBreakEvent
+     . (
+       (description .  "Allow, forbid or force a page break.")
+       (types . (general-music break-event event))
+       ))
+    (PageTurnEvent
+     . (
+       (description .  "Allow, forbid or force a page turn.")
+       (types . (general-music break-event event))
+       ))
     (PartCombineMusic
      . (
        (description .  "Combine two parts on a staff, either merged or
@@ -384,7 +394,13 @@ Syntax: @code{\\property @var{context}.@var{prop} = @var{scheme-val}}.")
        (types . (layout-instruction general-music))
        (iterator-ctor . ,ly:property-unset-iterator::constructor)
        ))
-    
+
+    (PercentEvent
+     . (
+       (description .  "Used internally to signal percent repeats.")
+       (types . (general-music event percent-event))
+       ))
+
     (PesOrFlexaEvent
      . (
        (description .  "Within a ligature, mark the previous and the
@@ -419,12 +435,6 @@ goes down).")
        (description . "Ties for starting a second volta bracket.")
        (types . (general-music event repeat-tie-event))
        ))
-    (Event
-     . (
-       (description .  "Atomic music event.")
-       (types . (general-music event))
-       ))
-    
     (RestEvent
      . (
        (description .  "A Rest. 
@@ -451,7 +461,8 @@ Syntax \\sequential @{..@} or simply @{..@} .")
 
        (length-callback . ,ly:music-sequence::cumulative-length-callback)
        (start-callback . ,ly:music-sequence::first-start-callback)
-       (iterator-ctor . ,ly:sequential-music-iterator::constructor)
+       (elements-callback . ,(lambda (m) (ly:music-property m 'elements)))
+       (iterator-ctor . ,ly:sequential-iterator::constructor)
        (types . (general-music sequential-music))
        ))
 
@@ -521,6 +532,16 @@ Syntax NOTE(        and NOTE) ")
        (types . (general-music span-event event trill-span-event))
        ))
     
+    (TransposedMusic
+     . (
+       (description .  "Music that has been transposed.")
+       (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
+       (start-callback . ,ly:music-wrapper::start-callback)
+       (length-callback . ,ly:music-wrapper::length-callback)
+       (to-relative-callback . ,ly:relative-octave-music::no-relative-callback)
+       (types . (music-wrapper-music general-music transposed-music))
+       ))
+
     (TimeScaledMusic
      . (
        (description .  "Multiply durations, as in tuplets. 
@@ -533,16 +554,12 @@ Syntax @code{\\times @var{fraction} @var{music}}, e.g.
        (iterator-ctor . ,ly:time-scaled-music-iterator::constructor)
        (types . (time-scaled-music music-wrapper-music general-music))
        ))
-    
-    (TransposedMusic
+
+    (TupletEvent
      . (
-       (description .  "Music that has been transposed.")
-       (iterator-ctor . ,ly:music-wrapper-iterator::constructor)
-       (start-callback . ,ly:music-wrapper::start-callback)
-       (length-callback . ,ly:music-wrapper::length-callback)
-       (to-relative-callback . ,ly:relative-octave-music::no-relative-callback)
-       (types . (music-wrapper-music general-music transposed-music))
-       ))
+       (description .  "Used internally to signal where tuplet brackets start and stop.")
+       (types . (tuplet-spanner-event span-event event general-music))
+       ))
 
     (UnrelativableMusic
      . (
@@ -593,6 +610,11 @@ Syntax: @code{s}@var{duration}")
 
        (types . (general-music event rhythmic-event skip-event))
        ))
+
+    (SpacingSectionEvent
+     . ((description . "Start a new spacing section")
+       (types . (general-music event spacing-section-event))))
+     
     (SpanEvent
      . (
        (description .  "Event for anything that is started at a different time than stopped.")
@@ -649,6 +671,12 @@ Syntax: @code{\\@var{number}}.")
        (types . (general-music event tremolo-event))
        ))
     
+    (TremoloSpanEvent
+     . (
+       (description . "Tremolo over two stems")
+       (types . (general-music event span-event tremolo-span-event))
+       ))
+
     (VoiceSeparator
      . (
        (description .  "Separate polyphonic voices in simultaneous music.