lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: alternate fretboard table


From: Gary Brookman
Subject: Re: alternate fretboard table
Date: Tue, 28 Sep 2021 18:49:48 +0000


Thank you for the quick response.

Regarding the learning part. I'm impressed by the depth of the documentation and especially all the snippets/sample code. What I know about me is that reading an entire manual without playing with the code at each step doesn't work. And hopping from link to link leaves me lost.  If I ever fully grok Lilypond maybe I'll write a quick start guide that would work for ADD types like me.

With your sample code I'm seeing the same output as from mine. I typed the definition incorrectly, it should be:
\addChordShape #'sixthstring #guitar-tuning #"8-2;x;7-1;9-3;x;x;"
For the C chord I want to see the dots on:
string 6, fret 8,
string 4, fret 7
string 3, fret 9

but I'm seeing
string 3, fret 5
string 2, fret 5
string 1, fret 3

in fact, changing to
\addChordShape #'sixthstring #guitar-tuning #"1;2;3;4;5;6;"
or
\addChordShape #'sixthstring #guitar-tuning #"x;x;x;x;x;x;"
gives the same results.

Also, the fingerings aren't shown.

The displayed chord isn't in the fretboard table so I'm guessing this comes into play.
"If no predefined diagram is available for the entered notes in the active stringTunings, this context calculates strings and frets that can be used to play the notes. "

That voicing is actually a C6, so thinking that maybe notes are being validated I changed to
\chordmode { c:6 }
but that didn't help either.

This is what I'm running with now:
% ==============================================
% Make a blank new fretboard table
#(define swing-fretboard-table (make-fretboard-table))

% Add a new chord shape
\addChordShape #'sixthstring #guitar-tuning #"8-2;x;7-1;9-3;x;x;"

% add a three note C6 with root on the sixth string
\storePredefinedDiagram #swing-fretboard-table
                        \chordmode { c:6 }
                        #guitar-tuning
                        #(chord-shape 'sixthstring guitar-tuning)

% add a three-note d with root on the sixth string
\storePredefinedDiagram #swing-fretboard-table
                        \chordmode { d:6 }
                        #guitar-tuning
                        #(offset-fret 2
                           (chord-shape 'sixthstring guitar-tuning))

% add a three-note b with root on the sixth string
\storePredefinedDiagram #swing-fretboard-table
                        \chordmode { b:6 }
                        #guitar-tuning
                        #(offset-fret -2
                           (chord-shape 'sixthstring guitar-tuning))

mychords = \chordmode
{
  c:6 c':6 c'':6 d:6 b:6
}
<<
  \context ChordNames
  {
    \mychords
  }

  \context FretBoards % you can use the \with syntax by uncommenting the next line
     % \with {predefinedDiagramTable = \swing-fretboard-table}

  {
       % Set the new fretboard table to be the default table
       % or you can use the \set format by uncommenting the next line
       %\set predefinedDiagramTable = #swing-fretboard-table
    \mychords
  }
>>


From: Carl Sorensen <c_sorensen@byu.edu>
Sent: Tuesday, September 28, 2021 12:47 PM
To: Gary Brookman <GaryBrookman@outlook.com>; lilypond-user@gnu.org <lilypond-user@gnu.org>
Subject: Re: alternate fretboard table
 

 

 

From: lilypond-user <lilypond-user-bounces+carl.d.sorensen=gmail.com@gnu.org> on behalf of Gary Brookman <GaryBrookman@outlook.com>
Date: Tuesday, September 28, 2021 at 8:40 AM
To: "lilypond-user@gnu.org" <lilypond-user@gnu.org>
Subject: alternate fretboard table

 

I'm a complete Lilypond neophyte, so please excuse me if I'm missing the basics.

 

Welcome!  We love to have new people getting into LilyPond!  And as one who was responsible for much of the fretboard architecture and implementation, I’m always happy to see others using this work.

 

 

I am learning to play rhythm to jazz standards. A friend is an expert on voicings used in big band and swing settings, and none of these are in the predefined fretboard table. After some reading, what makes sense to me is to create an alternative fretboard table with just the voicings I want. To that end I tried:

% Make a blank new fretboard table

#(define swing-fretboard-table (make-fretboard-table))

 

% Add a new chord shape

\addChordShape #'sixthstring #guitar-tuning #"8-2;7-1;9-3;x;x;x;"

 

 

% add a three note c with root on the sixth string

\storePredefinedDiagram #swing-fretboard-table

                        \chordmode { c }

                        #guitar-tuning

                        #(chord-shape 'sixthstring guitar-tuning)

 

mychords = \chordmode

{

  c c' c''

}

 

<< 

  \context ChordNames

  {

    \mychords

  }

  \context FretBoards

  {

    \mychords

  }

>> 

 

Not successful.

1.      is this a good approach to the problem?

This is a good general approach, but the specifics aren’t right.

2.      Even if not, why doesn't this approach work for this one chord?

3.      What's the best way to get up to speed on LilyPond?

The best way to get up to speed, in my opinion, is to do the following:

  1. READ the Learning Manual.  The Learning Manual introduces the basics in a way that will help you to learn them.  They build on one another.  If you don’t understand the basics, you won’t be able to use the rest of the materials.  It’s annoying to have to read a whole book, rather than just grab some snippets.  But it’s really important.
  2. Use the Notation Reference.  Pay attention to the SeeAlso parts of the Notation Reference.  Use the Snippets that are linked from the Notation Reference.

In this particular case, going to the Notation Reference fretted strings section, and following the links from the See Also got me to this snippet:

https://lilypond.org/doc/v2.22/Documentation/snippets/fretted-strings#fretted-strings-fretboards-alternate-tables

This shows how to add a new fretboard table and use it.

\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 |

      }

    >>

  }

