1 %%%% This file is part of LilyPond, the GNU music typesetter.
3 %%%% Copyright (C) 2010--2012 Carl D. Sorensen <c_sorensen@byu.edu>
5 %%%% LilyPond is free software: you can redistribute it and/or modify
6 %%%% it under the terms of the GNU General Public License as published by
7 %%%% the Free Software Foundation, either version 3 of the License, or
8 %%%% (at your option) any later version.
10 %%%% LilyPond is distributed in the hope that it will be useful,
11 %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
12 %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 %%%% GNU General Public License for more details.
15 %%%% You should have received a copy of the GNU General Public License
16 %%%% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 %% A stringTuning is a list of pitches ordered by string number
22 %% Here we define a number of default string tunings.
24 %% A music function for converting a chord to a string tuning.
25 %% The music argument for \makeStringTuning must be a chord in
26 %% absolute mode ordered from the highest string number to the
27 %% lowest string number
30 #(define-scheme-function (parser location chord)
32 (_i "Convert @var{chord} to a string tuning.
33 @var{chord} must be in absolute pitches and should have the highest
34 string number (generally the lowest pitch) first.")
35 (let* ((ev-chord (car (extract-named-music chord 'EventChord))))
36 (reverse! (event-chord-pitches ev-chord))))
38 defaultStringTunings = #'()
40 makeDefaultStringTuning =
41 #(define-void-function (parser location symbol pitches) (symbol? list?)
42 (_i "This defines a string tuning @var{symbol} via a list of @var{pitches}.
43 The @var{symbol} also gets registered in @code{defaultStringTunings}
44 for documentation purposes.")
45 (ly:parser-define! parser symbol pitches)
46 (set! defaultStringTunings (acons symbol pitches defaultStringTunings)))
49 \makeDefaultStringTuning #'guitar-tuning \stringTuning <e, a, d g b e'>
50 \makeDefaultStringTuning #'guitar-seven-string-tuning \stringTuning <b,, e, a, d g b e'>
51 \makeDefaultStringTuning #'guitar-drop-d-tuning \stringTuning <d, a, d g b e'>
52 \makeDefaultStringTuning #'guitar-open-g-tuning \stringTuning <d, g, d g b d'>
53 \makeDefaultStringTuning #'guitar-open-d-tuning \stringTuning <d, a, d fis a d'>
54 \makeDefaultStringTuning #'guitar-dadgad-tuning \stringTuning <d, a, d g a d'>
55 \makeDefaultStringTuning #'guitar-lute-tuning \stringTuning <e, a, d fis b e'>
56 \makeDefaultStringTuning #'guitar-asus4-tuning \stringTuning <e, a, d e a e'>
59 \makeDefaultStringTuning #'bass-tuning \stringTuning <e,, a,, d, g,>
60 \makeDefaultStringTuning #'bass-four-string-tuning \stringTuning <e,, a,, d, g,>
61 \makeDefaultStringTuning #'bass-drop-d-tuning \stringTuning <d,, a,, d, g,>
62 \makeDefaultStringTuning #'bass-five-string-tuning \stringTuning <b,,, e,, a,, d, g,>
63 \makeDefaultStringTuning #'bass-six-string-tuning \stringTuning <b,,, e,, a,, d, g, c>
66 \makeDefaultStringTuning #'mandolin-tuning \stringTuning <g d' a' e''>
68 %% tunings for 5-string banjo
69 \makeDefaultStringTuning #'banjo-open-g-tuning \stringTuning <g' d g b d'>
70 \makeDefaultStringTuning #'banjo-c-tuning \stringTuning <g' c g b d'>
71 \makeDefaultStringTuning #'banjo-modal-tuning \stringTuning <g' d g c' d'>
72 \makeDefaultStringTuning #'banjo-open-d-tuning \stringTuning <a' d fis a d'>
73 \makeDefaultStringTuning #'banjo-open-dm-tuning \stringTuning <a' d fis a d'>
76 \makeDefaultStringTuning #'ukulele-tuning \stringTuning <g' c' e' a'>
77 \makeDefaultStringTuning #'ukulele-d-tuning \stringTuning <a' d' fis' b'>
78 \makeDefaultStringTuning #'tenor-ukulele-tuning \stringTuning <g c' e' a'>
79 \makeDefaultStringTuning #'baritone-ukulele-tuning \stringTuning <d g b e'>
82 \makeDefaultStringTuning #'violin-tuning \stringTuning <g d' a' e''>
83 \makeDefaultStringTuning #'viola-tuning \stringTuning <c g d' a'>
84 \makeDefaultStringTuning #'cello-tuning \stringTuning <c, g, d a>
85 \makeDefaultStringTuning #'double-bass-tuning \stringTuning <e,, a,, d, g,>
87 defaultStringTunings = #(reverse! defaultStringTunings)
89 %% convert 5-string banjo tuning to 4-string by removing the 5th string
90 "four-string-banjo" = #(lambda (tuning)