1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
%%%% This file is part of LilyPond, the GNU music typesetter.
%%%%
%%%% Copyright (C) 2010--2015 Carl D. Sorensen <c_sorensen@byu.edu>
%%%%
%%%% LilyPond is free software: you can redistribute it and/or modify
%%%% it under the terms of the GNU General Public License as published by
%%%% the Free Software Foundation, either version 3 of the License, or
%%%% (at your option) any later version.
%%%%
%%%% LilyPond is distributed in the hope that it will be useful,
%%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%%%% GNU General Public License for more details.
%%%%
%%%% You should have received a copy of the GNU General Public License
%%%% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
\version "2.19.22"
%% A stringTuning is a list of pitches ordered by string number
%% from 1 to N.
%% Here we define a number of default string tunings.
%% A music function for converting a chord to a string tuning.
%% The music argument for \makeStringTuning must be a chord in
%% absolute mode ordered from the highest string number to the
%% lowest string number
stringTuning =
#(define-scheme-function (chord)
(ly:music?)
(_i "Convert @var{chord} to a string tuning.
@var{chord} must be in absolute pitches and should have the highest
string number (generally the lowest pitch) first.")
(let* ((ev-chord (car (extract-named-music chord 'EventChord))))
(reverse! (event-chord-pitches ev-chord))))
defaultStringTunings = #'()
makeDefaultStringTuning =
#(define-void-function (symbol pitches) (symbol? list?)
(_i "This defines a string tuning @var{symbol} via a list of @var{pitches}.
The @var{symbol} also gets registered in @code{defaultStringTunings}
for documentation purposes.")
(ly:parser-define! symbol pitches)
(set! defaultStringTunings (acons symbol pitches defaultStringTunings)))
%% guitar tunings
\makeDefaultStringTuning #'guitar-tuning \stringTuning <e, a, d g b e'>
\makeDefaultStringTuning #'guitar-seven-string-tuning \stringTuning <b,, e, a, d g b e'>
\makeDefaultStringTuning #'guitar-drop-d-tuning \stringTuning <d, a, d g b e'>
\makeDefaultStringTuning #'guitar-drop-c-tuning \stringTuning <c, g, c f a d'>
\makeDefaultStringTuning #'guitar-open-g-tuning \stringTuning <d, g, d g b d'>
\makeDefaultStringTuning #'guitar-open-d-tuning \stringTuning <d, a, d fis a d'>
\makeDefaultStringTuning #'guitar-dadgad-tuning \stringTuning <d, a, d g a d'>
\makeDefaultStringTuning #'guitar-lute-tuning \stringTuning <e, a, d fis b e'>
\makeDefaultStringTuning #'guitar-asus4-tuning \stringTuning <e, a, d e a e'>
%% bass tunings
\makeDefaultStringTuning #'bass-tuning \stringTuning <e,, a,, d, g,>
\makeDefaultStringTuning #'bass-four-string-tuning \stringTuning <e,, a,, d, g,>
\makeDefaultStringTuning #'bass-drop-d-tuning \stringTuning <d,, a,, d, g,>
\makeDefaultStringTuning #'bass-five-string-tuning \stringTuning <b,,, e,, a,, d, g,>
\makeDefaultStringTuning #'bass-six-string-tuning \stringTuning <b,,, e,, a,, d, g, c>
%% mandolin tunings
\makeDefaultStringTuning #'mandolin-tuning \stringTuning <g d' a' e''>
%% tunings for 5-string banjo
\makeDefaultStringTuning #'banjo-open-g-tuning \stringTuning <g' d g b d'>
\makeDefaultStringTuning #'banjo-c-tuning \stringTuning <g' c g b d'>
\makeDefaultStringTuning #'banjo-modal-tuning \stringTuning <g' d g c' d'>
\makeDefaultStringTuning #'banjo-open-d-tuning \stringTuning <a' d fis a d'>
\makeDefaultStringTuning #'banjo-open-dm-tuning \stringTuning <a' d fis a d'>
%% ukulele tunings
\makeDefaultStringTuning #'ukulele-tuning \stringTuning <g' c' e' a'>
\makeDefaultStringTuning #'ukulele-d-tuning \stringTuning <a' d' fis' b'>
\makeDefaultStringTuning #'tenor-ukulele-tuning \stringTuning <g c' e' a'>
\makeDefaultStringTuning #'baritone-ukulele-tuning \stringTuning <d g b e'>
%% orchestral strings
\makeDefaultStringTuning #'violin-tuning \stringTuning <g d' a' e''>
\makeDefaultStringTuning #'viola-tuning \stringTuning <c g d' a'>
\makeDefaultStringTuning #'cello-tuning \stringTuning <c, g, d a>
\makeDefaultStringTuning #'double-bass-tuning \stringTuning <e,, a,, d, g,>
%% tunings for 12-string Chapman Stick
\makeDefaultStringTuning #'stick-classic-tuning
\stringTuning <d' a e b, fis, cis, c,, g,, d, a, e b>
\makeDefaultStringTuning #'stick-matched-reciprocal-tuning
\stringTuning <c' g d a, e, b,, c,, g,, d, a, e b>
%% MR™ High Bass 4th % TODO: melody note heights are probably wrong
%stick-tuning-twelve-mr-high =
% \stringTuning <c' g d a e b c,, g,, d, a, e a>
%
%% 12-String Classic™ High Bass 4th % TODO: melody note heights are probably wrong
%stick-tuning-twelve-classic-high =
% \stringTuning <d' a e b, fis, cis, c,, g,, d, a, e a>
%
%% Deep Matched Reciprocal™ % TODO
%stick-tuning-twelve-deep-mr =
% \stringTuning <bes f c g d a bes,, f,, c, g, d a>
%
%% Raised Matched Reciprocal™ % TODO
%stick-tuning-twelve-classic-high =
% \stringTuning <d' a e b, fis, cis, d,, a,, e, b, fis cis>
%
%% Dual Bass Reciprocal™ % TODO
%stick-tuning-twelve-dual-bass-r =
% \stringTuning <f' c g d, a, e, b,, fis,, cis, gis, dis ais>
%% tunings for 10-string Chapman Stick
%% Baritone Melody™ % TODO: melody is wrong
%stick-tuning-ten-baritone =
% \stringTuning <a e b fis cis c,, g,, d, a, e>
%
%% Deep Baritone Melody™ % TODO: melody is wrong
%chapman-stick-ten-deep-baritone =
% \stringTuning <g d a e b c,, g,, d, a, e>
%% tunings for 10-string Alto Stick
%% TODO: check them!
\makeDefaultStringTuning #'alto-stick-tuning
\stringTuning <g d a e b c g d a e>
\makeDefaultStringTuning #'alto-stick-gregs-extended-tuning
\stringTuning <a e b fis cis c g d a e>
\makeDefaultStringTuning #'alto-stick-bobs-expanded-tuning
\stringTuning <a e b fis cis a e b fis cis>
defaultStringTunings = #(reverse! defaultStringTunings)
%% convert 5-string banjo tuning to 4-string by removing the 5th string
four-string-banjo = #(lambda (tuning)
(take tuning 4))
%% convert 12-string Chapman Stick tuning to 10-string tuning
ten-string-stick = #(lambda (tuning)
(append (list-head tuning 5)
(list-head (list-tail tuning 6) 5)))
%% get either the bass or the melody string group
stick-string-group = #(lambda (tuning group)
(let ((num (/ (length tuning) 2)))
(if (equal? group 'bass)
(list-head tuning num)
(list-tail tuning num))))
|