X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fpredefined-fretboards.scm;h=cad0c3b62021809a803a9636299be9cd79a0148f;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=6db63bd90a9ca3205f627b985757e2ca76eea9d0;hpb=8cab78caa0db1ba14f2e52e4c1ddbb541ea0e5cb;p=lilypond.git diff --git a/scm/predefined-fretboards.scm b/scm/predefined-fretboards.scm index 6db63bd90a..cad0c3b620 100644 --- a/scm/predefined-fretboards.scm +++ b/scm/predefined-fretboards.scm @@ -1,46 +1,57 @@ -;;;; predefined-fretboards.scm +;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; source file of the GNU LilyPOnd music typesetter +;;;; Copyright (C) 2008--2015 Carl D. Sorensen ;;;; -;;;; (c) 2008--2009 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 +;;;; the Free Software Foundation, either version 3 of the License, or +;;;; (at your option) any later version. +;;;; +;;;; LilyPond is distributed in the hope that it will be useful, +;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;;; GNU General Public License for more details. +;;;; +;;;; You should have received a copy of the GNU General Public License +;;;; along with LilyPond. If not, see . (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)))