LEFT | RIGHT |
1 %%%% This file is part of LilyPond, the GNU music typesetter. | 1 %%%% This file is part of LilyPond, the GNU music typesetter. |
2 %%%% | 2 %%%% |
3 %%%% Copyright (C) 2010 Carl D. Sorensen <c_sorensen@byu.edu> | 3 %%%% Copyright (C) 2010 Carl D. Sorensen <c_sorensen@byu.edu> |
4 %%%% | 4 %%%% |
5 %%%% LilyPond is free software: you can redistribute it and/or modify | 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 | 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 | 7 %%%% the Free Software Foundation, either version 3 of the License, or |
8 %%%% (at your option) any later version. | 8 %%%% (at your option) any later version. |
9 %%%% | 9 %%%% |
10 %%%% LilyPond is distributed in the hope that it will be useful, | 10 %%%% LilyPond is distributed in the hope that it will be useful, |
11 %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 %%%% GNU General Public License for more details. | 13 %%%% GNU General Public License for more details. |
14 %%%% | 14 %%%% |
15 %%%% You should have received a copy of the GNU General Public License | 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/>. | 16 %%%% along with LilyPond. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
18 \version "2.13.45" | 18 \version "2.13.46" |
19 | 19 |
20 %% A stringTuning is a list of pitches ordered by string number | 20 %% A stringTuning is a list of pitches ordered by string number |
21 %% from 1 to N. | 21 %% from 1 to N. |
22 %% Here we define a number of default string tunings. | 22 %% Here we define a number of default string tunings. |
23 | 23 |
24 %% A scheme function for converting a chord to a string tuning | 24 %% A scheme function for converting a chord to a string tuning |
25 #(define (chord->tuning parser tuning-symbol chord) | 25 #(define (chord->tuning parser tuning-symbol chord) |
26 (let* ((ev-chord (car (extract-named-music chord 'EventChord))) | 26 (let* ((ev-chord (car (extract-named-music chord 'EventChord))) |
27 (pitches (event-chord-pitches ev-chord))) | 27 (pitches (event-chord-pitches ev-chord))) |
28 (ly:parser-define! parser tuning-symbol (reverse pitches)))) | 28 (ly:parser-define! parser tuning-symbol (reverse pitches)))) |
29 | 29 |
30 %% A music function for converting a chord to a string tuning. | 30 %% A music function for converting a chord to a string tuning. |
31 %% The music argument for \makeStringTuning must be a chord in | 31 %% The music argument for \makeStringTuning must be a chord in |
32 %% absolute mode ordered from the highest string number to the | 32 %% absolute mode ordered from the highest string number to the |
33 %% lowest string number | 33 %% lowest string number |
| 34 |
34 makeStringTuning = | 35 makeStringTuning = |
35 #(define-music-function (parser location tuning chord) | 36 #(define-music-function (parser location tuning chord) |
36 (symbol? ly:music?) | 37 (symbol? ly:music?) |
37 (_ "Convert @{chord} to a string tuning stored in @code{tuning}. | 38 (_ "Convert @{chord} to a string tuning stored in @code{tuning}. |
38 @{chord} must be in absolute pitches and should have the highest | 39 @{chord} must be in absolute pitches and should have the highest |
39 string number (generally the lowest pitch) first. @code{tuning} | 40 string number (generally the lowest pitch) first. @code{tuning} |
40 should be a string that will be converted to a symbol.") | 41 should be a string that will be converted to a symbol.") |
41 (begin | 42 (begin |
42 (chord->tuning parser tuning chord) | 43 (chord->tuning parser tuning chord) |
43 (make-music 'SequentialMusic 'void #t))) | 44 (make-music 'SequentialMusic 'void #t))) |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 #(define-public (four-string-banjo tuning) | 126 #(define-public (four-string-banjo tuning) |
126 (reverse (cdr (reverse tuning)))) | 127 (reverse (cdr (reverse tuning)))) |
127 | 128 |
128 %% make all of the default string tunings | 129 %% make all of the default string tunings |
129 | 130 |
130 \makeDefaultStringTunings #defaultStringTunings | 131 \makeDefaultStringTunings #defaultStringTunings |
131 | 132 |
132 % restore the language | 133 % restore the language |
133 \languageRestore | 134 \languageRestore |
134 | 135 |
LEFT | RIGHT |