1 ;;;; predefined-fretboards.scm
3 ;;;; source file of the GNU LilyPOnd music typesetter
5 ;;;; (c) 2008 Carl D. Sorensen <c_sorensen@byu.edu>
8 (define-public (parse-terse-string terse-definition)
9 "Parse a fret-diagram-terse definition string @code{terse-definition} and
10 return a marking list, which can be used with a fretboard grob."
11 (cdr (fret-parse-terse-definition-string (list '()) terse-definition)))
13 (define-public (get-chord-shape shape-code tuning base-chord-shapes)
14 "Return the chord shape associated with @code{shape-code} and
15 @code{tuning} in the hash-table @code{base-chord-shapes}."
16 (let ((hash-handle (hash-get-handle base-chord-shapes
17 (cons shape-code tuning))))
22 (define-public (offset-fret fret-offset diagram-definition)
23 "Add @code{fret-offset} to each fret indication in @code{diagram-definition}
24 and return the resulting verbose fret-diagram-definition."
25 (let ((verbose-definition
26 (if (string? diagram-definition)
27 (parse-terse-string diagram-definition)
30 (let ((code (car item)))
34 (+ fret-offset (list-ref item 3)))
38 (+ fret-offset (list-ref item 1)))
40 ((eq? code 'place-fret)
42 (+ fret-offset (list-ref item 2)))