Jump to content

Fretboards alternate tables: Difference between revisions

From LilyPond wiki
No edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
Alternate fretboard tables can be created. These would be used in order to have alternate fretboards for a given chord.
Alternate fretboard tables can be created. These would be used in order to have alternate fretboards for a given chord. In order to use an alternate fretboard table, the table must first be created. Fretboards are then added to the table.


In order to use an alternate fretboard table, the table must first be created. Fretboards are then added to the table.
The created fretboard table can be blank, or it can be copied from an existing table. The table to be used in displaying predefined fretboards is selected by the property <code>\predefinedDiagramTable</code>.
 
The created fretboard table can be blank, or it can be copied from an existing table.
 
The table to be used in displaying predefined fretboards is selected by the property <code>\predefinedDiagramTable</code>.


<lilypond version="2.24">
<lilypond version="2.24">
\include "predefined-guitar-fretboards.ly"
\include "predefined-guitar-fretboards.ly"


% Make a blank new fretboard table
% Make a blank new fretboard table.
#(define custom-fretboard-table-one
#(define custom-fretboard-table-one
   (make-fretboard-table))
   (make-fretboard-table))


% Make a new fretboard table as a copy of default-fret-table
% Make a new fretboard table as a copy of `default-fret-table`.
#(define custom-fretboard-table-two
#(define custom-fretboard-table-two
   (make-fretboard-table default-fret-table))
   (make-fretboard-table default-fret-table))


% Add a chord to custom-fretboard-table-one
% Add a chord to `custom-fretboard-table-one`.
\storePredefinedDiagram #custom-fretboard-table-one
\storePredefinedDiagram #custom-fretboard-table-one
                         \chordmode {c}
                         \chordmode {c}
Line 24: Line 20:
                         "3-(;3;5;5;5;3-);"
                         "3-(;3;5;5;5;3-);"


% Add a chord to custom-fretboard-table-two
% Add a chord to `custom-fretboard-table-two`.
\storePredefinedDiagram #custom-fretboard-table-two
\storePredefinedDiagram #custom-fretboard-table-two
                         \chordmode {c}
                         \chordmode {c}
Line 56: Line 52:
       {
       {
         s1_\markup "Default table" | s1 |
         s1_\markup "Default table" | s1 |
         s1_\markup \column {"New table" "from empty"} | s1 |
         s1_\markup \column { "New table" "from empty" } | s1 |
         s1_\markup \column {"New table" "from default"} | s1 |
         s1_\markup \column { "New table" "from default" } | s1 |
       }
       }
     >>
     >>
Line 65: Line 61:


[[Category:Fretted strings]]
[[Category:Fretted strings]]
[[Category:Included in the official documentation]][[Category:Snippet]]
[[Category:Scheme]]
[[Category:Included in the official documentation]]
[[Category:Snippet]]

Latest revision as of 21:23, 14 December 2025

Alternate fretboard tables can be created. These would be used in order to have alternate fretboards for a given chord. In order to use an alternate fretboard table, the table must first be created. Fretboards are then added to the table.

The created fretboard table can be blank, or it can be copied from an existing table. The table to be used in displaying predefined fretboards is selected by the property \predefinedDiagramTable.

\version "2.24"

\include "predefined-guitar-fretboards.ly"

% Make a blank new fretboard table.
#(define custom-fretboard-table-one
   (make-fretboard-table))

% Make a new fretboard table as a copy of `default-fret-table`.
#(define custom-fretboard-table-two
   (make-fretboard-table default-fret-table))

% Add a chord to `custom-fretboard-table-one`.
\storePredefinedDiagram #custom-fretboard-table-one
                        \chordmode {c}
                        #guitar-tuning
                        "3-(;3;5;5;5;3-);"

% Add a chord to `custom-fretboard-table-two`.
\storePredefinedDiagram #custom-fretboard-table-two
                        \chordmode {c}
                        #guitar-tuning
                        "x;3;5;5;5;o;"

<<
  \chords {
    c1 | d1 |
    c1 | d1 |
    c1 | d1 |
  }
  \new FretBoards {
    \chordmode {
      \set predefinedDiagramTable = #default-fret-table
      c1 | d1 |
      \set predefinedDiagramTable = #custom-fretboard-table-one
      c1 | d1 |
      \set predefinedDiagramTable = #custom-fretboard-table-two
      c1 | d1 |
    }
  }
  \new Staff {
    \clef "treble_8"
    <<
      \chordmode {
        c1 | d1 |
        c1 | d1 |
        c1 | d1 |
      }
      {
        s1_\markup "Default table" | s1 |
        s1_\markup \column { "New table" "from empty" } | s1 |
        s1_\markup \column { "New table" "from default" } | s1 |
      }
    >>
  }
>>