]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/snippets/new/defining-predefined-fretboards-for-other-instruments.ly
Doc-it: fix compile.
[lilypond.git] / Documentation / snippets / new / defining-predefined-fretboards-for-other-instruments.ly
1 \version "2.14.0"
2
3 \header {
4   lsrtags = "fretted-strings"
5
6   texidoc = "
7 Predefined fret diagrams can be added for new instruments in addition
8 to the standards used for guitar.  This file shows how this is done by
9 defining a new string-tuning and a few predefined fretboards for the
10 Venezuelan cuatro.
11
12 This file also shows how fingerings can be included in the chords used
13 as reference points for the chord lookup, and displayed in  the fret
14 diagram and the @code{TabStaff}, but not the music.
15
16
17 These fretboards are not transposable because they contain string
18 information.  This is planned to be corrected in the future.
19
20 "
21   doctitle = "Defining predefined fretboards for other instruments"
22 }
23
24 % add FretBoards for the Cuatro
25 %   Note: This section could be put into a separate file
26 %      predefined-cuatro-fretboards.ly
27 %      and \included into each of your compositions
28
29 cuatroTuning = #`(,(ly:make-pitch 0 6 0)
30                   ,(ly:make-pitch 1 3 SHARP)
31                   ,(ly:make-pitch 1 1 0)
32                   ,(ly:make-pitch 0 5 0))
33
34 dSix = { <a\4 b\1 d\3 fis\2> }
35 dMajor = { <a\4 d\1 d\3 fis \2> }
36 aMajSeven = { <a\4 cis\1 e\3 g\2> }
37 dMajSeven = { <a\4 c\1 d\3 fis\2> }
38 gMajor = { <b\4 b\1 d\3 g\2> }
39
40 \storePredefinedDiagram #default-fret-table \dSix
41                         #cuatroTuning
42                         #"o;o;o;o;"
43 \storePredefinedDiagram #default-fret-table \dMajor
44                         #cuatroTuning
45                         #"o;o;o;3-3;"
46 \storePredefinedDiagram #default-fret-table \aMajSeven
47                         #cuatroTuning
48                         #"o;2-2;1-1;2-3;"
49 \storePredefinedDiagram #default-fret-table \dMajSeven
50                         #cuatroTuning
51                         #"o;o;o;1-1;"
52 \storePredefinedDiagram #default-fret-table \gMajor
53                         #cuatroTuning
54                         #"2-2;o;1-1;o;"
55
56 % end of potential include file /predefined-cuatro-fretboards.ly
57
58
59 #(set-global-staff-size 16)
60
61 primerosNames = \chordmode {
62   d:6 d a:maj7 d:maj7
63   g
64 }
65 primeros = {
66   \dSix \dMajor \aMajSeven \dMajSeven
67   \gMajor
68 }
69
70 \score {
71   <<
72     \new ChordNames {
73       \set chordChanges = ##t
74       \primerosNames
75     }
76
77     \new Staff {
78       \new Voice \with {
79         \remove "New_fingering_engraver"
80       }
81       \relative c'' {
82         \primeros
83       }
84     }
85
86     \new FretBoards {
87       \set stringTunings = #cuatroTuning
88 %      \override FretBoard
89 %        #'(fret-diagram-details string-count) = #'4
90       \override FretBoard
91         #'(fret-diagram-details finger-code) = #'in-dot
92       \primeros
93     }
94
95     \new TabStaff \relative c'' {
96       \set TabStaff.stringTunings = #cuatroTuning
97       \primeros
98     }
99
100   >>
101
102   \layout {
103     \context {
104       \Score
105       \override SpacingSpanner
106         #'base-shortest-duration = #(ly:make-moment 1 16)
107     }
108   }
109   \midi { }
110 }