lilypond-user
[Top][All Lists]
Advanced

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

Re: how to add barre indications to automatic fret diagrams?


From: Stephen MacNeil
Subject: Re: how to add barre indications to automatic fret diagrams?
Date: Wed, 20 May 2015 06:09:59 -0400

how about

barre = #(define-music-function (bend location str ) (number?)

#{

\once \override FretBoard.before-line-breaking =

#(lambda (grob)

;(display (ly:grob-property grob 'dot-placement-list))

(ly:grob-set-property! grob 'dot-placement-list

(cons `(barre 6 1 ,str) (ly:grob-property grob 'dot-placement-list))))

#})

fMajorEShape = { <f,-1 c-3 f-4 a-2 c'-1 f'-1> }

gMajorEShape = { \transpose f g { \fMajorEShape } }


\new FretBoards {

\barre #1

\transpose f g { \fMajorEShape }

\barre

\gMajorEShape

\barre #3

<g,-1 d-3 g-4 b-2 d'-1 g'-1>

\set FretBoards.minimumFret = #3

\barre #4

\gMajorEShape

}


HTH

stephen



On Wed, May 20, 2015 at 4:52 AM, pls <address@hidden> wrote:

On 20.05.2015, at 01:58, Thomas Morley <address@hidden> wrote:

Hi Patrick,

maybe this will get you started:

\version "2.19.15"

\new FretBoards {

 \override FretBoard.before-line-breaking =
 #(lambda (grob)
    ;(display (ly:grob-property grob 'dot-placement-list))
    (ly:grob-set-property! grob 'dot-placement-list
       (cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list))))

 <f,-1 c-3 f-4 a-2 c'-1 f'-1>
}

Hi Harm,

thanks a million!  It certainly does get me started.  I think this should be added to the snippet repository.  I could prepare a snippet illustrating your code and some other overrides of details of automatically generated fret diagrams.  Something like that:

\version "2.19.15"

barre = {
  \once \override FretBoard.before-line-breaking =
 #(lambda (grob)
    ;(display (ly:grob-property grob 'dot-placement-list))
    (ly:grob-set-property! grob 'dot-placement-list
       (cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list))))
}

fMajorEShape = { <f,-1 c-3 f-4 a-2 c'-1 f'-1> }

\new FretBoards {  
  \override FretBoards.FretBoard.size = #'2
  \override FretBoard.fret-diagram-details.barre-type = #'straight
  \override FretBoard.fret-diagram-details.finger-code = #'in-dot
%  \override FretBoard.fret-diagram-details.dot-color = #'white
%  \override FretBoard.fret-diagram-details.finger-code = #'below-string
  \override FretBoard.fret-diagram-details.number-type = #'roman-upper
%    \override FretBoard.fret-diagram-details.orientation = #'opposing-landscape
    \override FretBoard.fret-diagram-details.mute-string = #"M"
%    \override FretBoard.fret-diagram-details.label-dir = #DOWN
    \override FretBoard.fret-diagram-details.open-string = #"0"
%   \override FretBoard.fret-diagram-details.string-count = #4 % doesn’t work
%    \override FretBoard.fret-diagram-details.fret-count = #3
   \barre
  <f,-1 c-3 f-4 a-2 c'-1 f'-1>
}

What do you think?

Oh wait, I just tried to transpose the chord but the barre indication is always printed at the first fret:

\version "2.19.15"

barre = {
  \once \override FretBoard.before-line-breaking =
 #(lambda (grob)
    ;(display (ly:grob-property grob 'dot-placement-list))
    (ly:grob-set-property! grob 'dot-placement-list
       (cons '(barre 6 1 1) (ly:grob-property grob 'dot-placement-list))))
}

fMajorEShape = { <f,-1 c-3 f-4 a-2 c'-1 f'-1> }
gMajorEShape = { \transpose f g { \fMajorEShape } }

\new FretBoards {
  \barre
  \transpose f g { \fMajorEShape }
  \barre
  \gMajorEShape
  \barre
  <g,-1 d-3 g-4 b-2 d'-1 g'-1>
  \set FretBoards.minimumFret = #3
  \barre
  \gMajorEShape
}

Is there any way to move it up the fretboard?

Thanks again!
patrick 





On 19.05.2015, at 20:45, pls <address@hidden> wrote:

Hi all,

LilyPond’s automatic fret diagrams really are a very helpful feature! More often than not it helps to not having to predefine and store a diagram in a lookup table.  But it has one little drawback: it doesn’t automatically include a barre indication when several strings are to be covered by one finger.  The default diagram actually looks a bit as if six fingers were needed to play this chord (see example).  

\version "2.19.15"
{
 \new FretBoards {
   <f,-1 c-3 f-4 a-2 c'-1 f'-1>
 }
}

I have had a look at the \override options of the FretBoard and many details are customizable but of course it’s not possible to override a barre indication that isn’t there.  Now, is there a known way to (manually) add barre indications to automatic fret diagrams or do I have to use predefined fret diagrams for barre chords in general?

tia
patrick



reply via email to

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