;;;;
;;;; source file of the GNU LilyPond music typesetter
;;;;
-;;;; (c) 1998--2008 Jan Nieuwenhuizen <janneke@gnu.org>
+;;;; (c) 1998--2009 Jan Nieuwenhuizen <janneke@gnu.org>
;;;; Han-Wen Nienhuys <hanwen@xs4all.nl>
;; (use-modules (ice-9 optargs))
"Some standard subdivisions for time signatures."
(let*
((key (cons num den))
- (entry (assoc key '(((6 . 8) . (3 3))
- ((5 . 8) . (3 2))
- ((9 . 8) . (3 3 3))
- ((12 . 8) . (3 3 3 3))
- ((8 . 8) . (3 3 2))
- ))))
+ (entry (assoc key '(
+ ; Simple time signatures
+ (( 3 . 8) . (3))
+ (( 4 . 8) . (2 2))
+ ; Compound time signatures
+ (( 6 . 4) . (3 3))
+ (( 6 . 8) . (3 3))
+ (( 6 . 16) . (3 3))
+ (( 9 . 4) . (3 3 3))
+ (( 9 . 8) . (3 3 3))
+ (( 9 . 16) . (3 3 3))
+ ((12 . 4) . (3 3 3 3))
+ ((12 . 8) . (3 3 3 3))
+ ((12 . 16) . (3 3 3 3))
+ ; Some common irregular time signatures
+ (( 5 . 8) . (3 2))
+ (( 8 . 8) . (3 3 2))
+ ))))
(if entry
(cdr entry)
- '())))
-
+ '())))
+
(let* ((set1 (make-property-set 'timeSignatureFraction (cons num den)))
(beat (ly:make-moment 1 den))
(len (ly:make-moment num den))
-(defmacro-public def-grace-function (start stop)
+(defmacro-public def-grace-function (start stop . docstring)
+ "Helper macro for defining grace music"
`(define-music-function (parser location music) (ly:music?)
+ ,@docstring
(make-music 'GraceMusic
'origin location
'element (make-music 'SequentialMusic
(define-music-function (parser location arg1 arg2 ...) (arg1-type? arg2-type? ...)
...function body...)
"
- (if (and (pair? body) (pair? (car body)) (eqv? '_i (caar body)))
+(if (and (pair? body) (pair? (car body)) (eqv? '_i (caar body)))
;; When the music function definition contains a i10n doc string,
;; (_i "doc string"), keep the literal string only
(let ((docstring (cadar body))
(skip-as-needed x parser)
)))
+;;;;;;;;;;
+;;; general purpose music functions
+
+(define (shift-octave pitch octave-shift)
+ (_i "Add @var{octave-shift} to the octave of @var{pitch}.")
+ (ly:make-pitch
+ (+ (ly:pitch-octave pitch) octave-shift)
+ (ly:pitch-notename pitch)
+ (ly:pitch-alteration pitch)))
+
;;;;;;;;;;;;;;;;;
;; lyrics