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