Fix missing volta bracket edge when using new double repeats.
[lilypond.git] / ly / predefined-fretboards-init.ly
blobe999c93a4d38a0792e8156c23b91dbb97ddfa298
1 %%%% predefined-fretboard-init.ly
2 %%%%
3 %%%% source file of the GNU LilyPond music typesetter
4 %%%%
5 %%%% (c) 2008 Carl D. Sorensen <c_sorensen@byu.edu>
7 \version "2.11.56"
9 %%%%% define storage structures
11 % base-chord-shapes is an alist of chord shapes
12 % in the form of fret-diagram-terse strings with
13 % scheme symbols as keys. For convenience, the
14 % symbols are LilyPond chordmode chord descriptions,
15 % but that is unnecessary.
17 #(define base-chord-shapes '())
20 % music function for adding a chord shape to
21 % base-chord-shapes
23 addChordShape =
24 #(define-music-function (parser location key-symbol shape-string)
25 (symbol? string?)
26 "Add chord shape @code{shape-string} to the @code{base-chord-shapes}
27 alist with the key @code{key-symbol}."
28 (set! base-chord-shapes
29 (acons key-symbol shape-string base-chord-shapes))
30 (make-music 'SequentialMusic 'void #t))
32 % for convenience, to eliminate storage list in .ly references
34 #(define (chord-shape shape-code)
35 (get-chord-shape shape-code base-chord-shapes))
37 % music function for adding a predefined diagram to
38 % fretboard-table
40 storePredefinedDiagram =
41 #(define-music-function (parser location chord tuning terse-definition)
42 (ly:music? list? string?)
43 "Add predefined fret diagram defined by fret-diagram-terse definition
44 string @code{terse-definition} for the chord pitches @code{chord} and
45 the stringTuning @code{tuning}."
46 (let* ((pitches (event-chord-pitches
47 (car (extract-named-music chord 'EventChord))))
48 (hash-key (cons tuning pitches)))
49 (hash-set! fretboard-table
50 hash-key
51 (parse-terse-string terse-definition)))
52 (make-music 'SequentialMusic 'void #t))