%%%% This file is part of LilyPond, the GNU music typesetter.
%%%%
-%%%% Copyright (C) 2003--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+%%%% Copyright (C) 2003--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
%%%% Jan Nieuwenhuizen <janneke@gnu.org>
%%%%
%%%% LilyPond is free software: you can redistribute it and/or modify
"Barcheck failed got ~a expect ~a"
cbn n))))))
+beamExceptions =
+#(define-scheme-function (parser location music) (ly:music?)
+ (_i "Extract a value suitable for setting
+@code{Timing.beamExceptions} from the given pattern with explicit
+beams in @var{music}. A bar check @code{|} has to be used between
+bars of patterns in order to reset the timing.")
+ (extract-beam-exceptions music))
+
bendAfter =
#(define-event-function (parser location delta) (real?)
(_i "Create a fall or doit of pitch interval @var{delta}.")
breathe =
#(define-music-function (parser location) ()
(_i "Insert a breath mark.")
- (make-music 'BreathingEvent))
+ (make-music 'BreathingEvent
+ 'midi-length
+ (lambda (len context)
+ ;;Shorten by half, or by up to a second, but always by a power of 2
+ (let* ((desired (min (ly:moment-main (seconds->moment 1 context))
+ (* (ly:moment-main len) 1/2)))
+ (scale (inexact->exact (ceiling (/ (log desired) (log 1/2)))))
+ (breath (ly:make-moment (expt 1/2 scale))))
+ (ly:moment-sub len breath)))))
clef =
#(define-music-function (parser location type) (string?)
displayLilyMusic =
-#(define-music-function (parser location music) (ly:music?)
+#(define-music-function (parser location port music) ((output-port?) ly:music?)
(_i "Display the LilyPond input representation of @var{music}
-to the console.")
- (newline)
- (display-lily-music music parser)
+to @var{port}, defaulting to the console.")
+ (let ((port (or port (current-output-port))))
+ (newline port)
+ (display-lily-music music parser port))
music)
displayMusic =
-#(define-music-function (parser location music) (ly:music?)
- (_i "Display the internal representation of @var{music} to the console.")
- (newline)
- (display-scheme-music music)
+#(define-music-function (parser location port music) ((output-port?) ly:music?)
+ (_i "Display the internal representation of @var{music} to
+@var{port}, default to the console.")
+ (let ((port (or port (current-output-port))))
+ (newline port)
+ (display-scheme-music music port))
music)
displayScheme =
-#(define-scheme-function (parser location expr) (scheme?)
- (_i "Display the internal representation of @var{expr} to the console.")
- (newline)
- (display-scheme-music expr)
+#(define-scheme-function (parser location port expr) ((output-port?) scheme?)
+ (_i "Display the internal representation of @var{expr} to
+@var{port}, default to the console.")
+ (let ((port (or port (current-output-port))))
+ (newline port)
+ (display-scheme-music expr port))
expr)
a music expression, the result is the same music expression with an
appropriate tweak applied.")
(if (ly:music? item)
- #{ \tweak #property #(offsetter property offsets) #item #}
- (if (check-grob-path item parser location
- #:default 'Bottom
- #:min 2
- #:max 2)
- #{
- \override #item . #property =
- #(offsetter property offsets)
- #}
- (make-music 'Music))))
-
+ ; In case of a tweak, grob property path is Grob.property
+ (let ((prop-path (check-grob-path
+ (if (symbol? property)
+ (list property)
+ property)
+ parser location
+ #:start 1 #:default #t #:min 2 #:max 2)))
+ (if prop-path
+ ; If the head of the grob property path is a symbol--i.e.,
+ ; a grob name, produce a directed tweak. Otherwise, create
+ ; an ordinary tweak.
+ (if (symbol? (car prop-path))
+ #{
+ \tweak #prop-path #(offsetter (second prop-path) offsets) #item
+ #}
+ #{
+ \tweak #(second prop-path) #(offsetter (second prop-path) offsets) #item
+ #})
+ item))
+ ; In case of an override, grob property path is Context.Grob.property.
+ (let ((prop-path (check-grob-path
+ (append item
+ (if (symbol? property)
+ (list property)
+ property))
+ parser location
+ #:default 'Bottom #:min 3 #:max 3)))
+ (if prop-path
+ #{
+ \override #prop-path = #(offsetter (third prop-path) offsets)
+ #}
+ (make-music 'Music)))))
+
omit =
#(define-music-function (parser location item) (symbol-list-or-music?)
(_i "Set @var{item}'s @samp{stencil} property to @code{#f},