[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Minimal examples (was: Last number on a score; but this is the first in
From: |
Malte Meyn |
Subject: |
Minimal examples (was: Last number on a score; but this is the first in the next one...) |
Date: |
Sat, 15 Apr 2017 15:44:42 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
Am 15.04.2017 um 14:30 schrieb Son_V:
> I'm not able to make a truly "minimum example", that's what I could do:
I’ll show you how this can be simplified.
> \version "2.18.2"
> \header {
> }
You don’t need an empty \header, \paper, \layout, … block.
> PartPOneVoiceOne = \relative a' {
> \override Score.BarNumber #'break-visibility = #'#(#t #t #t)
> \clef "treble" \key c \major \numericTimeSignature\time 4/4 a1 | % 2
Clef, key, time signature style don’t have anything to do with your
problem. Omit them.
> a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 a1 | % 3
Try less notes, and if you want multiple lines of music with little
input, try R1*20 or \repeat unfold 20 a1 or something like that. Apart
from that your comments are neither bar nor line numbers so why are they
there?
> b1 | % 4
> c1 \bar "|."
You don’t need that bar line.
> }
> \score {
You don’t need a score block if there is only one score in your lilypond
file.
> <<
You don’t need these outermost << >> because there is only one Staff.
> \new Staff <<
> \set Staff.instrumentName = "Piano"
> \set Staff.shortInstrumentName = "Pno."
Instrument names have nothing to do with your problem.
> \context Staff <<
> \context Voice = "PartPOneVoiceOne" { \PartPOneVoiceOne }
You are already in a Staff context, why state that explicitely again?
And why name your Voice if you don’t have \change commands or \lyricsto
or something similar?
> >>
> >>
> >>
These << >> aren’t necessary if there are no things happening in
parallel (multiple voices, staves, …).
> \layout {}
You don’t need that unless you have some content in this \layout block
or an additional \midi block.
> }
This gives the following almost-minimal example:
%%% BEGIN
\version "2.18.2"
PartPOneVoiceOne = \relative a' {
\override Score.BarNumber.break-visibility = #'#(#t #t #t)
R1*20
}
\new Staff \PartPOneVoiceOne
%%% END
Why almost minimal? Because you don’t need the \new Staff (a staff
created anyway) and your example is so small that you don’t need a
variable definition and usage. Oh, and of course without notes you don’t
need \relative. So here comes a truly minimal working example:
%%% BEGIN
\version "2.18.2"
{
\override Score.BarNumber.break-visibility = #'#(#t #t #t)
R1*20
}
%%% END
Why not omit the version number making this even smaller? Because nobody
has to ask which version you use then :)
Of course it’s not a problem to have a small example that’s not truly
minimal. But your example had 22 lines, mine has 6 (if you count empty
lines) and in so few lines you don’t first have to find out which lines
are relevant for the problem and which are not.
HTH
Malte
Re: Last number on a score; but this is the first in the next one..., Malte Meyn, 2017/04/15