1 ;;;; This file is part of LilyPond, the GNU music typesetter.
3 ;;;; Copyright (C) 2008--2010 Carl D. Sorensen <c_sorensen@byu.edu>
5 ;;;; LilyPond is free software: you can redistribute it and/or modify
6 ;;;; it under the terms of the GNU General Public License as published by
7 ;;;; the Free Software Foundation, either version 3 of the License, or
8 ;;;; (at your option) any later version.
10 ;;;; LilyPond is distributed in the hope that it will be useful,
11 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ;;;; GNU General Public License for more details.
15 ;;;; You should have received a copy of the GNU General Public License
16 ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
19 (define-public (parse-terse-string terse-definition)
20 "Parse a fret-diagram-terse definition string @code{terse-definition} and
21 return a marking list, which can be used with a fretboard grob."
22 (cdr (fret-parse-terse-definition-string (list '()) terse-definition)))
24 (define-public (get-chord-shape shape-code tuning base-chord-shapes)
25 "Return the chord shape associated with @code{shape-code} and
26 @code{tuning} in the hash-table @code{base-chord-shapes}."
27 (let ((hash-handle (hash-get-handle base-chord-shapes
28 (cons shape-code tuning))))
33 (define-public (offset-fret fret-offset diagram-definition)
34 "Add @code{fret-offset} to each fret indication in @code{diagram-definition}
35 and return the resulting verbose fret-diagram-definition."
36 (let ((verbose-definition
37 (if (string? diagram-definition)
38 (parse-terse-string diagram-definition)
41 (let ((code (car item)))
45 (+ fret-offset (list-ref item 3)))
49 (+ fret-offset (list-ref item 1)))
51 ((eq? code 'place-fret)
53 (+ fret-offset (list-ref item 2)))