lilypond-user
[Top][All Lists]
Advanced

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

Learning Lilypond, comments invited - part 2


From: Colin Tennyson
Subject: Learning Lilypond, comments invited - part 2
Date: Fri, 3 Jan 2014 04:41:15 -0800 (PST)

I'm creating a new thread because the previous one has become somewhat
cluttered.

My template is much better now, thank you for your suggestions.

As emphasized by David Kastrup, the keyword \new instructs Lilypond to
create a new instance of a class. 
\new StaffGroup creates an instance of the StaffGroup object.

In this template several properties of the Score class are modified, such
as:     
\hide Score.SystemStartBracket
\override Score.BarNumber.font-size = #1.5

I surmise that the StaffGroup object inherits from the Score object, similar
to inheritence in object oriented programming.



Again, this is the first 10 measures and the upper 2 staffs of a 100
measure, 4 staff score.

I'm pleased with the separations in this template.
- The declaration of the nesting structure now contains only the nesting of
the elements
- Properties of the elements are all declared in \layout


One thing remains: the property "forbid_line_break_engraver" is a property
of the element Voice
If possible I want to avoid repeating commands. I don't want to put in the
\remove "forbid_line_break_engraver" four times, for every voice in the
score.

For the other properties I was able to use a dot notation access. Examples:
\hide Score.SystemStartBracket
\override Staff.InstrumentName.self-alignment-X = #RIGHT    

The accessor \context allows the property to be set centrally:
\context { \Voice \remove "Forbid_line_break_engraver" }

But is just a side effect? Is \context meant for something else entirely?
Can the property "forbid_line_break_engraver" also be accessed using a dot
notation? 





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

\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 |         %05
  s1 |         s1 |         s1 | \tBreak s1 |         s1 |         %10
  \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
}
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
}
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 {
  \new StaffGroup
  <<
    \new Staff 
    <<
      \set Staff.instrumentName = #"Superius " 
      \new Voice = "staffOne" { \addKey \staffOneNotes }
      \lyricsto "staffOne" \new Lyrics \staffOneWords
      \barSetup
    >>
    \new Staff 
    <<
      \set Staff.instrumentName = #"Contratenor " 
      \new Voice = "staffTwo" { \addKey \staffTwoNotes }
      \lyricsto "staffTwo" \new Lyrics \staffTwoWords
      \barSetup
    >>
  >>

  \layout 
  { 
    indent = 6\cm
    \hide Score.SystemStartBracket
    \override Score.BarNumber.font-size = #1.5
    \override Score.BarNumber.break-visibility = #end-of-line-invisible 
    \override Score.BarNumber.self-alignment-X = #LEFT 
    \set Score.barNumberVisibility = #(every-nth-bar-number-visible 5) 
    \override Staff.InstrumentName.self-alignment-X = #RIGHT    

    \context { \Voice \remove "Forbid_line_break_engraver" }
    %#(layout-set-staff-size 18)
  }
  %\midi { }
}



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



reply via email to

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