X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fparser-clef.scm;h=a731e7459e7e6a38e6f796998d3f3b12b3852122;hb=0129fb74b0957a277e6eb01f89046e1f46bf7777;hp=757a1876defd38f44c724c9b84ef8daf07c4d0d8;hpb=8070ef6b831ac4da4bd4881cded96b1af2ccadfc;p=lilypond.git diff --git a/scm/parser-clef.scm b/scm/parser-clef.scm index 757a1876de..a731e7459e 100644 --- a/scm/parser-clef.scm +++ b/scm/parser-clef.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 2004--2010 Han-Wen Nienhuys +;;;; Copyright (C) 2004--2011 Han-Wen Nienhuys ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -74,6 +74,7 @@ ("petrucci-c5" . ("clefs.petrucci.c5" 4 0)) ("petrucci-f3" . ("clefs.petrucci.f" 0 0)) ("petrucci-f4" . ("clefs.petrucci.f" 2 0)) + ("petrucci-f5" . ("clefs.petrucci.f" 4 0)) ("petrucci-f" . ("clefs.petrucci.f" 2 0)) ("petrucci-g" . ("clefs.petrucci.g" -2 0)))) @@ -105,7 +106,7 @@ ("clefs.petrucci.g" . -4))) (define-public (make-clef-set clef-name) - "Generate the clef setting commands for a clef with name CLEF-NAME." + "Generate the clef setting commands for a clef with name @var{clef-name}." (define (make-prop-set props) (let ((m (make-music 'PropertySet))) (map (lambda (x) (set! (ly:music-property m (car x)) (cdr x))) props) @@ -143,9 +144,70 @@ (sort (map car supported-clefs) stringnumber (match:substring match 3)) 1))))) + (set! e (assoc-get clef-name supported-clefs)) + (if e + (let* ((musics (map make-prop-set + `(((symbol . cueClefGlyph) (value . ,(car e))) + ((symbol . middleCCuePosition) + (value . ,(+ oct + (cadr e) + (assoc-get (car e) c0-pitch-alist)))) + ((symbol . cueClefPosition) (value . ,(cadr e))) + ((symbol . cueClefOctavation) (value . ,(- oct)))))) + (recalc-mid-C (make-music 'ApplyContext)) + (seq (make-music 'SequentialMusic + 'elements (append musics (list recalc-mid-C)))) + (csp (make-music 'ContextSpeccedMusic))) + (set! (ly:music-property recalc-mid-C 'procedure) ly:set-middle-C!) + (context-spec-music seq 'Staff)) + (begin + (ly:warning (_ "unknown clef type `~a'") clef-name) + (ly:warning (_ "supported clefs: ~a") + (string-join + (sort (map car supported-clefs) string