>> 

I know #3 isn't necessarily straight forward, but this is what I've experienced so far. There is a wealth of information available, but not in a form I'm used to digesting. I'm a retired programmer and late in my career I picked up python. I could search for any aspect of the language and find all sorts of help. I'm not finding that with Lilypond. For instance, the learning manual and Youtube videos show the syntax for only the most basic of use cases. But when I see I need addChordShape and search for it I find the definition:

\addChordShape [void] - key-symbol (symbol) tuning (pair) shape-definition (string or pair)

and a use case:

\addChordShape #'powerf #guitar-tuning "1-1;3-3;3-4;x;x;x;"

But what does symbol refer to? what's the # and ' for?

Symbol is a Scheme variable.  The # puts you from lilypond mode into Scheme mode.  The ' is how you get the name of the symbol, rather than evaluating the symbol, in Scheme.  These are discussed in the Learning Manual.  (# is discussed at http://lilypond.org/doc/v2.22/Documentation/learning/tweaking-methods#the-override-command ; ' is discussed at http://lilypond.org/doc/v2.22/Documentation/learning/properties-found-in-interfaces ).  This is why you need to read the Learning Manual.

 

I think I know now, but that's from tons of searching and reading. I would expect that to be an introduction article. I'm sure it's out there and I just missed it. Is there a tutorial or article that provides the glue that ties together all the components that comprise this environment and how they interface?

The Learning Manual.

 

Note that \chordmode{c} and \chordmode{c’} produce the same set of pitches, for historical reasons that I’m not sure I completely understand.  So c and c’ will produce the same fretboard in your example, but c’’ will not.

 

Putting this all together with your code, we do the following:

 

\version "2.20"

 

% Make a blank new fretboard table

#(define swing-fretboard-table (make-fretboard-table))

 

% Add a new chord shape

\addChordShape #'sixthstring #guitar-tuning #"8-2;7-1;9-3;x;x;x;"

 

% add a three note c with root on the sixth string

\storePredefinedDiagram #swing-fretboard-table

                        \chordmode { c }

                        #guitar-tuning

                        #(chord-shape 'sixthstring guitar-tuning)

% add a three-note d with root on the sixth string

\storePredefinedDiagram #swing-fretboard-table

                        \chordmode { d }

                        #guitar-tuning

                        #(offset-fret 2

                           (chord-shape 'sixthstring guitar-tuning))

% add a three-note b with root on the sixth string

\storePredefinedDiagram #swing-fretboard-table

                        \chordmode { b }

                        #guitar-tuning

                        #(offset-fret -2

                           (chord-shape 'sixthstring guitar-tuning))

 

 

 

mychords = \chordmode

{

  c c' c'' d b

}

 

<< 

  \context ChordNames

  {

    \mychords

  }

  \context FretBoards % you can use the \with syntax by uncommenting the next line

     % \with {predefinedDiagramTable = \swing-fretboard-table}

  {

       % Set the new fretboard table to be the default table

       % or you can use the \set format by uncommenting the next line

       %\set predefinedDiagramTable = #swing-fretboard-table

    \mychords

   

  }

>> 

 

Hope this has been helpful,

 

Carl

 

 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]