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: Richard Shann
Subject: Re: Ukulele chords entered using < > syntax
Date: Sat, 18 Jun 2016 20:39:57 +0100

Thankyou and Anders too, that's a perfect explanation of what I was
missing.

Richard


On Sat, 2016-06-18 at 21:24 +0200, Malte Meyn wrote:
> 
> 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'>
> }
> 
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user





reply via email to

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