lilypond - guitar template?

Theory and practice of composition and arranging for classical guitar, discussion of works in progress, etc.
Forum rules
III Our MP3, WMV, MOV, OGG, AVI, Authors' rights

Composers' Workshop
Theory and practice of composition and arranging for classical guitar, discussion of works in progress, etc.

Once you have subscribed to the 002 group, you can attach the following types of files to your messages:
Audio : .mp3 .ogg .wav .flac
Video : .avi .flv .mov .wmv
Score : .pdf .jpg .gif .png
Finale: .mus
wolfgang

lilypond - guitar template?

Post by wolfgang » Wed May 02, 2007 6:22 am

Hi

Well, I know this is a very specific question and I don't expect too many answers, but anyway, worth a try - because this community has been surprising me continuously:

I am using lilypond for score writing since it is free, and I like sourcecode editing due to my IT "history". I'm quite familiar with the basics of the program, but I'm struggling a bit with the guitar specifics, it is very difficult to figure everything from the documentation.

So what I would be looking for is a kind of template file, or example, where I can see how elements like

- string number indicators
- fingerings
- bar chord indicators
- harmonics

and other guitar specific elements are to be correctly coded.

Thanks
Wolfgang

Nick Payne
Amateur luthier
Posts: 794
Joined: Mon Apr 09, 2007 5:21 am
Location: Canberra

Post by Nick Payne » Thu May 03, 2007 11:25 am

This is covered in the Lilypond documentation: http://lilypond.org/doc/v2.11/Documenta ... tar#Guitar

User avatar
Schneider
Posts: 426
Joined: Tue Jul 26, 2011 9:34 am
Location: Paris, France

Re: lilypond - guitar template?

Post by Schneider » Mon Jan 28, 2019 9:42 pm

Here's a possible template based on the following basic coding:

Code: Select all

\version "2.19.82" %% <= a pretty stable version

\paper {
  % where you enter your page settings, eg.:
  oddFooterMarkup = "This compo is copyrighted"
}

\header {
  title = "D minor chord"
  composer = "Me"
  % etc.
}

global = {
  \clef "G_8" 		% <= for guitar
  \time 2/2 		% <= for example
  \key d\minor 		% <= 'cose I love it!
  \tempo "Allegreto"
}

FirstVoice = {
  <d' f'>2
}

SecondVoice = {
  r4 <d a>
}

