Creating guitar scales on fretboards: Difference between revisions
D major with 2 sharps Tags: Mobile edit Mobile web edit |
mNo edit summary |
||
| Line 3: | Line 3: | ||
The syntax is | The syntax is | ||
\scale- | \scale-diagram #'( (string1 fret1) (string2 fret2) ... ) | ||
#notes-in-scale #size | |||
As an example, here is a c pentatonic scale (first six notes). | |||
\scale- | \scale-diagram #'((5 3) (5 5) (4 3) (4 5) (3 2) (3 5)) #5 #1.5 | ||
You can wrap this up in a markup command for building up a list of scales as follows | |||
cpenta = \markup \scale- | cpenta = \markup | ||
\scale-diagram #'((5 3) (5 5) (4 3) (4 5) (3 2) (3 5)) #5 #1.5 | |||
and use it like this | and use it like this | ||
c^\cpenta d f g a c | c^\cpenta d f g a c | ||
The snippet doesn't show it, but the (1) position of the scale is inverted | The snippet doesn't show it, but the (1) position of the scale is inverted. | ||
<lilypond version="2.24"> | |||
% Helper function to invert first elements of scales | % Helper function to invert first elements of scales | ||
#(define (inverted num mod) | #(define (inverted num mod) | ||
| Line 41: | Line 37: | ||
% arg2 is the number of unique tones in the scale (i.e. 7 for major scale, 5 for pentatonic) | % arg2 is the number of unique tones in the scale (i.e. 7 for major scale, 5 for pentatonic) | ||
% arg3 is a scale factor used to enlarge the fret diagram | % arg3 is a scale factor used to enlarge the fret diagram | ||
#(define-markup-command (scale- | #(define-markup-command (scale-diagram layout props arg1 arg2 arg3) (list? integer? number?) | ||
(interpret-markup layout props | (interpret-markup layout props | ||
(markup | (markup | ||
| Line 58: | Line 54: | ||
cmajor=\markup\scale- | cmajor=\markup\scale-diagram #'((5 3) (5 5) (4 2) (4 3) (4 5) (3 2) (3 4) | ||
(3 5) (2 3) (2 5) (2 6) (1 3) (1 5) (1 7) (1 8)) #7 #1.0 | |||
dmajor=\markup\scale-diagram #'((5 5) (5 7) (4 4) (4 5) (4 7) (3 4) (3 6) | |||
(3 7) (2 5) (2 7) (2 8) (1 5) (1 7) (1 9) (1 10)) #7 #1.35 | |||
cpenta=\markup\scale-diagram #'((5 3) (5 5) (4 3) (4 5) (3 2) | |||
\ | (3 5) (2 3) (2 6) (1 3) (1 5) (1 8)) #5 #1.7 | ||
\relative c' { | \relative c' { | ||
| Line 79: | Line 70: | ||
</lilypond> | </lilypond> | ||
[[Category:Fretted strings]] | [[Category:Fretted strings]] | ||
[[Category:Scheme]] | [[Category:Scheme]] | ||
[[Category:Pitches]] | [[Category:Pitches]] | ||
[[Category:Snippet]] | [[Category:Snippet]] | ||