]> git.donarmstrong.com Git - lilypond.git/blobdiff - ly/music-functions-init.ly
Ties: Print out a warning for unterminated ties
[lilypond.git] / ly / music-functions-init.ly
index 0e5093e8a5b8c899ba5ad5eda25d6d9957742027..4a58f05522f919b1f242735e0965bf8e0adbce65 100644 (file)
@@ -198,13 +198,14 @@ bookOutputSuffix =
    (set! book-output-suffix newsuffix)
    (make-music 'SequentialMusic 'void #t))
 
-%% why a function?
+%% \breathe is defined as a music function rather than an event identifier to
+%% ensure it gets useful input location information: as an event identifier,
+%% it would have to be wrapped in an EventChord to prevent it from being
+%% treated as a post_event by the parser
 breathe =
 #(define-music-function (parser location) ()
    (_i "Insert a breath mark.")
-   (make-music 'EventChord
-              'origin location
-              'elements (list (make-music 'BreathingEvent))))
+   (make-music 'BreathingEvent))
 
 
 
@@ -360,6 +361,21 @@ label =
                                           'page-label label))))
 
 
+language =
+#(define-music-function (parser location str) (string?)
+   (_i "Select note names language.")
+   (let ((language (assoc-get (string->symbol str)
+                             language-pitch-names
+                             '())))
+     (if (pair? language)
+        (begin
+          (if (ly:get-option 'verbose)
+              (ly:message (_ "Using ~a note names...") str))
+          (set! pitchnames language)
+          (ly:parser-set-note-names parser language))
+        (ly:warning (_ "Could not find language ~a. Ignoring.") str))
+     (make-music 'Music 'void #t)))
+
 
 makeClusters =
 #(define-music-function (parser location arg) (ly:music?)
@@ -599,6 +615,27 @@ that they share a staff.")
    (make-part-combine-music parser
                             (list part1 part2)))
 
+partcombineForce =
+#(define-music-function (location parser type once) (symbol-or-boolean? boolean?)
+   (_i "Override the part-combiner.")
+   (make-music 'EventChord
+              'elements (list (make-music 'PartCombineForceEvent
+                                          'forced-type type
+                                          'once once))))
+partcombineApart = \partcombineForce #'apart ##f
+partcombineApartOnce = \partcombineForce #'apart ##t
+partcombineChords = \partcombineForce #'chords ##f
+partcombineChordsOnce = \partcombineForce #'chords ##t
+partcombineUnisono = \partcombineForce #'unisono ##f
+partcombineUnisonoOnce = \partcombineForce #'unisono ##t
+partcombineSoloI = \partcombineForce #'solo1 ##f
+partcombineSoloIOnce = \partcombineForce #'solo1 ##t
+partcombineSoloII = \partcombineForce #'solo2 ##f
+partcombineSoloIIOnce = \partcombineForce #'solo2 ##t
+partcombineAutomatic = \partcombineForce ##f ##f
+partcombineAutomaticOnce = \partcombineForce ##f ##t
+
+
 pitchedTrill =
 #(define-music-function
    (parser location main-note secondary-note)