%% The score:
\score {
  \new Staff <<
    \new Voice { \global \voiceOne \FirstVoice }
    \new Voice { \global \voiceTwo \SecondVoice }
  >>
  \layout { 		% <= how your pdf looks like
    \context {
      \Staff
      instrumentName = "Guitar" %% <= of course!
    }
  }
  \midi { 		% <= if mid output is needed
     \tempo 4 = 108 
  }
}
So let's start with Sor's famous study in B min. ('cose it starts whith 4 voices):

Code: Select all

\version "2.19.82" %% <= still a pretty stable version

#(set-global-staff-size 18) %% size "18" could be the right for one full page

\paper {
  % where you enter your page settings, eg.:
  ragged-last-bottom = ##f
  page-count = 1 % <= 1 page only wanted
  oddFooterMarkup = "This page is copyrighted"
}

\header {
  title = "24 exercices très faciles" % <= are they?
  composer = "Fernando SOR (1778-1839)"
  piece = "No. 22"
  opus = "Op. 35"
  % etc.
}

global = {
  \clef "G_8" 		% <= for guitar, basic
  \time 3/4		% <= for example
  \key b\minor 	% <= 'cose I love it!
}

FirstVoice = {
  \set fingeringOrientations = #'(left)
  | % mes.1
    <d'-2>2 4
  | % mes.2
    <fis'-1>2 4
  | % mes.3
    s2. 
  | % mes.4
    s2.
  | % mes.5
    s2.
  | % mes.6
    s2.
  | % mes.7
    s2.
  | % mes.8
    s2.
  | % mes.9
    s2.
  | % mes.10
    s2.
  | % mes.11
    s2. 
  | % mes.12
    s2.
  | % mes.13
    s2.
  | % mes.14
    s2.
  | % mes.15
    s2.
  | % mes.16
    s2.
  \repeat volta 2 {
    | % mes.17
      s2. 
    | % mes.18
      s2. 
    | % mes.19
      s2.
    | % mes.20
      s2.
    | % mes.21
      s2.
    | % mes.22
      s2.
    | % mes.23
      s2.
    | % mes.24
      s2.
    | % mes.25
      s2. 
    | % mes.26
      s2.
    | % mes.27
      s2.
    | % mes.28
      s2. 
    | % mes.29
      s2.
    | % mes.30
      s2.
    | % mes.31
      s2.
    | % mes.32
      s2.
    | % mes.33
      s2. 
    | % mes.34
      s2. 
    | % mes.35
      s2.
    | % mes.36
      s2.
    | % mes.37
      s2.
    | % mes.38
      s2. 
    | % mes.39
      s2.
    | % mes.40
      s2. 
    | % mes.41
      s2.
    | % mes.42
      s2. 
    | % mes.43
      s2.
    | % mes.44
      s2.
    | % mes.45
      s2. 
    | % mes.46
      s2.
    | % mes.47
      s2.
    | % mes.48
      s2.
  }
}

SecondVoice = {
  | % mes.1
    b,2.~ 
  | % mes.2
    2.
  | % mes.3
    s2. 
  | % mes.4
    s2.
  | % mes.5
    s2.
  | % mes.6
    s2.
  | % mes.7
    s2.
  | % mes.8
    s2.
  | % mes.9
    s2.
  | % mes.10
    s2.
  | % mes.11
    s2. 
  | % mes.12
    s2.
  | % mes.13
    s2.
  | % mes.14
    s2.
  | % mes.15
    s2.
  | % mes.16
    s2.
  \repeat volta 2 {
    | % mes.17
      s2. 
    | % mes.18
      s2. 
    | % mes.19
      s2.
    | % mes.20
      s2.
    | % mes.21
      s2.
    | % mes.22
      s2.
    | % mes.23
      s2.
    | % mes.24
      s2.
    | % mes.25
      s2. 
    | % mes.26
      s2.
    | % mes.27
      s2.
    | % mes.28
      s2. 
    | % mes.29
      s2.
    | % mes.30
      s2.
    | % mes.31
      s2.
    | % mes.32
      s2.
    | % mes.33
      s2. 
    | % mes.34
      s2. 
    | % mes.35
      s2.
    | % mes.36
      s2.
    | % mes.37
      s2.
    | % mes.38
      s2. 
    | % mes.39
      s2.
    | % mes.40
      s2. 
    | % mes.41
      s2.
    | % mes.42
      s2. 
    | % mes.43
      s2.
    | % mes.44
      s2.
    | % mes.45
      s2. 
    | % mes.46
      s2.
    | % mes.47
      s2.
    | % mes.48
      s2.
  }
}

ThirdVoice = {
  \overrideTimeSignatureSettings 3/4 1/8 #'(2 2 2) #'() \time 3/4
  \set fingeringOrientations = #'(left)
  \mergeDifferentlyHeadedOn
  \mergeDifferentlyDottedOn
  \override NoteColumn.force-hshift = 0
  \stemNeutral
  | % mes.1
    \tweak stencil ##f d'8 <b-4> <fis-3> b d' b
  | % mes.2
    \tweak stencil ##f fis'8 d' fis d' fis' d'
  | % mes.3
    s2. 
  | % mes.4
    s2.
  | % mes.5
    s2.
  | % mes.6
    s2.
  | % mes.7
    s2.
  | % mes.8
    s2.
  | % mes.9
    s2.
  | % mes.10
    s2.
  | % mes.11
    s2. 
  | % mes.12
    s2.
  | % mes.13
    s2.
  | % mes.14
    s2.
  | % mes.15
    s2.
  | % mes.16
    s2.
  \repeat volta 2 {
    | % mes.17
      s2. 
    | % mes.18
      s2. 
    | % mes.19
      s2.
    | % mes.20
      s2.
    | % mes.21
      s2.
    | % mes.22
      s2.
    | % mes.23
      s2.
    | % mes.24
      s2.
    | % mes.25
      s2. 
    | % mes.26
      s2.
    | % mes.27
      s2.
    | % mes.28
      s2. 
    | % mes.29
      s2.
    | % mes.30
      s2.
    | % mes.31
      s2.
    | % mes.32
      s2.
    | % mes.33
      s2. 
    | % mes.34
      s2. 
    | % mes.35
      s2.
    | % mes.36
      s2.
    | % mes.37
      s2.
    | % mes.38
      s2. 
    | % mes.39
      s2.
    | % mes.40
      s2. 
    | % mes.41
      s2.
    | % mes.42
      s2. 
    | % mes.43
      s2.
    | % mes.44
      s2.
    | % mes.45
      s2. 
    | % mes.46
      s2.
    | % mes.47
      s2.
    | % mes.48
      s2.
  }
}

FourthVoice = {
  | % mes.1
    s4 fis2
  | % mes.2
    s4 fis2
  | % mes.3
    s2. 
  | % mes.4
    s2.
  | % mes.5
    s2.
  | % mes.6
    s2.
  | % mes.7
    s2.
  | % mes.8
    s2.
  | % mes.9
    s2.
  | % mes.10
    s2.
  | % mes.11
    s2. 
  | % mes.12
    s2.
  | % mes.13
    s2.
  | % mes.14
    s2.
  | % mes.15
    s2.
  | % mes.16
    s2.
  \repeat volta 2 {
    | % mes.17
      s2. 
    | % mes.18
      s2. 
    | % mes.19
      s2.
    | % mes.20
      s2.
    | % mes.21
      s2.
    | % mes.22
      s2.
    | % mes.23
      s2.
    | % mes.24
      s2.
    | % mes.25
      s2. 
    | % mes.26
      s2.
    | % mes.27
      s2.
    | % mes.28
      s2. 
    | % mes.29
      s2.
    | % mes.30
      s2.
    | % mes.31
      s2.
    | % mes.32
      s2.
    | % mes.33
      s2. 
    | % mes.34
      s2. 
    | % mes.35
      s2.
    | % mes.36
      s2.
    | % mes.37
      s2.
    | % mes.38
      s2. 
    | % mes.39
      s2.
    | % mes.40
      s2. 
    | % mes.41
      s2.
    | % mes.42
      s2. 
    | % mes.43
      s2.
    | % mes.44
      s2.
    | % mes.45
      s2. 
    | % mes.46
      s2.
    | % mes.47
      s2.
    | % mes.48
      s2.
  }
}

%% The score:
\score {
  \new Staff <<
    \new Voice { \global \voiceOne \FirstVoice }
    \new Voice { \global \voiceTwo \SecondVoice }
    \new Voice { \global \voiceTwo \ThirdVoice }
    \new Voice { \global \voiceTwo \FourthVoice }
  >>
  \layout { 	
    system-count = 10 % <= this should fit
    \context {
      \Staff
      instrumentName = "Guitar" %% <= of course!
    }
  }
  \midi { 		% <= if mid output is needed
     \tempo 4 = 108 
  }
}
To check, please try to copy/paste the code here: http://lilybin.com/ (using the latest unstable version and removing "\version "2.19.82" )
For any info, please read first: http://lilypond.org/doc/v2.19/Documenta ... index.html

Return to “Composers' Workshop”