lilypond-user
[Top][All Lists]
Advanced

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

Fret diagram position


From: Marius Andersen
Subject: Fret diagram position
Date: Thu, 22 Jan 2009 22:22:58 +0000 (GMT)

I want to set a piece for guitar with LilyPond version 2.12.1. The score should 
have three staves: sung melody, guitar regular notes, and guitar tablature. 
Here is my basic starting point (my verbose ending point is provided in full at 
the end of this message):

    \version "2.12.1"

    \score {
      <<
        \new Voice = "mel" {
          \relative c' {
            %% Sung notes go here
            R1
          }
        }
        \new StaffGroup <<
          \new Staff {
            \relative c' {
              %% Guitar notes go here
              g'4 g g g
            }
          }
          \new TabStaff {
            \relative c {
              %% Guitar tablature goes here
              g'4\3 g\3 g\3 g\3
            }
          }
        >>
      >>
    }

In addition, I want to annotate the piece with fret diagrams, to provide a 
basis for custom strumming/improvisation. If I define

    %% Define fret diagram
    gFretDiagram = \markup {
      \fret-diagram #"6-3-2;5-2-1;4-o;3-o;2-o;1-3-3;"
    }

and replace the guitar notes with

    %% Guitar notes go here
    g'4^\gFretDiagram g g g

then I get a G fret diagram between the melody staff and the guitar staff.

But this isn't quite what I want: the fret diagrams should be *above the melody 
staff*, not above the guitar staff. Still, I *do* want to use the guitar notes 
as the basis for placing fret diagrams, because there might be parts when only 
the guitar is playing, i.e., when the melody staff is empty.

To this end, lilypond-snippets.pdf suggests on page 297 (316) to modify the 
#'extra-offset value:

    %% Guitar notes go here
    \override TextScript #'extra-offset = #'(0 . 15)
    g'4^\gFretDiagram g g g

However, this leaves a gigantic space between the melody staff and the guitar 
staff where the diagram used to be, and it leaves no space for it where it is 
placed. The complete code is below. How to improve it?

    \version "2.12.1"

    %% Define fret diagram
    gFretDiagram = \markup {
      \fret-diagram #"6-3-2;5-2-1;4-o;3-o;2-o;1-3-3;"
    }

    \score {
      <<
        \new Voice = "mel" {
          \relative c' {
            %% Sung notes go here
            R1
          }
        }
        \new StaffGroup <<
          \new Staff {
            \relative c' {
              %% Guitar notes go here
              \override TextScript #'extra-offset = #'(0 . 15)
              g'4^\gFretDiagram g g g
            }
          }
          \new TabStaff {
            \relative c {
              %% Guitar tablature goes here
              g'4\3 g\3 g\3 g\3
            }
          }
        >>
      >>
    }


      _________________________________________________________
Alt i ett. Få Yahoo! Mail med adressekartotek, kalender og
notisblokk. http://no.mail.yahoo.com




reply via email to

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