X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Ffret-diagrams.scm;h=9247a115f70696dc444c1f6264abe59daa636150;hb=0e13fe23a0698ae81b9e618b15841b8a88919ed7;hp=558c11ebf679a8067617fcd90c93a0546ed2a7df;hpb=adc6cbf9a271370c1453bfca918f810d9f2906f1;p=lilypond.git diff --git a/scm/fret-diagrams.scm b/scm/fret-diagrams.scm index 558c11ebf6..9247a115f7 100644 --- a/scm/fret-diagrams.scm +++ b/scm/fret-diagrams.scm @@ -72,10 +72,20 @@ to end-point." (if (null? dot-list) '() (let ((this-list (car dot-list))) - (cons* (list (car this-list) (- (second this-list) base-fret) - (if (null? (cddr this-list)) - '() - (third this-list))) + (cons* (list + ;; string + (car this-list) + ;; fret + (- (second this-list) base-fret) + ;; finger + (if (null? (cddr this-list)) + '() + (third this-list)) + ;; color modifier + (if (or (null? (cddr this-list)) + (null? (cdddr this-list))) + '() + (fourth this-list))) (subtract-base-fret base-fret (cdr dot-list)))))) (define (drop-paren item-list) @@ -275,8 +285,7 @@ with magnification @var{mag} of the string @var{text}." (thickness-factor (assoc-get 'string-thickness-factor details 0)) (alignment (chain-assoc-get 'align-dir props -0.4)) ; needed only here - (xo-padding - (* size (assoc-get 'xo-padding details 0.2))) ; needed only here + (xo-padding (assoc-get 'xo-padding details 0.2)) ; needed only here (parameters (fret-parse-marking-list marking-list my-fret-count)) (capo-fret (assoc-get 'capo-fret parameters 0)) (dot-list (assoc-get 'dot-list parameters)) @@ -531,7 +540,7 @@ fret-diagram overall parameters." (let* ( (scale-dot-radius (* size dot-radius)) (scale-dot-thick (* size th)) - (dot-color (assoc-get 'dot-color details 'black)) + (default-dot-color (assoc-get 'dot-color details 'black)) (finger-label-padding 0.3) (dot-label-font-mag (* scale-dot-radius @@ -555,6 +564,11 @@ fret-diagram overall parameters." (extent (cons (- scale-dot-radius) scale-dot-radius)) (finger (caddr mypair)) (finger (if (number? finger) (number->string finger) finger)) + (inverted-color (eq? 'inverted (cadddr mypair))) + (dot-color (if (or (and (eq? default-dot-color 'black) inverted-color) + (and (eq? default-dot-color 'white) (not inverted-color))) + 'white + 'black)) (dot-stencil (if (eq? dot-color 'white) (ly:stencil-add (make-circle-stencil @@ -641,12 +655,11 @@ fret-diagram overall parameters." "Put open and mute string indications on diagram, as contained in @var{xo-list}." (let* ((xo-font-mag - (* size (assoc-get - 'xo-font-magnification details + (assoc-get 'xo-font-magnification details (cond ((or (eq? orientation 'landscape) (eq? orientation 'opposing-landscape)) 0.4) - (else 0.4))))) + (else 0.4)))) (mypair (car xo-list)) (restlist (cdr xo-list)) (glyph-string (if (eq? (car mypair) 'mute) @@ -709,6 +722,11 @@ at @var{fret}." (fancy-format #f "~@r" base-fret)) ((equal? 'arabic number-type) (fancy-format #f "~d" base-fret)) + ((equal? 'custom number-type) + (fancy-format #f + (assoc-get 'fret-label-custom-format + details "~a") + base-fret)) (else (fancy-format #f "~(~@r~)" base-fret)))) (label-stencil (centered-stencil @@ -723,7 +741,7 @@ at @var{fret}." (ly:stencil-translate label-stencil (stencil-coordinates - (1+ (* size label-vertical-offset)) + (* size (+ 1.0 label-vertical-offset)) (if (eq? label-dir LEFT) (- label-outside-diagram) (+ (* size (1- string-count)) label-outside-diagram)))))) @@ -966,12 +984,15 @@ Place a capo indicator (a large solid bar) across the entire fretboard at fret location @var{fret-number}. Also, set fret @var{fret-number} to be the lowest fret on the fret diagram. -@item (place-fret @var{string-number} @var{fret-number} @var{finger-value}) +@item (place-fret @var{string-number} @var{fret-number} [@var{finger-value} [@var{color-modifier}]]) Place a fret playing indication on string @var{string-number} at fret -@var{fret-number} with an optional fingering label @var{finger-value}. +@var{fret-number} with an optional fingering label @var{finger-value}, +and an optional color modifier @var{color-modifier}. By default, the fret playing indicator is a solid dot. This can be -changed by setting the value of the variable @var{dot-color}. If the -@var{finger} part of the @code{place-fret} element is present, +globally changed by setting the value of the variable @var{dot-color}. +Setting @var{color-modifier} to @code{inverted} inverts the dot color +for a specific fingering. +If the @var{finger} part of the @code{place-fret} element is present, @var{finger-value} will be displayed according to the setting of the variable @var{finger-code}. There is no limit to the number of fret indications per string. @@ -1095,13 +1116,13 @@ If there are multiple fret indicators desired on a string, they should be separated by spaces. @item -Fingerings are given by following the fret number with a @code{-}, +Fingerings are given by following the fret number with a @w{@code{-},} followed by the finger indicator, e.g. @samp{3-2} for playing the third fret with the second finger. @item Where a barre indicator is desired, follow the fret (or fingering) symbol -with @code{-(} to start a barre and @code{-)} to end the barre. +with @w{@code{-(}} to start a barre and @w{@code{-)}} to end the barre. @end itemize" ;; TODO -- change syntax to fret\string-finger