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