Compile fix.
[lilypond.git] / ly / predefined-fretboards-init.ly
blob353c015b8c8bb4f203e957bf35aca03e560f01d5
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 (set! base-chord-shapes
27 (acons key-symbol shape-string base-chord-shapes))
28 (make-music 'SequentialMusic 'void #t))
30 % for convenience, to eliminate storage list in .ly references
32 #(define (chord-shape shape-code)
33 (get-chord-shape shape-code base-chord-shapes))
35 % music function for adding a predefined diagram to
36 % fretboard-table
38 storePredefinedDiagram =
39 #(define-music-function (parser location chord tuning terse-definition)
40 (ly:music? list? string?)
41 (let* ((pitches (event-chord-pitches
42 (car (extract-named-music chord 'EventChord))))
43 (hash-key (cons tuning pitches)))
44 (hash-set! fretboard-table
45 hash-key
46 (parse-terse-string terse-definition)))
47 (make-music 'SequentialMusic 'void #t))