5

I was trying to "update" and change some properties from the "Blank Staff Page" piece of code that appears here:

https://snipplr.com/view/579/blank-staff-paper-with-lilypond

Which is this:

\version "2.9.13"

\header {

tagline = "http://george.sudarkoff.com/music"

}

\paper {

#(set-paper-size "letter")

top-margin = 0.7\cm

}

emptymusic = {

\repeat unfold 10 % Change this for more lines.

{ s1\break }

}

\layout { 

indent = 0.0\cm

pagenumber = no

}

\new Score \with {

\override TimeSignature #'transparent = ##t

\override Clef #'transparent = ##t

defaultBarType = #""

\remove Bar_number_engraver

\remove Clef_engraver

} <<

\context Staff \emptymusic

>>

Since it's made in a really early version and the coding style feels a little odd (for me) I was trying to put it in a more understandable way, but I can't seem to understand some things in the documentation.

This is what I've come up with so far, but it doesn't compile since it has errors:

\version "2.23.2"

\header {
tagline = ##f
% tagline = "http://george.sudarkoff.com/music"
}

\paper {
#(set-paper-size "letter")
top-margin = 0.7\cm
}

emptymusic = {
\repeat unfold 33 % Change this for more lines.
{ s1\break }
}

\layout {
indent = 0.0\cm
pagenumber = no
}

score {

    \relative {
        \omit Score.BarLine
        \emptymusic
    }

\layout {
    \context {
        \Score
        % defaultBarType = #""
        \omit BarNumber
        #(layout_set_staff_size 20)
    }
    \context {
    \Staff
    \override TimeSignature #'transparent = ##t
    \override Clef #'transparent = ##t
    \remove Clef_engraver
    }
}
}

Can someone please guide me to what things I should hide and how to write them?

3 Answers 3

7

Well, an obvious mistake is that you need \score instead of just score — you're missing a backslash. Also the pagenumber = no looks really suspicious. I haven't tried to compile your code, but I don't think it can be correct.

Anyway, the whole code seems to be way too complicated. What about this?

\header { tagline = ##f }

\score {
  \new Staff
  {
    \omit Staff.Clef
    \omit Staff.BarLine
    \omit Staff.TimeSignature
    \omit Score.BarNumber
    \repeat unfold 14 { s1 | \break }
  }
  \layout {}
}

\paper {
  indent = #0
  print-page-number = ##f
}

I guess that the code should be pretty self-explanatory — get rid of the tagline, then make a staff with 14 spacer rests, each stretched over a whole line by demanding a \break after each. Omit clefs, barlines, time signatures and bar numbers. Finally, get rid of the first line indent and the page numbers (in case you wanted this to be more than one page long).

1
  • I also thought the pagenumber = no was really weird. But probably it worked in that version. I didn't notice the ` \ ` , thank you to point it out!
    – Kai Vinter
    Commented Jul 26, 2022 at 20:09
7

There is a page in the documentation that shows how to make staff paper in the newest version of LilyPond:
https://lilypond.org/doc/v2.23/Documentation/snippets/paper-and-layout#paper-and-layout-creating-blank-staves


Personally though, I like much more space around and between the staves, and a much larger staff size so that handwritten music is easier to read, here is an example for with a grand staff:

\version "2.23.6"

\header {
    title = " "
    subtitle = " "
    composer = " "
    copyright = " "
    tagline = " "
}

\score {
    \new PianoStaff {
        <<
            \new Staff {
                \repeat unfold 6 { 
                    s1 | 
                    \break 
                }
                \pageBreak
                \repeat unfold 6 { 
                    s1 | 
                    \break 
                }
            }
            \new Staff {
                \repeat unfold 6 { 
                    s1 |
                }
                \repeat unfold 6 { 
                    s1 |
                }
            }
        >>
    }
}

#(set-global-staff-size 28)

\paper {
    #(set-paper-size "a4")
    indent = 1\in
    print-page-number = ##f
    top-margin = 1\in
    left-margin = 0.5\in
    right-margin = 0.5\in
    bottom-margin = 0.5\in
}

\layout {
    \context {
        \Staff
            \remove "Time_signature_engraver"
            \remove "Clef_engraver"
            \remove "Bar_engraver"
    }
    \context {
        \Score
            \remove "Bar_number_engraver"
    }
}

2

Uh... That is Lilypond version 2.9, which was the development version for 2.10, releasing in November 2006. So this piece of code is at least 16 year old. Often such old code will not work with a recent version of Lilypond due to changes of syntax, so you need to be careful here. This is not the case here though.

So let’s use Lilypond’s output to debug what’s happening:

The first error we get is

[path]:23:7: Error: syntax error, unexpected '{', expecting '.' or '='
score 
      {

That one is pretty clear, you need to do \score, not score. So if we change this we get

[path]:35:10: Error: GUILE signaled an error for the expression
        #
         (layout_set_staff_size 20)

That one is pretty clear, scheme naming tends to go towards dash separation, so the function is layout-set-staff-size. If we change this we get

/tmp/frescobaldi-n_lvp44g/tmp7nw498b6/document.ly:35:9: Error: not a context mod
        
        #(layout-set-staff-size 20)

This comes because you specify the layout-set-staff-size within the \Score context, where it does not belong. Put it directly into the layout block outside of any \context block, and your code will run fine.

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.