X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fpredefined-fretboards.scm;h=5140ae6e91093e0a7f8a92ba94a76b7bcba8330e;hb=2d4c0d05b577400295471bc2cb5881e0d5b5012c;hp=31a4e3919c8f2cb6a41587a6b5457777a72b66b0;hpb=b7a0cffbf9d1069860368f289a5b50e9d1d90ba8;p=lilypond.git diff --git a/scm/predefined-fretboards.scm b/scm/predefined-fretboards.scm index 31a4e3919c..5140ae6e91 100644 --- a/scm/predefined-fretboards.scm +++ b/scm/predefined-fretboards.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 2008--2009 Carl D. Sorensen +;;;; Copyright (C) 2008--2012 Carl D. Sorensen ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by @@ -17,41 +17,41 @@ (define-public (parse-terse-string terse-definition) -"Parse a fret-diagram-terse definition string @code{terse-definition} and -return a marking list, which can be used with a fretboard grob." - (cdr (fret-parse-terse-definition-string (list '()) terse-definition))) + "Parse a @code{fret-diagram-terse} definition string @var{terse-definition} +and return a marking list, which can be used with a fretboard grob." + (cdr (fret-parse-terse-definition-string (list '()) terse-definition))) (define-public (get-chord-shape shape-code tuning base-chord-shapes) -"Return the chord shape associated with @code{shape-code} and -@code{tuning} in the hash-table @code{base-chord-shapes}." + "Return the chord shape associated with @var{shape-code} and +@var{tuning} in the hash-table @var{base-chord-shapes}." (let ((hash-handle (hash-get-handle base-chord-shapes - (cons shape-code tuning)))) - (if hash-handle - (cdr hash-handle) - '()))) + (cons shape-code tuning)))) + (if hash-handle + (cdr hash-handle) + '()))) (define-public (offset-fret fret-offset diagram-definition) -"Add @code{fret-offset} to each fret indication in @code{diagram-definition} -and return the resulting verbose fret-diagram-definition." - (let ((verbose-definition - (if (string? diagram-definition) - (parse-terse-string diagram-definition) - diagram-definition))) - (map (lambda(item) - (let ((code (car item))) - (cond - ((eq? code 'barre) - (list-set! item 3 - (+ fret-offset (list-ref item 3))) - item) - ((eq? code 'capo) - (list-set! item 1 - (+ fret-offset (list-ref item 1))) - item) - ((eq? code 'place-fret) - (list-set! item 2 - (+ fret-offset (list-ref item 2))) - item) - (else item)))) - verbose-definition))) - + "Add @var{fret-offset} to each fret indication in +@var{diagram-definition} and return the resulting verbose +@code{fret-diagram-definition}." + (let ((verbose-definition + (if (string? diagram-definition) + (parse-terse-string diagram-definition) + diagram-definition))) + (map (lambda(item) + (let ((code (car item))) + (cond + ((eq? code 'barre) + (list-set! item 3 + (+ fret-offset (list-ref item 3))) + item) + ((eq? code 'capo) + (list-set! item 1 + (+ fret-offset (list-ref item 1))) + item) + ((eq? code 'place-fret) + (list-set! item 2 + (+ fret-offset (list-ref item 2))) + item) + (else item)))) + verbose-definition)))