As I finish up a sight-singing course packet, I'm wondering if it's
possible for LilyPond to automatically number the individual scores from
beginning to end.

Throughout the document, I have six different types of score contexts,
shown in mwe.ly.

The perfect solution would be a fix where LilyPond automatically creates a
`\with { instrumentName = "1. " }`, where the "1." here becomes dynamic and
adjusts depending on the ordering of the score samples within the document.

Perhaps there is only a solution where we can insert a variable that will
increase by one at every occurrence. If so, this is sufficient; I can write
my own script to insert all necessary `instrumentName = "var"` entries.

Thanks,

Sam
\version "2.19.63"
\language "english"

%%%%%%%%%%%%%%%%%%%%
%%%    VIOLIN    %%%
%%%%%%%%%%%%%%%%%%%%

violin = \relative c' {
  g
}

\score {
  \new Staff \violin
  \layout { }
}

%%%%%%%%%%%%%%%%%%%%
%%%  VOICEPIANO  %%%
%%%%%%%%%%%%%%%%%%%%

sopranoVoice = \relative c' {
  g
}

verse = \lyricmode {
  Hi
}

right = \relative c' {
  g
}

left = \relative c {
  g
}

sopranoVoicePart = \new Staff { \sopranoVoice }
\addlyrics { \verse }

pianoPart = \new PianoStaff <<
  \new Staff = "right" \right
  \new Staff = "left" { \clef bass \left }
>>

\score {
  <<
    \sopranoVoicePart
    \pianoPart
  >>
  \layout { }
}

%%%%%%%%%%%%%%%%%%%%
%%%     DUET     %%%
%%%%%%%%%%%%%%%%%%%%

altoVoice = \relative c'' {
  g
}

bassVoice = \relative c {
  g
}

altoVoicePart = \new Staff { \clef treble \altoVoice }

bassVoicePart = \new Staff { \clef bass \bassVoice }

\score {
  \new ChoirStaff <<
    \altoVoicePart
    \bassVoicePart
  >>
  \layout { }
}

%%%%%%%%%%%%%%%%%%%%
%%%     VOICE    %%%
%%%%%%%%%%%%%%%%%%%%

sopranoVoice = \relative c'' {
  g
}

verse = \lyricmode {
  Hi
}

\score {
  \new Staff { \sopranoVoice }
  \addlyrics { \verse }
  \layout { }
}

%%%%%%%%%%%%%%%%%%%%
%%%     SATB     %%%
%%%%%%%%%%%%%%%%%%%%

soprano = \relative c'' {
  g
}

alto = \relative c' {
  g
}

tenor = \relative c' {
  g
}

bass = \relative c {
  g
}


\score {
  \new ChoirStaff <<
    \new Staff \with { \consists "Ambitus_engraver" } \new Voice = "soprano" \soprano
    \new Staff \with { \consists "Ambitus_engraver" } { \clef alto \new Voice = "alto" \alto }
    \new Staff \with { \consists "Ambitus_engraver" } { \clef tenor\new Voice = "tenor" \tenor }
    \new Staff \with { \consists "Ambitus_engraver" } { \clef bass \new Voice = "bass" \bass }
  >>
  \layout { }
}

%%%%%%%%%%%%%%%%%%%%
%%%  VOICEPIANO2 %%%
%%%%%%%%%%%%%%%%%%%%

melody = \relative c' {
  g
}

text = \lyricmode {
  Hi
}

upper = \relative c' {
  g
}

lower = \relative c, {
  g
}

\score {
  <<
    { 
      \new Voice = "mel" { \autoBeamOff \melody 
      }
    }
    \new Lyrics \lyricsto mel \text
    \new PianoStaff <<
      \set PianoStaff.connectArpeggios = ##t
      \new Staff = "upper" \upper
      \new Staff = "lower" \lower
    >>
  >>
  \layout {
    \context { \Staff \RemoveEmptyStaves }
  }
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to