Han-Wen Nienhuys <[EMAIL PROTECTED]> writes: > I think it would also be better if the code just used numbers, and does > a (format "~a" NUMBER) or (number->string NUMBER) in the end.
Here it is. I also made Graham's suggestion of switching the numbers, like (compound-time grob 3 16 5 8). This is a very cool example (thanks Henrik!). I think the ultimate would be to merge the 2 functions and or detect the behavior automatically or have it passed as a keyword (like compound-time :equal-div) Pedro ------------------------------------------------------------------------ \version "2.7.7" #(define (compound-time grob one divone two divtwo) (let ((hmoveDivOne (if (equal? divone 16) 0.6 0.0)) (hmoveDivTwo (if (equal? divtwo 16) 0.6 0.0)) (hmoveLastCol (if (equal? divtwo 16) -0.6 -0.3)) (one-string (number->string one)) (two-string (number->string two)) (divone-string (number->string divone)) (divtwo-string (number->string divtwo))) (interpret-markup (ly:grob-layout grob) '(((baseline-skip . 2) (word-space . 1.5) (font-family . number))) (markup #:line (#:column ((#:translate (cons hmoveDivOne 0) one-string) divone-string) #:lower 1 (#:translate (cons hmoveDivOne 0) "+") (#:translate (cons hmoveLastCol 0) #:column ((#:translate (cons hmoveDivTwo 0) two-string) divtwo-string))))))) #(define (compound-time-equal-div grob one two divone) (let ((hmoveDiv (if (equal? divone 16) -0.8 -0.1)) (one-string (number->string one)) (two-string (number->string two)) (divone-string (number->string divone))) (interpret-markup (ly:grob-layout grob) '(((baseline-skip . 2) (word-space . 1.4) (font-family . number))) (markup (#:line (one-string (#:column ("+" (#:translate (cons hmoveDiv 0.) divone-string))) (#:translate (cons -0.2 0) two-string))))))) \score { \new Staff << { \time 13/16 \override Staff.TimeSignature #'print-function = #(lambda (grob) (compound-time grob 3 16 5 8)) s16*13 | \time 13/16 \override Staff.TimeSignature #'print-function = #(lambda (grob) (compound-time grob 5 8 8 16)) s16*13 | \time 13/16 \override Staff.TimeSignature #'print-function = #(lambda (grob) (compound-time grob 5 16 8 16)) s16*13 | \time 13/16 \override Staff.TimeSignature #'print-function = #(lambda (grob) (compound-time-equal-div grob 5 8 16)) s16*13 | \time 13/8 \override Staff.TimeSignature #'print-function = #(lambda (grob) (compound-time-equal-div grob 5 8 8)) s8*13 | } >> } ------------------------------------------------------------------------ _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user