Jump to content

Creating guitar scales on fretboards

From LilyPond wiki
Revision as of 08:56, 1 March 2026 by Taifas (talk | contribs) (d ionic: d e f-sharp g ...)

This snippet creates fretboards with guitar scales.

The syntax is

\scale-diagramm #'( (string1 fret1) (string2 fret2) ... ) #notesinscale #size

For example for a c pentatonic scale (first six notes)

\scale-diagramm #'((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

cpenta = \markup \scale-diagramm #'((5 3) (5 5 ) (4 3) (4 5) (3 2) (3 5)) #5 #1.5

and use it like this

c^\cpenta d f g a c

The snippet doesn't show it, but the (1) position of the scale is inverted

LilyPond rendering error

LilyPond log:
Running as unit: run-p1016793-i5210649.service
Changing working directory to: `/tmp/lilywiki-tmp1b1b7e90bc'
Processing `/tmp/lilywiki-tmp1b1b7e90bc/file.ly'
Parsing...
/tmp/lilywiki-tmp1b1b7e90bc/file.ly:56:17: error: not a note name: fs
  d,, e^\dmajor
                fs g a^"d Ionic"      b c d e f g a b c d r | \break
Interpreting music...[8]
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...
Layout output to `file.svg'...
fatal error: failed files: "/tmp/lilywiki-tmp1b1b7e90bc/file.ly"