]> git.donarmstrong.com Git - lilypond.git/blobdiff - ly/music-functions-init.ly
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / ly / music-functions-init.ly
index 3255290a5748bc5284e05a50a117ed2e2dcba945..b2780027c72da8200d11510756dea89e831fc1f7 100644 (file)
@@ -1,6 +1,6 @@
 % -*-Scheme-*-
 
-\version "2.7.32"
+\version "2.7.39"
 
 %% need SRFI-1 filter 
 
@@ -80,6 +80,9 @@ applyContext =
 
 shiftDurations =
 #(define-music-function (parser location dur dots arg) (integer? integer? ly:music?)
+   ""
+
+   
    (music-map
     (lambda (x)
       (shift-one-duration-log x dur dots)) arg))
@@ -104,10 +107,11 @@ displayLilyMusic =
    music)
 
 applyOutput =
-#(define-music-function (parser location proc) (procedure?)
-                (make-music 'ApplyOutputEvent 
+#(define-music-function (parser location ctx proc) (symbol? procedure?)
+                (make-music 'ApplyOutputEvent
                   'origin location
-                  'procedure proc))
+                  'procedure proc
+                  'context-type ctx))
 
 overrideProperty =
 #(define-music-function (parser location name property value)
@@ -137,8 +141,7 @@ or @code{\"GrobName\"}"
                    (if (equal?
                         (cdr (assoc 'name (ly:grob-property grob 'meta)))
                         grob-name)
-                       (set! (ly:grob-property grob property) value)
-                       )))
+                       (set! (ly:grob-property grob property) value))))
 
       context-name)))
 
@@ -204,6 +207,27 @@ cueDuring =
              'origin location))
 
 
+transposedCueDuring = #
+(define-music-function
+  (parser location what dir pitch-note main-music)
+  (string? ly:dir? ly:music? ly:music?)
+
+  "Insert notes from the part @var{what} into a voice called @code{cue},
+using the transposition defined by @var{pitch-note}.  This happens
+simultaneously with @var{main-music}, which is usually a rest.  The
+argument @var{dir} determines whether the cue notes should be notated
+as a first or second voice."
+
+  (make-music 'QuoteMusic
+             'element main-music
+             'quoted-context-type 'Voice
+             'quoted-context-id "cue"
+             'quoted-music-name what
+             'quoted-voice-direction dir
+             'quoted-transposition (pitch-of-note pitch-note)
+             'origin location))
+
+
 quoteDuring = #
 (define-music-function
   (parser location what main-music)
@@ -214,7 +238,6 @@ quoteDuring = #
              'origin location))
 
 
-
 pitchedTrill =
 #(define-music-function
    (parser location main-note secondary-note)
@@ -435,3 +458,32 @@ parenthesize =
 
    (set! (ly:music-property arg 'parenthesize) #t)
    arg)
+
+
+featherDurations=
+#(define-music-function (parser location factor argument) (ly:moment? ly:music?)
+
+   "Rearrange durations in ARGUMENT so there is an
+acceleration/deceleration. "
+   
+   (let*
+       ((orig-duration (ly:music-length argument))
+       (multiplier (ly:make-moment 1 1)))
+
+     (music-map 
+      (lambda (mus)
+       (if (and (eq? (ly:music-property mus 'name) 'EventChord)
+                (< 0 (ly:moment-main-denominator (ly:music-length mus))))
+           (begin
+             (ly:music-compress mus multiplier)
+             (set! multiplier (ly:moment-mul factor multiplier)))
+           )
+       mus)
+      argument)
+
+     (ly:music-compress
+      argument
+      (ly:moment-div orig-duration (ly:music-length argument)))
+
+     argument))
+