lilypond-user
[Top][All Lists]
Advanced

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

Learning LilyPond, comments invited


From: Colin Tennyson
Subject: Learning LilyPond, comments invited
Date: Thu, 2 Jan 2014 11:20:37 -0800 (PST)

My second score created with Lilypond is (again) choral music, set with a
mensurstriche. 
It's a 100 measure score; here I present the first 10 measures, and the
upper two staffs, copy-pasted in this message. Can you please have a look,
your comments are appreciated.

When creating source (HTML/CSS, POVRAY, SVG) I try to apply the general
rules of thumb:
- Separate the things that change from the things that stay the same
- Group the the things that change together
- Do not repeat yourself


As pointed out in the LilyPond documentation, layout of music notation is
both top-down and keeping things synchronized. 

http://www.lilypond.org/doc/v2.17/Documentation/notation/working-with-ancient-music_002d_002dscenarios-and-solutions#mensurstriche-layout

Following the example in the above link I have placed the layout-declaring
commands in a separate group called 'barSetup':
- \hide Staff.BarLine 
- All the instances of \break
- \undo \hide \Staff.BarLine
The \undo \hide \Staff.Barline must be kept in sync with the notes, so it
must be snug with the notes.


It's clear to me now how much the  << .... >> operator is the workhorse of
LilyPond.


I enter everything (barSetup, notes and lyrics) in groups of five measures
on every line.
For the lyrics: I group the underscores for the melisma's according to the
bars (three whitespaces where there is a barline), to help me keep track.

There is the hierarchical ordering:
Score
  StaffGroup
    Staff
      Voice

(And of course there are additional levels in between, as part of the
internal Lilypond implementation. )

As you can see in my 10 measure snippet, I inserted a \transpose between
\Score and \StaffGroup.
It's a null-transposition: c' c'. I don't comment out the \transpose,
because then I have to comment out the closing bracket too, and that would
be error prone. I intend to add a \transpose like that to every score, to
make it transposition-ready.
Incidentally, I noticed that with the \key command inside the \transpose the
key is automatically transposed too. So, transposion is set with a _single
edit_.


I was able to move all of the layout to \layout, using the \context
accessor.
Most of the syntax could be readily inferred:

\StaffGroup
\override Score.BarNumber.font-size = #1.5

\layout {
\context { \Score \override BarNumber.font-size = #1.5 }
}


But this one took many guesses:
\StaffGroup
  \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5)

\layout {
  \context { \Score barNumberVisibility = #(every-nth-bar-number-visible 5)
}
}


Lyrics.

Getting the lyrics to line up with the notes was laborious. I tried to
prepare the lyrics as best as I could, but inevitably there are errors. It
took many iterations to line them up.

In the case of this document the only group that has a pipe symbol for
_every_ barline is the \barSetup group. It would be nice to have other
groups sync up to that one.



++++++++++++++++++++++++++++++++++++++++++++++++++++++++++



\version "2.18.0"
\language "english"

% 't' as in 'test' or 'transcribing an existing score'
tBreak = { \break }
ficta = { \once \set suggestAccidentals = ##t }
addKey = { \key c \major  \time 4/4 }

barSetup = 
{
  \hide Staff.BarLine  % for the Mensurstriche: inside the staff hide the
barline
  s1 |         s1 |         s1 | \tBreak s1 |         s1 |         %005
  s1 |         s1 |         s1 | \tBreak s1 |         s1 |         %010
  \undo \hide Staff.BarLine \bar "||" % final barline visible
}


staffOneNotes =  \relative c'' {
  <<
    {
      g1 | g2 a2 | b2 g2 | r2 a2 | d2. c4 | %005
      b2 a2 | r4 d4 d4 b4 | c4. b8 a8[ g8] a4. g8[ f8 e8] d4 a'2  g2 \ficta
fs4 |  %010
    }
    \barSetup
  >>
}
staffOneWords = \lyricmode { 
  San -- cta Ma -- ri -- a, San -- cta Ma -- %005
  ri -- a, suc -- cur -- re mi- _ _ _ _  _ _ _ _  _ _ %010
}
staffTwoNotes =  \relative c' { 
  << 
    {
      %\clef "G_8"
      g2 c2. d4 a2 | g4. a8 b8[ c8] d2 cs4 d2 | r4 d2 d4 |  %005
      e2 f2 | d2 r2 | c2 f2. d4 f2 | e2 d4. c8 | %010
    }
    \barSetup
  >>
}
staffTwoWords = \lyricmode { 
  San -- cta Ma -- ri -- a, San -- cta %05
  Ma -- ri -- _ _ _ _ _   _ a, suc -- cur -- re mi -- se- _ _  %10
}


#(set-global-staff-size 18)

\header {
  title = "Sancta Maria, succurre miseris"
  composer = "Philippe Verdelot"
  tagline = ""
}


\score {
  \transpose c' c' 
  {
    \new StaffGroup
    <<
      \new Staff 
      <<
        \set Staff.instrumentName = #"Superius " 
        \new Voice = "staffOne" << \addKey \staffOneNotes >>
        \lyricsto "staffOne" \new Lyrics \staffOneWords
      >>
      \new Staff 
      <<
        \set Staff.instrumentName = #"Contratenor " 
        \new Voice = "staffTwo" << \addKey \staffTwoNotes >>
        \lyricsto "staffTwo" \new Lyrics \staffTwoWords
      >>
    >>
  }

  \layout 
  { 
    indent = 6\cm
    %#(layout-set-staff-size 18)
    \context { \Score \hide SystemStartBracket }
    \context { \Score barNumberVisibility = #(every-nth-bar-number-visible
5) }
    \context { \Score \override BarNumber.break-visibility =
#end-of-line-invisible }
    \context { \Score \override BarNumber.self-alignment-X = #LEFT }
    \context { \Score \override BarNumber.font-size = #3 }
    
    \context { \Staff \override InstrumentName.self-alignment-X = #RIGHT }
    
    \context { \Voice \remove "Forbid_line_break_engraver" }
  }
  %\midi { }
}



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Learning-LilyPond-comments-invited-tp156969.html
Sent from the User mailing list archive at Nabble.com.



reply via email to

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