2

For an analytical project I'm working on, I want three separate scores right on top of each other: the bottom staff of the three has the actual music, and the top two staves are of the same size/shape as the actual music, just with the music itself removed (this is where the analysis goes).

I've chosen to approach this by creating three separate scores, each score using the same musical input, just with some of these inputs actively hidden in particular score blocks:

\version "2.20.0"
\language "english"

#(set-default-paper-size "letter")

global = {
  \key e \minor
  \time 2/2
  \partial 4
}

right = \relative c' {
  \global
  \repeat unfold 4 { e8_\mf r8 |
    g4 fs8 e ds4 e8 fs |
    b,4\( cs8 ds e4\)
  }
}

left = \relative c {
  \global
  \repeat unfold 4 { g8( fs |
    e4) a b4._> a8 |
    g4 fs e
  }
}

\score {
  \new PianoStaff <<
    \new Staff = "upper" \right
    \new Staff = "lower" { \clef bass \left }
  >>
  \layout {
    \context {
      \Score
        \remove "Bar_number_engraver"
    }
    \context {
      \Staff
        \remove "Time_signature_engraver"
    }
    \context {
      \Voice
        \hide NoteHead
        \hide Accidental
        \override NoteHead #'no-ledgers = ##t
        \remove "Stem_engraver"
        \remove "Rest_engraver"
        \remove "Phrasing_slur_engraver"
        \remove "Slur_engraver"
        \remove "Tie_engraver"
        \remove "Dynamic_engraver"
        \remove "Dots_engraver"
        \omit Script
    }
  }
}

\score {
  \new PianoStaff <<
    \new Staff = "upper" \right
    \new Staff = "lower" { \clef bass \left }
  >>
  \layout {
    \context {
      \Score
        \remove "Bar_number_engraver"
    }
    \context {
      \Staff
        \remove "Time_signature_engraver"
    }
    \context {
      \Voice
        \hide NoteHead
        \hide Accidental
        \override NoteHead #'no-ledgers = ##t
        \remove "Stem_engraver"
        \remove "Rest_engraver"
        \remove "Phrasing_slur_engraver"
        \remove "Slur_engraver"
        \remove "Tie_engraver"
        \remove "Dynamic_engraver"
        \remove "Dots_engraver"
        \omit Script
    }
  }
}

\score {
  \new PianoStaff <<
    \new Staff = "upper" \right
    \new Staff = "lower" { \clef bass \left }
  >>
  \layout { 
    \context {
      \Staff
        \remove "Time_signature_engraver"
    }
    \context {
      \Voice
        \remove "Stem_engraver"
        \remove "Rest_engraver"
        \remove "Phrasing_slur_engraver"
        \remove "Slur_engraver"
        \remove "Tie_engraver"
        \remove "Dynamic_engraver"
        \remove "Dots_engraver"
        \omit Script
    }
  }
}

Under certain parameters, this works perfectly:

enter image description here

The difficulty comes when the music itself lasts more than one staff line, like by replacing \repeat unfold 3 above with \repeat unfold 4:

enter image description here

How can I move this extra music to the next page so that there's only ever one line of "actual" music shown on a given page? In other words, I want each page to look like the first image up above: two empty staves (each just one line long) and one staff with music (also exactly one line long).

It may also involve a solution without three separate \score blocks, but perhaps all included in a single score (just one without a bracket).

1 Answer 1

4

I’d argue that your approach is most likely going to cause you a lot of headache as it would require very heavy hacks and it most likely won’t turn out the way you intend it to be. Rather I’d suggest you to use a single system, but make it appear as if it were multiple Systems. This can be done it quite a clean way and will behave well. Somewhat like this:

\version "2.22"

\paper {
  % Slightly increase spacing of systems to make distinction easier
  system-system-spacing.basic-distance = #18
}

\layout {
  \context {
    \Score
    % Remove the beginning bar to emulate the look of different Systems.
    \override SystemStartBar.stencil = ##f
    % We also move Bar_number_engraver to StaffGroup to get Bar numbers for each "substaff"
    \remove Bar_number_engraver
  }
  \context {
    \StaffGroup
    % Add a start bar to StaffGroup to add start bar lines to specific parts of the system
    systemStartDelimiter = #'SystemStartBar
    \override SystemStartBar.stencil = #ly:system-start-delimiter::print
    % Add Bar numbers
    \consists Bar_number_engraver
    % Increase spacing of Staff Groups to better mimick the feeling of different systems
    \override StaffGrouper.staffgroup-staff-spacing.basic-distance = #12
  }
}


%% CONTENT

global = {
  \key e \minor
  \time 2/2
  \partial 4
}

right = \relative c' {
  \global
  \repeat unfold 4 { e8_\mf r8 |
    g4 fis8 e dis4 e8 fis |
    b,4\( cis8 dis e4\)
  }
}

left = \relative c {
  \global
  \clef bass
  \repeat unfold 4 { g8( fis |
    e4) a b4._> a8 |
    g4 fis e
  }
}

\layout {
  \context {
    \Staff
      \remove "Time_signature_engraver"
  }
  \context {
    \Voice
      \remove "Stem_engraver"
      \remove "Rest_engraver"
      \remove "Phrasing_slur_engraver"
      \remove "Slur_engraver"
      \remove "Tie_engraver"
      \remove "Dynamic_engraver"
      \remove "Dots_engraver"
      \omit Script
  }
}



<<
  % We use nested groups, StaffGroup for the bar line and PianoStaff for the brace
  \new StaffGroup
  \new PianoStaff \with {
    \hide NoteHead
    \hide Accidental
    \override NoteHead #'no-ledgers = ##t
  }
  <<
    \new Staff \right
    \new Staff \left
  >>

  \new StaffGroup
  \new PianoStaff \with {
    \hide NoteHead
    \hide Accidental
  }
  <<
    \new Staff \right
    \new Staff \left
  >>

  \new StaffGroup
  \new PianoStaff
  <<
    \new Staff \right
    \new Staff \left
  >>
>>

This also has the lovely advantage of being able to specify \paper { systems-per-page = 1 } to simply get only one real system per page, although this does work quite well with multiple systems on one page.

EDIT: In case you’re doing this you’ll probably get weird spacing. Either set \paper { ragged-bottom = ##f } to prevent stretching alltogether or override \layout { \override StaffGroup.StaffGrouper.staffgroup-staff-spacing.stretchability = #100 } to prefer stretching apart the quasisystems rather than the Staves within the systems. Something like this:

\include "previous"

\paper {
  systems-per-page = 1
}

\layout {
  \override StaffGroup.StaffGrouper.staffgroup-staff-spacing.stretchability = #100
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.