Hey lilypond-users, Before I put this on the LSR, please play around with this. Specifically, please
1) Make it less sprawling. 2) Find anything that's broken (the below examples work). 3) Change layout to better-suit your wind-playing needs. 4) Make any and all layout or coding suggestions. THANK YOU!!! ~Mike \version "2.13.0" #(define (make-number-bcl layout props fsize stretch offset val) (ly:stencil-translate (ly:text-interface::interpret-markup layout props (make-general-align-markup X RIGHT (make-general-align-markup Y DOWN ( markup #:abs-fontsize fsize val)))) (cons (* -0.5 stretch ) (* offset stretch) ) ) ) #(define (make-named-bcl inl outmk biglist) (if (eqv? 0 (length inl)) outmk (begin (set! outmk (append outmk (if (list-ref inl 0) (list-ref biglist 0) (list (markup #:null))) )) (make-named-bcl (cdr inl) outmk (cdr biglist)) ) ) ) #(define-markup-command (multiphonic layout props inl) (list?) (let* ( ;radius of the circles (radius (list-ref inl 0)) ;font size, grows and shrinks with radius (fsize (* radius 12)) ;degree of stretch of the holes as a function of radius size. Make 0.0 to 0.5 for good results. (spread (list-ref inl 1)) (stretch (+ (* 2 radius) (* spread radius)) ) ;more or less the approximation from the bible (PI 3.14159265) ;list of left keys (lbiglist (list (list (markup #:abs-fontsize fsize "B")) (list (markup #:abs-fontsize fsize "F") (markup #:abs-fontsize fsize #:raise 1 #:fontsize -2 #:sharp)) (list (markup #:abs-fontsize fsize "E")) (list (markup #:abs-fontsize fsize "E") (markup #:abs-fontsize fsize #:raise 1 #:fontsize -2 #:flat)) (list (markup #:abs-fontsize fsize "G") (markup #:abs-fontsize fsize #:raise 1 #:fontsize -2 #:sharp)) (list (markup #:abs-fontsize fsize "F")) ) ) ;list of right keys (rbiglist (list (list (markup #:abs-fontsize fsize "A")) (list (markup #:abs-fontsize fsize "G") (markup #:abs-fontsize fsize #:raise 1 #:fontsize -2 #:sharp)) (list (markup #:abs-fontsize fsize "E") (markup #:abs-fontsize fsize #:raise 1 #:fontsize -2 #:flat)) (list (markup #:abs-fontsize fsize "C") (markup #:abs-fontsize fsize #:raise 1 #:fontsize -2 #:sharp)) (list (markup #:abs-fontsize fsize "F")) (list (markup #:abs-fontsize fsize "E")) (list (markup #:abs-fontsize fsize "F") (markup #:abs-fontsize fsize #:raise 1 #:fontsize -2 #:sharp)) ) ) ;bools for the fill/non-fill holes (h0 (list-ref inl 2)) (h1 (list-ref inl 3)) (h2 (list-ref inl 4)) (h3 (list-ref inl 5)) (h4 (list-ref inl 6)) (h5 (list-ref inl 7)) (h6 (list-ref inl 8)) (rkey (list-ref inl 9)) ;necessary schtuff for the left named keys (lkeyl (list-ref inl 10)) (lkeymkp (list (markup #:null))) (lkeymkp (make-named-bcl lkeyl lkeymkp lbiglist)) ;necessary schtuff for the right named keys (rkeyl (list-ref inl 11)) (rkeymkp (list (markup #:null))) (rkeymkp (make-named-bcl rkeyl rkeymkp rbiglist)) ;values to draw the "R" hole (halfbase (* radius (cos (/ PI 10))) ) (height (* halfbase (/ (sin (/ (* 4 PI) 10)) (cos (/ (* 4 PI) 10))) )) (hoffset (* radius (sin (/ PI 10))) ) ;values taking care of numbered key layout (numberkeys (list-ref inl 12)) (nkoffset (- 3.5 (* (- (length numberkeys) 1) 0.5)) ) ) (interpret-markup layout props (markup #:stencil (ly:stencil-add ;center holes (ly:stencil-translate-axis (make-circle-stencil radius 0.1 h5) (* 1.0 stretch) Y ) (ly:stencil-translate-axis (make-circle-stencil radius 0.1 h4) (* 2.0 stretch) Y ) (ly:stencil-translate-axis (make-circle-stencil radius 0.1 h3) (* 3.0 stretch) Y ) (ly:stencil-translate-axis (ly:make-stencil (list 'draw-line 0.1 (* -1.5 radius) 0 (* 1.5 radius) 0 ) (cons 0 0 ) (cons 0 0)) (* 3.75 stretch) Y ) (ly:stencil-translate-axis (make-circle-stencil radius 0.1 h2) (* 4.5 stretch) Y ) (ly:stencil-translate-axis (make-circle-stencil radius 0.1 h1) (* 5.5 stretch) Y ) (ly:stencil-translate-axis (make-circle-stencil radius 0.1 h0) (* 6.5 stretch) Y ) ;left-of-center hole (if h6 (ly:stencil-translate (make-circle-stencil radius 0.1 #t) (cons (* -1.0 stretch ) (* 6.5 stretch) ) ) empty-stencil ) ;"R" hole (if rkey (ly:stencil-translate (make-circle-stencil radius 0.1 #t) (cons (* -1.0 stretch ) (* 7.5 stretch) ) ) empty-stencil ) (if rkey (ly:stencil-translate (ly:make-stencil `(polygon ',(list halfbase 0.0 0.0 height (* -1 halfbase) 0) 0.1 #t) (cons 0 0) (cons 0 0)) (cons (* -1.0 stretch ) (+ (* 7.5 stretch) hoffset) ) ) empty-stencil ) ;numbered holes. uggggly....fix me! (if (> (length numberkeys) 0) (make-number-bcl layout props fsize stretch nkoffset (list-ref numberkeys 0)) empty-stencil) (if (> (length numberkeys) 1) (make-number-bcl layout props fsize stretch (+ 1 nkoffset) (list-ref numberkeys 1)) empty-stencil) (if (> (length numberkeys) 2) (make-number-bcl layout props fsize stretch (+ 2 nkoffset) (list-ref numberkeys 2)) empty-stencil) ;left side named holes (ly:stencil-translate (ly:text-interface::interpret-markup layout props (make-general-align-markup X RIGHT (make-concat-markup lkeymkp))) (cons (* -0.5 stretch ) (* 0.0 stretch) ) ) ;right side named holes (ly:stencil-translate (ly:text-interface::interpret-markup layout props (make-general-align-markup X LEFT (make-concat-markup rkeymkp))) (cons (* 0.5 stretch ) (* 4.0 stretch) ) ) ) ) ) ) ) % USEAGE \relative c' { c1^\markup { \multiphonic #(list radius spacing of holes hole0 hole1 hole2 hole3 hole4 hole5 hole6 holeR (bottom-o-bcl B F# E Eb G# F ) (middle-o-bcl A G# Eb C# F E F#) (left-side-keys-from-top-to-bottom-max-4) ) } } \relative c' { c1^\markup { \multiphonic #(list 1.0 0.5 #t #f #t #f #t #t #f #f (list #f #f #f #t #f #t ) (list #t #t #f #f #f #f #t ) (list "2" "1" ) ) } } \relative c' { c1^\markup { \multiphonic #(list 1.0 0.5 #t #f #t #f #t #t #t #f (list #f #f #f #t #f #f ) (list #f #t #f #f #f #f #f ) (list "4" "2" "1" ) ) } } \relative c' { c1^\markup { \multiphonic #(list 1.0 0.5 #f #f #t #t #t #t #f #t (list #t #f #f #t #f #f ) (list #f #t #f #f #f #f #f ) (list "1" ) ) } } \relative c' { c1^\markup { \multiphonic #(list 0.5 0.5 #f #f #t #t #t #t #f #f (list #f #f #f #f #f #f ) (list #f #f #f #f #f #f #f ) '() ) } } _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user