- "Like string-concatenate, but for symbols"
- (string->symbol (apply string-append (map symbol->string names))))
+ "Like @code{string-concatenate}, but for symbols."
+ (string->symbol (string-concatenate (map symbol->string names))))
- "Applies a list of functions in function list to arg.
- Each element of function list is structured (cons function '(arg2 arg3 ...))
- If function takes arguments besides arg, they are provided in function list.
- For example:
- @code{guile> (function-chain 1 `((,+ 1) (,- 2) (,+ 3) (,/)))}
- @code{1/3}"
- (if (null? function-list)
- arg
- (function-chain
- (apply (caar function-list) (append `(,arg) (cdar function-list)))
- (cdr function-list))))
-
-(define (rotunda-map function inlist rotunda)
- "Like map, but with a rotating last argument to function.
- For example:
- @code{guile> (rotunda-map + '(1 2 3 4) '(1 -10))}
- @code{(2 -8 4 -6)}"
- (define (rotunda-map-chain function inlist outlist rotunda)
- (if (null? inlist)
- outlist
- (rotunda-map-chain
- function
- (cdr inlist)
- (append outlist (list (function (car inlist) (car rotunda))))
- (append (cdr rotunda) (list (car rotunda))))))
- (rotunda-map-chain function inlist '() rotunda))
+ "Applies a list of functions in @var{function-list} to @var{arg}.
+Each element of @var{function-list} is structured @code{(cons function
+'(arg2 arg3 ...))}. If function takes arguments besides @var{arg}, they
+are provided in @var{function-list}.
+
+Example: Executing @samp{(function-chain 1 `((,+ 1) (,- 2) (,+ 3) (,/)))}
+returns @samp{1/3}."
+ (fold
+ (lambda (fun arg) (apply (car fun) arg (cdr fun)))
+ arg
+ function-list))
(define (is-square? x input-list)
"Returns true if x is the square of a value in input-list."
(pair? (memv (inexact->exact (sqrt x)) input-list)))
(define (is-square? x input-list)
"Returns true if x is the square of a value in input-list."
(pair? (memv (inexact->exact (sqrt x)) input-list)))
-(define (satisfies-function? function input-list)
- "Returns true if an element in @code{input-list} is true
- when @code{function} is applied to it.
- For example:
- @code{guile> (satisfies-function? null? '((1 2) ()))}
- @code{#t}
- @code{guile> (satisfies-function? null? '((1 2) (3)))}
- @code{#f}"
- (if (null? input-list)
- #f
- (or (function (car input-list))
- (satisfies-function? function (cdr input-list)))))
-
- ((< fill 3) 1.0)
- ((= fill (expt (assoc-get 'F HOLE-FILL-LIST) 2)) 0.5)
- ((= fill (assoc-get 'F HOLE-FILL-LIST)) 0.0)))
-
-; Emits a list for the central-column-hole maker
-; (not-full?, 1-quarter-full?, 1-half-full?, 3-quarters-full?, full?)
-; Multiple values, such as (#t #f #f #t #f), mean a trill between
-; not-full and 3-quarters-full
+ ((< fill 3) 1.0)
+ ((= fill (expt (assoc-get 'F HOLE-FILL-LIST) 2)) 0.5)
+ ((= fill (assoc-get 'F HOLE-FILL-LIST)) 0.0)))
+
+;; Emits a list for the central-column-hole maker
+;; (not-full?, 1-quarter-full?, 1-half-full?, 3-quarters-full?, full?)
+;; Multiple values, such as (#t #f #f #t #f), mean a trill between
+;; not-full and 3-quarters-full
- (append `(,(or (< fill 3) (is-square? fill avals)))
- (map (lambda (x) (= 0 (remainder fill x))) avals))))
+ (append `(,(or (< fill 3) (is-square? fill avals)))
+ (map (lambda (x) (= 0 (remainder fill x))) avals))))
- ((fill-translate (key-fill-translate fill))
- (gray? (eqv? fill-translate 0.5)))
- (ly:stencil-add
- ((if gray? gray-colorize identity)
- (proc
- (make-connected-path-stencil
- ls
- thick
- (* x-stretch radius)
- (* y-stretch radius)
- #f
- (if gray? #t fill-translate))))
- (if (not gray?)
- empty-stencil
- ((rich-path-stencil ls x-stretch y-stretch proc)
- radius
- thick
- 1
- layout
- props))))))
-
-; A connected path stencil without a surrounding proc
+ ((fill-translate (key-fill-translate fill))
+ (gray? (eqv? fill-translate 0.5)))
+ (ly:stencil-add
+ ((if gray? gray-colorize identity)
+ (proc
+ (make-connected-path-stencil
+ ls
+ thick
+ (* x-stretch radius)
+ (* y-stretch radius)
+ #f
+ (if gray? #t fill-translate))))
+ (if (not gray?)
+ empty-stencil
+ ((rich-path-stencil ls x-stretch y-stretch proc)
+ radius
+ thick
+ 1
+ layout
+ props))))))
+
+;; A connected path stencil without a surrounding proc
- ((fill-translate (key-fill-translate fill))
- (gray? (eqv? fill-translate 0.5)))
- (ly:stencil-add
- ((if gray? gray-colorize identity)
- (proc
- (make-partial-ellipse-stencil
- (* x-stretch radius)
- (* y-stretch radius)
- start
- end
- thick
- #t
- (if gray? #t fill-translate))))
- (if (not gray?)
- empty-stencil
- ((rich-pe-stencil x-stretch y-stretch start end proc)
- radius
- thick
- 1
- layout
- props))))))
+ ((fill-translate (key-fill-translate fill))
+ (gray? (eqv? fill-translate 0.5)))
+ (ly:stencil-add
+ ((if gray? gray-colorize identity)
+ (proc
+ (make-partial-ellipse-stencil
+ (* x-stretch radius)
+ (* y-stretch radius)
+ start
+ end
+ thick
+ #t
+ (if gray? #t fill-translate))))
+ (if (not gray?)
+ empty-stencil
+ ((rich-pe-stencil x-stretch y-stretch start end proc)
+ radius
+ thick
+ 1
+ layout
+ props))))))
- ((fill-translate (key-fill-translate fill))
- (gray? (eqv? fill-translate 0.5)))
- (ly:stencil-add
- ((if gray? gray-colorize identity)
- (proc
- (make-ellipse-stencil
+ ((fill-translate (key-fill-translate fill))
+ (gray? (eqv? fill-translate 0.5)))
+ (ly:stencil-add
+ ((if gray? gray-colorize identity)
+ (proc
+ (make-ellipse-stencil
-; Translates all possible representations of symbol.
-; If simple? then the only representations are open, closed, and trill.
-; Otherwise, there can be various levels of "closure" on the holes
-; ring? allows for a ring around the holes as well
+;; Translates all possible representations of symbol.
+;; If simple? then the only representations are open, closed, and trill.
+;; Otherwise, there can be various levels of "closure" on the holes
+;; ring? allows for a ring around the holes as well
- (filter (lambda (x)
- (not
- (equal?
- x
- `(,(symbol-concatenate symbol 'T 'F) .
- ,(expt (assoc-get 'F HOLE-FILL-LIST) 2)))))
- (append
- `((,symbol . ,(assoc-get 'F HOLE-FILL-LIST))
- (,(symbol-concatenate symbol 'T) .
- ,(expt (assoc-get 'F HOLE-FILL-LIST) 2)))
- (if simple?
- '()
- (apply append
- (map (lambda (x)
- (append
- `((,(symbol-concatenate symbol (car x) 'T)
- . ,(expt (cdr x) 2))
- (,(symbol-concatenate symbol 'T (car x))
- . ,(* (cdr x) (assoc-get 'F HOLE-FILL-LIST)))
- (,(symbol-concatenate symbol (car x))
- . ,(cdr x)))
- (apply append
- (map (lambda (y)
- (map (lambda (a b)
- `(,(symbol-concatenate symbol
- (car a)
- 'T
- (car b))
- . ,(* (cdr a) (cdr b))))
- `(,x ,y) `(,y ,x)))
- (cdr (member x HOLE-FILL-LIST))))))
- (if ring? HOLE-FILL-LIST (cdr HOLE-FILL-LIST))))))))
+ (delete `(,(symbol-concatenate symbol 'T 'F) .
+ ,(expt (assoc-get 'F HOLE-FILL-LIST) 2))
+ `((,symbol . ,(assoc-get 'F HOLE-FILL-LIST))
+ (,(symbol-concatenate symbol 'T) .
+ ,(expt (assoc-get 'F HOLE-FILL-LIST) 2))
+ ,@(if simple?
+ '()
+ (append-map
+ (lambda (x)
+ `((,(symbol-concatenate symbol (car x) 'T)
+ . ,(expt (cdr x) 2))
+ (,(symbol-concatenate symbol 'T (car x))
+ . ,(* (cdr x) (assoc-get 'F HOLE-FILL-LIST)))
+ (,(symbol-concatenate symbol (car x))
+ . ,(cdr x))
+ ,@(append-map
+ (lambda (y)
+ (map (lambda (a b)
+ `(,(symbol-concatenate symbol
+ (car a)
+ 'T
+ (car b))
+ . ,(* (cdr a) (cdr b))))
+ `(,x ,y) `(,y ,x)))
+ (cdr (member x HOLE-FILL-LIST)))))
+ (if ring? HOLE-FILL-LIST (cdr HOLE-FILL-LIST)))))))
- (markup #:conditional-circle-markup
- x
- (make-concat-markup
- (list
- (markup #:abs-fontsize font-size (car y))
- (if (and (< x 1) (cdr y))
- (if (eqv? (cdr y) 1)
- (markup
- #:abs-fontsize
- font-size
- #:raise
- 1
- #:fontsize
- -2
- #:sharp)
- (markup
- #:abs-fontsize
- font-size
- #:raise
- 1
- #:fontsize
- -2
- #:flat))
- (markup #:null)))))
- (markup #:null)))
- input-list key-list))
-
-; Makes a list of number-keys
+ (markup #:conditional-circle-markup
+ x
+ (make-concat-markup
+ (list
+ (markup #:abs-fontsize font-size (car y))
+ (if (and (< x 1) (cdr y))
+ (if (eqv? (cdr y) 1)
+ (markup
+ #:abs-fontsize
+ font-size
+ #:raise
+ 1
+ #:fontsize
+ -2
+ #:sharp)
+ (markup
+ #:abs-fontsize
+ font-size
+ #:raise
+ 1
+ #:fontsize
+ -2
+ #:flat))
+ (markup #:null)))))
+ (markup #:null)))
+ input-list key-list))
+
+;; Makes a list of number-keys
- layout
- props
- (make-general-align-markup
- X
- dir
- ((if hv make-concat-markup make-center-column-markup)
- (make-name-keylist
- (map text-fill-translate fill-list)
- key-name-list
- (* 12 radius)))))))
+ layout
+ props
+ (make-general-align-markup
+ X
+ dir
+ ((if hv make-concat-markup make-center-column-markup)
+ (make-name-keylist
+ (map text-fill-translate fill-list)
+ key-name-list
+ (* 12 radius)))))))
- Y
- CENTER
- (make-general-align-markup
- X
- RIGHT
- (make-override-markup
- '(baseline-skip . 0)
- (make-column-markup
- (make-number-keylist
- (map text-fill-translate fill-list)
- key-name-list
- (* radius 8)))))))))
-
-; Utility function for the left-hand keys
+ X
+ RIGHT
+ (make-override-markup
+ '(baseline-skip . 0)
+ (make-column-markup
+ (make-number-keylist
+ (map text-fill-translate fill-list)
+ key-name-list
+ (* radius 8)))))))))
+
+;; Utility function for the left-hand keys
- (entry-greater-than-x?
- (map (lambda (key) (assoc-get key alist)) target-part) 0)
- (map-selected-alist-keys (lambda (x) 1) '((hidden . long-midline)) alist)
- (map-selected-alist-keys (lambda (x) 1) '((hidden . midline)) alist)))
+ (entry-greater-than-x?
+ (map (lambda (key) (assoc-get key alist)) target-part) 0)
+ (map-selected-alist-keys (lambda (x) 1) '((hidden . long-midline)) alist)
+ (map-selected-alist-keys (lambda (x) 1) '((hidden . midline)) alist)))
- alist
- (apply-group-draw-rule-series
- (group-draw-rule alist (car target-part-list))
- (cdr target-part-list))))
+ alist
+ (apply-group-draw-rule-series
+ (group-draw-rule alist (car target-part-list))
+ (cdr target-part-list))))
(define (group-extra-offset-rule alist target-part eos)
(rich-group-extra-offset-rule alist target-part target-part eos))
(define (uniform-extra-offset-rule alist eos)
(map-selected-alist-keys
(define (group-extra-offset-rule alist target-part eos)
(rich-group-extra-offset-rule alist target-part target-part eos))
(define (uniform-extra-offset-rule alist eos)
(map-selected-alist-keys
(define (midline-stencil radius thick fill layout props)
(make-line-stencil (* thick 2) (* -0.80 radius) 0 (* 0.80 radius) 0))
(define (long-midline-stencil radius thick fill layout props)
(make-line-stencil (* thick 2) (* -5.75 radius) 0 (* 0.75 radius) 0))
(define (midline-stencil radius thick fill layout props)
(make-line-stencil (* thick 2) (* -0.80 radius) 0 (* 0.80 radius) 0))
(define (long-midline-stencil radius thick fill layout props)
(make-line-stencil (* thick 2) (* -5.75 radius) 0 (* 0.75 radius) 0))
- ((xmove (lambda (x) (+ tailw (+ 0.2 (* bodyw (- x 0.2))))))
- (ymove (lambda (x) (+ (- tailh) (+ -0.05 (* bodyh (+ x 0.05)))))))
- (standard-path-stencil
- `((,(xmove 0.7)
- ,(ymove -0.2)
- ,(xmove 1.0)
- ,(ymove -1.0)
- ,(xmove 0.5)
- ,(ymove -1.0))
- (,(xmove 0.2)
- ,(ymove -1.0)
- ,(xmove 0.2)
- ,(ymove -0.2)
- ,(xmove 0.3)
- ,(ymove -0.1))
- (,(+ 0.2 tailw)
- ,(- -0.05 tailh)
- ,(+ 0.1 (/ tailw 2))
- ,(- -0.025 (/ tailh 2))
- 0.0
- 0.0))
- 1.0
- 1.0)))
-
-; Utility function for the column-hole maker.
-; Returns the left and right degrees for the drawing of a given
-; fill level (1-quarter, 1-half, etc...)
+ ((xmove (lambda (x) (+ tailw (+ 0.2 (* bodyw (- x 0.2))))))
+ (ymove (lambda (x) (+ (- tailh) (+ -0.05 (* bodyh (+ x 0.05)))))))
+ (standard-path-stencil
+ `((,(xmove 0.7)
+ ,(ymove -0.2)
+ ,(xmove 1.0)
+ ,(ymove -1.0)
+ ,(xmove 0.5)
+ ,(ymove -1.0))
+ (,(xmove 0.2)
+ ,(ymove -1.0)
+ ,(xmove 0.2)
+ ,(ymove -0.2)
+ ,(xmove 0.3)
+ ,(ymove -0.1))
+ (,(+ 0.2 tailw)
+ ,(- -0.05 tailh)
+ ,(+ 0.1 (/ tailw 2))
+ ,(- -0.025 (/ tailh 2))
+ 0.0
+ 0.0))
+ 1.0
+ 1.0)))
+
+;; Utility function for the column-hole maker.
+;; Returns the left and right degrees for the drawing of a given
+;; fill level (1-quarter, 1-half, etc...)
- ((if reverse? reverse identity) fill-list)
- ((if reverse? reverse identity)
- '((0 . 0) (215 . 325) (180 . 0) (145 . 35) (90 . 90)))
- left?))
+ ((if reverse? reverse identity) fill-list)
+ ((if reverse? reverse identity)
+ '((0 . 0) (215 . 325) (180 . 0) (145 . 35) (90 . 90)))
+ left?))
-; Huge, kind-of-ugly maker of a circle in a column.
-; I think this is the clearest way to write it, though...
+;; Huge, kind-of-ugly maker of a circle in a column.
+;; I think this is the clearest way to write it, though...
- ((and
- (list-ref fill-list 0)
- (not (true-entry? (list-tail fill-list 1)))) ; is it empty?
- ((standard-e-stencil 1.0 1.0) radius thick fill layout props))
- ((and
- (list-ref fill-list 4)
- (not (true-entry? (list-head fill-list 4)))) ; is it full?
- ((standard-e-stencil 1.0 1.0) radius thick fill layout props))
- ((and
- (list-ref fill-list 0)
- (list-ref fill-list 4)) ; is it a trill between empty and full?
- ((standard-e-stencil 1.0 1.0) radius thick fill layout props))
- (else ;If none of these, it is partially full.
- (ly:stencil-add
- ((rich-pe-stencil 1.0 1.0 0 360 identity)
- radius
- thick
- (if (list-ref fill-list 4)
- (expt (assoc-get 'F HOLE-FILL-LIST) 2)
- 1)
- layout
- props)
- ((rich-pe-stencil
- 1.0
- 1.0
- (degree-first-true fill-list #t #t)
- (degree-first-true fill-list #f #t)
- identity)
- radius
- thick
- (if
- (true-entry?
- (list-head fill-list (position-true-endpoint fill-list #t)))
- (expt (assoc-get 'F HOLE-FILL-LIST) 2)
- (assoc-get 'F HOLE-FILL-LIST))
- layout
- props)
- (if
- (= 2 (n-true-entries (list-tail fill-list 1))) ; trill?
- ((rich-pe-stencil
- 1.0
- 1.0
- (degree-first-true fill-list #t #f)
- (degree-first-true fill-list #f #f)
- identity)
- radius
- thick
- (assoc-get 'F HOLE-FILL-LIST)
- layout
- props)
- empty-stencil))))))
+ ((and
+ (list-ref fill-list 0)
+ (not (true-entry? (list-tail fill-list 1)))) ; is it empty?
+ ((standard-e-stencil 1.0 1.0) radius thick fill layout props))
+ ((and
+ (list-ref fill-list 4)
+ (not (true-entry? (list-head fill-list 4)))) ; is it full?
+ ((standard-e-stencil 1.0 1.0) radius thick fill layout props))
+ ((and
+ (list-ref fill-list 0)
+ (list-ref fill-list 4)) ; is it a trill between empty and full?
+ ((standard-e-stencil 1.0 1.0) radius thick fill layout props))
+ (else ;If none of these, it is partially full.
+ (ly:stencil-add
+ ((rich-pe-stencil 1.0 1.0 0 360 identity)
+ radius
+ thick
+ (if (list-ref fill-list 4)
+ (expt (assoc-get 'F HOLE-FILL-LIST) 2)
+ 1)
+ layout
+ props)
+ ((rich-pe-stencil
+ 1.0
+ 1.0
+ (degree-first-true fill-list #t #t)
+ (degree-first-true fill-list #f #t)
+ identity)
+ radius
+ thick
+ (if
+ (true-entry?
+ (list-head fill-list (position-true-endpoint fill-list #t)))
+ (expt (assoc-get 'F HOLE-FILL-LIST) 2)
+ (assoc-get 'F HOLE-FILL-LIST))
+ layout
+ props)
+ (if
+ (= 2 (n-true-entries (list-tail fill-list 1))) ; trill?
+ ((rich-pe-stencil
+ 1.0
+ 1.0
+ (degree-first-true fill-list #t #f)
+ (degree-first-true fill-list #f #f)
+ identity)
+ radius
+ thick
+ (assoc-get 'F HOLE-FILL-LIST)
+ layout
+ props)
+ empty-stencil))))))
(define (variable-column-circle-stencil scaler)
(lambda (radius thick fill layout props)
(column-circle-stencil (* radius scaler) thick fill layout props)))
(define (variable-column-circle-stencil scaler)
(lambda (radius thick fill layout props)
(column-circle-stencil (* radius scaler) thick fill layout props)))
- (* (+ (- 1.0 (* 2 thick)) (/ thick 2)))
- (* (+ (- 1.0 (* 2 thick)) (/ thick 2))))
- radius
- (* (* 4 radius) thick)
- 1
- layout
- props))
- ((standard-e-stencil 1.0 1.0) radius thick 1 layout props)
- (column-circle-stencil
+ (* (+ (- 1.0 (* 2 thick)) (/ thick 2)))
+ (* (+ (- 1.0 (* 2 thick)) (/ thick 2))))
+ radius
+ (* (* 4 radius) thick)
+ 1
+ layout
+ props))
+ ((standard-e-stencil 1.0 1.0) radius thick 1 layout props)
+ (column-circle-stencil
- (if (= 0 (remainder fill (assoc-get 'F HOLE-FILL-LIST)))
- (assoc-get 'F HOLE-FILL-LIST)
- 1)
- (if (= fill (expt (assoc-get 'R HOLE-FILL-LIST) 2))
- (/ fill (expt (assoc-get 'R HOLE-FILL-LIST) 2))
- (/ fill (assoc-get 'R HOLE-FILL-LIST))))
+ (if (= 0 (remainder fill (assoc-get 'F HOLE-FILL-LIST)))
+ (assoc-get 'F HOLE-FILL-LIST)
+ 1)
+ (if (= fill (expt (assoc-get 'R HOLE-FILL-LIST) 2))
+ (/ fill (expt (assoc-get 'R HOLE-FILL-LIST) 2))
+ (/ fill (assoc-get 'R HOLE-FILL-LIST))))
- '((0.1 0.1 0.2 0.4 0.3 0.6)
- (0.3 1.0 0.8 1.0 0.8 0.7)
- (0.8 0.3 0.5 0.3 0 0))
- 1.0
- 1.0
- (lambda (stencil) (ly:stencil-rotate stencil deg 0 0))))
+ '((0.1 0.1 0.2 0.4 0.3 0.6)
+ (0.3 1.0 0.8 1.0 0.8 0.7)
+ (0.8 0.3 0.5 0.3 0 0))
+ 1.0
+ 1.0
+ (lambda (stencil) (ly:stencil-rotate stencil deg 0 0))))
- '((0 0.75) (-0.8 0.75 -0.8 0 0 0))
- flute-lower-row-stretch
- flute-lower-row-stretch))
+ '((0 0.75) (-0.8 0.75 -0.8 0 0 0))
+ flute-lower-row-stretch
+ flute-lower-row-stretch))
- '((0 0.75) (0.4 0.75) (0.4 0) (0 0))
- flute-lower-row-stretch
- flute-lower-row-stretch))
+ '((0 0.75) (0.4 0.75) (0.4 0) (0 0))
+ flute-lower-row-stretch
+ flute-lower-row-stretch))
- '((0 0.75) (0.25 0.75) (0.25 0) (0 0))
- flute-lower-row-stretch
- flute-lower-row-stretch))
+ '((0 0.75) (0.25 0.75) (0.25 0) (0 0))
+ flute-lower-row-stretch
+ flute-lower-row-stretch))
- '((0.1 0.1 0.4 0.2 0.6 0.3)
- (1.0 0.3 1.0 0.8 0.7 0.8)
- (0.3 0.8 0.3 0.5 0 0))
- flute-lower-row-stretch
- flute-lower-row-stretch
- (lambda (stencil) (ly:stencil-rotate stencil 160 0 0))))
+ '((0.1 0.1 0.4 0.2 0.6 0.3)
+ (1.0 0.3 1.0 0.8 0.7 0.8)
+ (0.3 0.8 0.3 0.5 0 0))
+ flute-lower-row-stretch
+ flute-lower-row-stretch
+ (lambda (stencil) (ly:stencil-rotate stencil 160 0 0))))
- `((0.0 . 0.0) (0.0 . ,y) (,x . ,y) (,x . 0.0))
- 0.8)))
- (down-part
- (cdr
+ `((0.0 . 0.0) (0.0 . ,y) (,x . ,y) (,x . 0.0))
+ 0.8)))
+ (down-part
+ (cdr
- `((,x . 0.0) (,x . ,(- y)) (0.0 . ,(- y)) (0.0 . 0.0))
- 0.2))))
+ `((,x . 0.0) (,x . ,(- y)) (0.0 . ,(- y)) (0.0 . 0.0))
+ 0.2))))
- `((0.25 ,(/ y -2) 0.75 ,(/ y -2) 1.0 0.0))
- (map (lambda (l)
- (flatten-list
- (map (lambda (x)
- (coord-translate
- (coord-rotate x (atan (/ y (* 2 0.25))))
- '(1.0 . 0)))
- l)))
- `(((0 . ,y) (,x . ,y) (,x . 0))
- ((,x . ,(- y)) (0 . ,(- y)) (0 . 0)))))
+ `((0.25 ,(/ y -2) 0.75 ,(/ y -2) 1.0 0.0))
+ (map (lambda (l)
+ (flatten-list
+ (map (lambda (x)
+ (coord-translate
+ (coord-rotate x (atan (/ y (* 2 0.25))))
+ '(1.0 . 0)))
+ l)))
+ `(((0 . ,y) (,x . ,y) (,x . 0))
+ ((,x . ,(- y)) (0 . ,(- y)) (0 . 0)))))
- `(,(list-tail up-part 1)
- ,(list-head down-part 1)
- ,(list-tail down-part 1)))
- (- scaling-factor)
- (- scaling-factor)))))
+ `(,(list-tail up-part 1)
+ ,(list-head down-part 1)
+ ,(list-tail down-part 1)))
+ (- scaling-factor)
+ (- scaling-factor)))))
- `((0 1.5)
- (0 1.625 -0.125 1.75 -0.25 1.75)
- (-0.5 1.75 -0.5 0.816 -0.25 0.5)
- (0 0.25 0 0.125 0 0)
- (0 ,(if ees? -0.6 -0.3)))
- (* (if ees? -1.0 1.0) -1.8)
- 1.8))
+ `((0 1.5)
+ (0 1.625 -0.125 1.75 -0.25 1.75)
+ (-0.5 1.75 -0.5 0.816 -0.25 0.5)
+ (0 0.25 0 0.125 0 0)
+ (0 ,(if ees? -0.6 -0.3)))
+ (* (if ees? -1.0 1.0) -1.8)
+ 1.8))
- '((1.0 0.0 1.0 0.70 1.5 0.70)
- (2.25 0.70 2.25 -0.4 1.5 -0.4)
- (1.0 -0.4 1.0 0 0 0)
- (-0.15 0))
- 2.0
- 1.4
- (lambda (stencil) (ly:stencil-rotate stencil (if c? 170 180) 0 0))))
+ '((1.0 0.0 1.0 0.70 1.5 0.70)
+ (2.25 0.70 2.25 -0.4 1.5 -0.4)
+ (1.0 -0.4 1.0 0 0 0)
+ (-0.15 0))
+ 2.0
+ 1.4
+ (lambda (stencil) (ly:stencil-rotate stencil (if c? 170 180) 0 0))))
- '((0.6 0.0 0.6 0.50 1.25 0.50)
- (2.25 0.50 2.25 -0.4 1.25 -0.4)
- (0.6 -0.4 0.6 0 0 0))
- -0.9
- 1.0
- (lambda (stencil) (ly:stencil-rotate stencil 0 0 0))))
+ '((0.6 0.0 0.6 0.50 1.25 0.50)
+ (2.25 0.50 2.25 -0.4 1.25 -0.4)
+ (0.6 -0.4 0.6 0 0 0))
+ -0.9
+ 1.0
+ (lambda (stencil) (ly:stencil-rotate stencil 0 0 0))))
- (height (*
- halfbase
- (/ (sin (/ (* 4 PI) 10)) (cos (/ (* 4 PI) 10))))))
- (standard-path-stencil
- `(
- (0 ,(/ -4.0 3.0) -2.0 ,(/ -4.0 3.0) -2.0 0.0)
- (-1.5 ,(* 0.5 height) -1.25 ,(* 0.75 height) -1.0 ,height)
- (-0.75 ,(* 0.75 height) -0.5 ,(* 0.5 height) 0.0 0.0))
- 0.9
- 0.9)))
+ (height (*
+ halfbase
+ (/ (sin (/ (* 4 PI) 10)) (cos (/ (* 4 PI) 10))))))
+ (standard-path-stencil
+ `(
+ (0 ,(/ -4.0 3.0) -2.0 ,(/ -4.0 3.0) -2.0 0.0)
+ (-1.5 ,(* 0.5 height) -1.25 ,(* 0.75 height) -1.0 ,height)
+ (-0.75 ,(* 0.75 height) -0.5 ,(* 0.5 height) 0.0 0.0))
+ 0.9
+ 0.9)))
-; TODO
-; there is some unnecessary information duplication here.
-; need a way to control all of the below stencils so that if one
-; changes, all change...
+;; TODO
+;; there is some unnecessary information duplication here.
+;; need a way to control all of the below stencils so that if one
+;; changes, all change...
- `(,(bezier-head-for-stencil
- '((0.0 . 0.0) (0.0 . -1.0) (1.0 . -1.0) (1.0 . 0.0))
- 0.5)
- ,(bezier-head-for-stencil
- '((0.5 . -0.75) (0.5 . 0.25) (1.5 . 0.25) (1.5 . -0.75))
- 0.5)
- (1.0 1.0 0.0 1.0 0.0 0.0))
- CL-RH-H-STRETCH
- CL-RH-V-STRETCH))
-
-(define clarinet-rh-e-key-stencil
+ `(,(bezier-head-for-stencil
+ '((0.0 . 0.0) (0.0 . -1.0) (1.0 . -1.0) (1.0 . 0.0))
+ 0.5)
+ ,(bezier-head-for-stencil
+ '((0.5 . -0.75) (0.5 . 0.25) (1.5 . 0.25) (1.5 . -0.75))
+ 0.5)
+ (1.0 1.0 0.0 1.0 0.0 0.0))
+ CL-RH-H-STRETCH
+ CL-RH-V-STRETCH))
+
+(define clarinet-rh-gis-key-stencil
- `(,(bezier-head-for-stencil
- '((0.0 . 0.0) (0.0 . -1.0) (1.0 . -1.0) (1.0 . 0.0))
- 0.5)
- ,(bezier-head-for-stencil
- '((0.5 . -0.75) (0.5 . 0.25) (1.5 . 0.25) (1.5 . -0.75))
- 0.5)
- ,(bezier-head-for-stencil
- `((1.0 . 0.0) (,(/ 1 3) . 0.0) (,(/ 1 3) . 1.5) (1.0 . 1.5))
- 0.5)
- ,(bezier-head-for-stencil
- `((0.5 . 0.75) (,(/ -1 6) . 0.75) (,(/ -1 6) . -0.75) (0.5 . -0.75))
- 0.5))
- CL-RH-H-STRETCH
- CL-RH-V-STRETCH))
-
-(define clarinet-rh-gis-key-stencil clarinet-rh-e-key-stencil)
-
-(define bass-clarinet-rh-f-key-stencil
+ `(,(bezier-head-for-stencil
+ '((0.0 . 0.0) (0.0 . -1.0) (1.0 . -1.0) (1.0 . 0.0))
+ 0.5)
+ ,(bezier-head-for-stencil
+ '((0.5 . -0.75) (0.5 . 0.25) (1.5 . 0.25) (1.5 . -0.75))
+ 0.5)
+ ,(bezier-head-for-stencil
+ `((1.0 . 0.0) (,(/ 1 3) . 0.0) (,(/ 1 3) . 1.5) (1.0 . 1.5))
+ 0.5)
+ ,(bezier-head-for-stencil
+ `((0.5 . 0.75) (,(/ -1 6) . 0.75) (,(/ -1 6) . -0.75) (0.5 . -0.75))
+ 0.5))
+ CL-RH-H-STRETCH
+ CL-RH-V-STRETCH))
+
+(define clarinet-rh-f-key-stencil clarinet-rh-gis-key-stencil)
+
+(define bass-clarinet-rh-ees-key-stencil
- `(,(bezier-head-for-stencil
- '((0.0 . 0.0) (0.0 . -1.0) (1.0 . -1.0) (1.0 . 0.0))
- 0.5)
- ,(bezier-head-for-stencil
- '((0.5 . -0.75) (0.5 . 0.25) (1.5 . 0.25) (1.5 . -0.75))
- 0.5)
- (1.0 1.0 0.0 1.0 0.0 0.0))
- CL-RH-H-STRETCH
- (- CL-RH-V-STRETCH)))
+ `(,(bezier-head-for-stencil
+ '((0.0 . 0.0) (0.0 . -1.0) (1.0 . -1.0) (1.0 . 0.0))
+ 0.5)
+ ,(bezier-head-for-stencil
+ '((0.5 . -0.75) (0.5 . 0.25) (1.5 . 0.25) (1.5 . -0.75))
+ 0.5)
+ (1.0 1.0 0.0 1.0 0.0 0.0))
+ CL-RH-H-STRETCH
+ (- CL-RH-V-STRETCH)))
- `((0.0 ,height)
- (0.05 ,(+ height 0.05) 0.1 ,(+ height 0.1) 0.15 ,(+ height 0.15))
- (,(- width 0.15) ,(+ height 0.15))
- (,(- width 0.1)
- ,(+ height 0.1)
- ,(- width 0.05)
- ,(+ height 0.05)
- ,width
- ,height)
- (,width 0.0)
- (,(- width 0.05) -0.05 ,(- width 0.1) -0.1 ,(- width 0.15) -0.15)
- (0.15 -0.15)
- (0.1 -0.1 0.05 -0.05 0.0 0.0))
- 1.0
- 1.0))
+ `((0.0 ,height)
+ (0.05 ,(+ height 0.05) 0.1 ,(+ height 0.1) 0.15 ,(+ height 0.15))
+ (,(- width 0.15) ,(+ height 0.15))
+ (,(- width 0.1)
+ ,(+ height 0.1)
+ ,(- width 0.05)
+ ,(+ height 0.05)
+ ,width
+ ,height)
+ (,width 0.0)
+ (,(- width 0.05) -0.05 ,(- width 0.1) -0.1 ,(- width 0.15) -0.15)
+ (0.15 -0.15)
+ (0.1 -0.1 0.05 -0.05 0.0 0.0))
+ 1.0
+ 1.0))
- (append
- '((0.0 1.0) (0.0 1.4 0.6 1.4 0.6 1.0) (0.6 0.0))
- (map (lambda (l)
- (flatten-list
- (map (lambda (x)
- (coord-rotate x (atan (* -1 (/ PI 6)))))
- l)))
- '(((0.6 . -1.0))
- ((0.6 . -1.4) (0.0 . -1.4) (0.0 . -1.0))
- ((0.0 . 0.0)))))
- 0.75
- 0.75))
+ (append
+ '((0.0 1.0) (0.0 1.4 0.6 1.4 0.6 1.0) (0.6 0.0))
+ (map (lambda (l)
+ (flatten-list
+ (map (lambda (x)
+ (coord-rotate x (atan (* -1 (/ PI 6)))))
+ l)))
+ '(((0.6 . -1.0))
+ ((0.6 . -1.4) (0.0 . -1.4) (0.0 . -1.0))
+ ((0.0 . 0.0)))))
+ 0.75
+ 0.75))
- (first-bezier
- (flatten-list
- (car
- (split-bezier
- `((0.0 . ,(+ height gap))
- (0.0 . ,(+ height (+ gap 1.0)))
- (1.0 . ,(+ height (+ gap 2.0)))
- (2.0 . ,(+ height (+ gap 2.0))))
- cut))))
- (second-bezier
- (flatten-list
- (reverse
- (car
+ (first-bezier
+ (flatten-list
+ (car
+ `((0.0 . ,(+ height gap))
+ (0.0 . ,(+ height (+ gap 1.0)))
+ (1.0 . ,(+ height (+ gap 2.0)))
+ (2.0 . ,(+ height (+ gap 2.0))))
+ cut))))
+ (second-bezier
+ (flatten-list
+ (reverse
+ (car
+ (split-bezier
- (1.0 . ,(+ 0.5 height))
- (1.5 . ,(+ 1.0 height))
- (2.0 . ,(+ 1.0 height)))
+ (1.0 . ,(+ 0.5 height))
+ (1.5 . ,(+ 1.0 height))
+ (2.0 . ,(+ 1.0 height)))
- (slope-offset1
- (get-slope-offset
- `(,(list-ref first-bezier 4) . ,(list-ref first-bezier 5))
- `(,(list-ref first-bezier 6) . ,(list-ref first-bezier 7))))
- (slope-offset2
- (get-slope-offset
- `(,(list-ref second-bezier 0) . ,(list-ref second-bezier 1))
- `(,(list-ref second-bezier 2) . ,(list-ref second-bezier 3)))))
- (list first-bezier second-bezier slope-offset1 slope-offset2)))
+ (slope-offset1
+ (get-slope-offset
+ `(,(list-ref first-bezier 4) . ,(list-ref first-bezier 5))
+ `(,(list-ref first-bezier 6) . ,(list-ref first-bezier 7))))
+ (slope-offset2
+ (get-slope-offset
+ `(,(list-ref second-bezier 0) . ,(list-ref second-bezier 1))
+ `(,(list-ref second-bezier 2) . ,(list-ref second-bezier 3)))))
+ (list first-bezier second-bezier slope-offset1 slope-offset2)))
- (+ keylen (list-ref first-bezier 6))) (cdr slope-offset1))))
- ((if bezier? (lambda (x) `(,(apply append x))) identity)
- `((,(+ (+ keylen 1.75) (list-ref first-bezier 6))
+ (+ (+ keylen 1.75) (list-ref first-bezier 6)))
+ (cdr slope-offset1)))
+ (,(+ (+ keylen 1.75) (list-ref second-bezier 0))
- (*
- (car slope-offset1)
- (+ (+ keylen 1.75) (list-ref first-bezier 6)))
- (cdr slope-offset1)))
- (,(+ (+ keylen 1.75) (list-ref second-bezier 0))
+ (*
+ (car slope-offset2)
+ (+ (+ keylen 1.75) (list-ref second-bezier 0)))
+ (cdr slope-offset2)))
+ (,(+ keylen (list-ref second-bezier 0))
- (*
- (car slope-offset2)
- (+ (+ keylen 1.75) (list-ref second-bezier 0)))
- (cdr slope-offset2)))
- (,(+ keylen (list-ref second-bezier 0))
- ,(+
- (* (car slope-offset2) (+ keylen (list-ref second-bezier 0)))
- (cdr slope-offset2)))))
- `(,(list-head second-bezier 2))))
+ (* (car slope-offset2) (+ keylen (list-ref second-bezier 0)))
+ (cdr slope-offset2)))))
+ `(,(list-head second-bezier 2))))
- (first-bezier (car info-list))
- (second-bezier (cadr info-list))
- (slope-offset1 (caddr info-list))
- (slope-offset2 (cadddr info-list)))
- (rich-path-stencil
- (append
+ (first-bezier (car info-list))
+ (second-bezier (cadr info-list))
+ (slope-offset1 (caddr info-list))
+ (slope-offset2 (cadddr info-list)))
+ (rich-path-stencil
+ (append
- '((-0.8 4.0 1.4 4.0 0.6 0.0)
- (0.5 -0.5 0.5 -0.8 0.6 -1.0)
- (0.7 -1.2 0.8 -1.3 0.8 -1.8)
- (0.5 -1.8)
- (0.5 -1.4 0.4 -1.2 0.3 -1.1)
- (0.2 -1.0 0.1 -0.5 0.0 0.0))
- 1.0
- 1.0))
+ '((-0.8 4.0 1.4 4.0 0.6 0.0)
+ (0.5 -0.5 0.5 -0.8 0.6 -1.0)
+ (0.7 -1.2 0.8 -1.3 0.8 -1.8)
+ (0.5 -1.8)
+ (0.5 -1.4 0.4 -1.2 0.3 -1.1)
+ (0.2 -1.0 0.1 -0.5 0.0 0.0))
+ 1.0
+ 1.0))
(0.2 ,(+ height 1.6) 0.8 ,(+ height 1.8) 1.0 ,(+ height 1.8))
(1.4 ,(+ height 1.8) 1.9 ,(+ height 1.3) 1.9 ,(+ height 1.0))
(1.9 ,(+ height 0.7) 1.0 ,(+ height 0.4) 0.8 ,(+ height 0.3))
(0.6 ,(+ height 0.2) 0.4 ,(+ height 0.1) 0.4 ,(- height 0.1))
(0.4 0.0)
(0.0 0.0))
(0.2 ,(+ height 1.6) 0.8 ,(+ height 1.8) 1.0 ,(+ height 1.8))
(1.4 ,(+ height 1.8) 1.9 ,(+ height 1.3) 1.9 ,(+ height 1.0))
(1.9 ,(+ height 0.7) 1.0 ,(+ height 0.4) 0.8 ,(+ height 0.3))
(0.6 ,(+ height 0.2) 0.4 ,(+ height 0.1) 0.4 ,(- height 0.1))
(0.4 0.0)
(0.0 0.0))
- `((0.0 ,height)
- (0.0 ,(+ height 1.6) 0.4 ,(+ height 1.8) 0.5 ,(+ height 1.8))
- (0.7 ,(+ height 1.8) 0.9 ,(+ height 1.3) 0.9 ,(+ height 1.0))
- (0.9 ,(+ height 0.5) 0.7 ,(+ height 0.4) 0.6 ,(+ height 0.3))
- (0.5 ,(+ height 0.2) 0.4 ,(+ height 0.1) 0.4 ,(- height 0.1))
- (0.4 0.0)
- (0.0 0.0))
- -1.0
- -1.0)))
+ `((0.0 ,height)
+ (0.0 ,(+ height 1.6) 0.4 ,(+ height 1.8) 0.5 ,(+ height 1.8))
+ (0.7 ,(+ height 1.8) 0.9 ,(+ height 1.3) 0.9 ,(+ height 1.0))
+ (0.9 ,(+ height 0.5) 0.7 ,(+ height 0.4) 0.6 ,(+ height 0.3))
+ (0.5 ,(+ height 0.2) 0.4 ,(+ height 0.1) 0.4 ,(- height 0.1))
+ (0.4 0.0)
+ (0.0 0.0))
+ -1.0
+ -1.0)))
- (info-list (bassoon-bend-info-maker height gap cut))
- (first-bezier (car info-list))
- (second-bezier (cadr info-list))
- (slope-offset1 (caddr info-list))
- (slope-offset2 (cadddr info-list)))
- (standard-path-stencil
- (append
+ (info-list (bassoon-bend-info-maker height gap cut))
+ (first-bezier (car info-list))
+ (second-bezier (cadr info-list))
+ (slope-offset1 (caddr info-list))
+ (slope-offset2 (cadddr info-list)))
+ (standard-path-stencil
+ (append