("neo_mensural_c2" . ("clefs-neo_mensural_c" -2 0))
("neo_mensural_c3" . ("clefs-neo_mensural_c" 0 0))
("neo_mensural_c4" . ("clefs-neo_mensural_c" 2 0))
- ("petrucci_c1" . ("clefs-petrucci_c" -4 0))
- ("petrucci_c2" . ("clefs-petrucci_c" -2 0))
- ("petrucci_c3" . ("clefs-petrucci_c" 0 0))
- ("petrucci_c4" . ("clefs-petrucci_c" 2 0))
- ("petrucci_c5" . ("clefs-petrucci_c" 4 0))
+ ("petrucci_c1" . ("clefs-petrucci_c1" -4 0))
+ ("petrucci_c2" . ("clefs-petrucci_c2" -2 0))
+ ("petrucci_c3" . ("clefs-petrucci_c3" 0 0))
+ ("petrucci_c4" . ("clefs-petrucci_c4" 2 0))
+ ("petrucci_c5" . ("clefs-petrucci_c5" 4 0))
("petrucci_f" . ("clefs-petrucci_f" 2 0))
("petrucci_g" . ("clefs-petrucci_g" -2 0))
)
("clefs-mensural_f" . 4)
("clefs-mensural_g" . -4)
("clefs-neo_mensural_c" . 0)
- ("clefs-petrucci_c" . 0)
+ ("clefs-petrucci_c1" . 0)
+ ("clefs-petrucci_c2" . 0)
+ ("clefs-petrucci_c3" . 0)
+ ("clefs-petrucci_c4" . 0)
+ ("clefs-petrucci_c5" . 0)
("clefs-petrucci_f" . 4)
("clefs-petrucci_g" . -4)
)
)
-(define (clef-name-to-properties cl)
+(define-public (make-clef-set cl)
+ "Generate the clef setting commands for a clef with name CL."
+ (define (make-prop-set props)
+ (let*
+ (
+ (m (make-music-by-name 'PropertySet))
+ )
+
+ (map (lambda (x) (ly:set-mus-property! m (car x) (cdr x))) props)
+ m
+ ))
+
(let ((e '())
(c0 0)
(oct 0)
(set! e (assoc cl supported-clefs))
-
+
(if (pair? e)
- `(((symbol . clefGlyph)
- (iterator-ctor . ,Property_iterator::constructor)
- (value . ,(cadr e))
- )
+ (let*
+ (
+ (musics (map make-prop-set
- ((symbol . centralCPosition)
- (iterator-ctor . ,Property_iterator::constructor)
- (value . ,(+ oct (caddr e) (cdr (assoc (cadr e) c0-pitch-alist))))
- )
- ((symbol . clefPosition)
- (iterator-ctor . ,Property_iterator::constructor)
- (value . ,(caddr e))
- )
- ((symbol . clefOctavation)
- (iterator-ctor . ,Property_iterator::constructor)
- (value . ,(- oct))
- )
+ `(((symbol . clefGlyph)
+ (value . ,(cadr e))
+ )
+ ((symbol . centralCPosition)
+ (value . ,(+ oct (caddr e) (cdr (assoc (cadr e) c0-pitch-alist))))
+ )
+ ((symbol . clefPosition)
+ (value . ,(caddr e))
+ )
+ ((symbol . clefOctavation)
+ (value . ,(- oct))
+ )
+ )))
+ (seq (make-music-by-name 'SequentialMusic))
+ (csp (make-music-by-name 'ContextSpeccedMusic))
+ )
+
+ (ly:set-mus-property! seq 'elements musics)
+ (ly:set-mus-property! csp 'element seq)
+ (ly:set-mus-property! csp 'context-type "Staff")
+
+ csp
)
(begin
- (ly-warn (string-append "Unknown clef type `" cl "'\nSee scm/lily.scm for supported clefs"))
- '())
+ (ly:warn (format "Unknown clef type `~a'
+See scm/lily.scm for supported clefs" cl))
+ (make-music-by-name 'Music)
+
+ )
)))
-
-