Jump to content

Spacing notes using an invisible staff: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m Replace version="2.24.0" with version="2.24" now that the LilyWiki extension supports auto-selecting the latest release in a stable series
Line 1: Line 1:
When entering partially typeset music (i.e. for students to be completed by hand), you may need the spacing that correspond to the timing of notes: all measures have same length, etc. It can be implemented by adding an invisible staff with a lot of fast notes.
When entering partially typeset music (i.e. for students to be completed by hand), you may need the spacing that correspond to the timing of notes: all measures have same length, etc. It can be implemented by adding an invisible staff with a lot of fast notes.


<lilypond version="2.24.0">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=126
%% http://lsr.di.unimi.it/LSR/Item?id=126



Revision as of 18:54, 16 November 2025

When entering partially typeset music (i.e. for students to be completed by hand), you may need the spacing that correspond to the timing of notes: all measures have same length, etc. It can be implemented by adding an invisible staff with a lot of fast notes.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=126

%LSR modified by P.P.Schneider on Feb.2014

quickmeasure =  {
  \hideNotes
  \repeat unfold 64 c''16
}

mel =  \relative c' { 
  c16 d16 e8 a4 g2 
  e8 d c2. 
  g'1 
  e4 d c2 
}

\score {
  \context PianoStaff  <<
    \new Staff <<
      \clef G
      \new Voice { \mel }
      \new Voice { \quickmeasure }
    >>
    \new Staff  { 
      \clef F 
      s1*4 
    }
  >>
  \layout {}
}