lilypond-user
[Top][All Lists]
Advanced

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

Re: Ukulele chords entered using < > syntax


From: Malte Meyn
Subject: Re: Ukulele chords entered using < > syntax
Date: Sat, 18 Jun 2016 21:24:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0



Am 18.06.2016 um 21:00 schrieb Richard Shann:
With this code I get an error and the lowest (re-entrant) string is not used

\version "2.18.0"
\include "predefined-ukulele-fretboards.ly"
%\storePredefinedDiagram #default-fret-table <g' c' e' c''> #ukulele-tuning 
#"o;o;o;3;"
\score
    {
        \new FretBoards {
        \set Staff.stringTunings = #ukulele-tuning
        <g' c' e' c''>
        }
    }


You can specify the string number for the g' string:
        <g'\4 c' e' c''>
You won’t need the \include and the \storePredefinedDiagram then.

If you have many chords this can be automated so you just have to type
        <g' c' e' c''>
or (with a variant shown in the comments below) even
        <g c e c'>
by using the following music function. This relies on the pitch order: The first is always assigned to the fourth string (g').

%%%%%%%%%%%

\version "2.18.2"

prepareChordsForUkulele =
#(define-music-function (parser location music) (ly:music?)
   (music-map
    (lambda (m)
      (if (music-is-of-type? m 'event-chord)
          (begin
           (ly:music-set-property!
            (car (ly:music-property m 'elements))
            'articulations
            (list (make-music
                   'StringNumberEvent
                   'string-number
                   4)))
           m)
          m))
    music))

% you can save many ' if you replace the last line
% of the music function above by
%    (ly:music-transpose music (ly:make-pitch 1 0 0))))

\new FretBoards \with {
  stringTunings = #ukulele-tuning
} \prepareChordsForUkulele {
  <g' c' e' c''>
  <a' d' fis' d''>
  <g' d' g' b'>
}



reply via email to

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