lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Another page-break problem, particularly fiendish


From: Urs Liska
Subject: Re: Another page-break problem, particularly fiendish
Date: Fri, 4 Nov 2016 14:04:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0


Am 04.11.2016 um 04:48 schrieb mclaren:
> This score fragment follows up on Lilypond code originally posted by Hans
> Åberg  and Malte Men back in June, 2014, on this forum. I've carried the
> notation a little bit farther. 
>
> The question I have is: how the devil to generate a proper page break in a
> score like this?

Sorry to repeat myself: First by fixing the content of the score, then
by taking care of the breaking and barlines problem.
Barlines will be "fixed" automatically by that, and the solution for the
breaks is the same as with the Nancarrow-like example: Remove the
engraver that prohibits line breaks during note events and then add an
independent layer doing the \bar "" \break thing throughout all staves.

>
> If there's a make-moment value that will do it, I can't figure it out. Any
> suggestions?

First looking at the upper staff.
First of all: with \cadenzaOn you will never get any bar lines, so why
are you adding that?
Then: you don't have any \time command, so LilyPond will implicitly
assume a 4/4 time signature, which consequently causes any barchecks to
fail. You can see that when you comment out the time signature markup.

So the first thing you have to do is calculate and add a proper
measure-length (but correctly this time).
Then you have to check that your actual measure content matches the
measure length. Apart from calculations you should use barchecks for
that. If LilyPond reports a barcheck error, even in this range of time
signatures, I can assure you that there *is* something wrong with the
input file and not with LilyPond's calucaltions.

To be able to properly debug this it is crucial that you go back and
take the smallest possible segments, first removing any multiple staves.
Once you have one staff straight so barchecks succeed and the barlines
are at the right places, repeat that with the other staff.

Then you have to move "Default_barline_engraver" and "Timing_translator"
from Score to Staff (actually, when complaining about misbehaviour in
that complex metric situations, and you don't have even this in place,
you shouldn't expect any answers at all).

Once you have the two staves working so they properly align all notes
horizontally and print correct barlines you can go for the breaking.

Three bonus recommendations:
1)
Always use barchecks and don't ask the list about secondary problems as
long as LilyPond reports barcheck errors (or time signature changes
within measures).
2)
Look for examples about better structure of your code. Use better
indentation and distribution to new lines. Add spaces around brackets.
3)
I really suggest you practice your coding skills with less complex
material until you're really comfortable with it. Most of your questions
so far *originated* from faulty input so we couldn't even assess if
there's anything wrong with LilyPond or suggest "best practices" to what
you intended to achieve.

Urs


PS: There's a completely different, seemingly much simpler solution.
If you use \cadenzaOn as you seem to intend you can simply insert
barlines with
    \bar "|"
(don't use barchecks then). Once you have properly moved the Timing to
the Staff context this will easily work out (see attachment) and you can
then add the line breaks as suggested earlier.

However, this has a severe drawback: you take over the full control
about timing, e.g. whether the content length of a measure matches it
displayed time signature. This is a responsibility *I* wouldn't want to
take.

>
>
> \version "2.18.2" 
>  
>
> \header{ 
>   title = "Example of irrational meter"
> % Based on code by Hans Aberg and Malte Meyn, posted to Lilypond Nabble
> forum June 2014 
>  
>   tagline = ##f  % Removing "Music engraving by LilyPond (version)" 
> } 
>
>
> above = { \once \override Script #'script-priority = #-100 } 
> below = { \once \override TextScript #'script-priority = #-100 } 
>
>
> irrtuplet = \once \override TupletNumber.text = 
>  \markup \concat { 
>     
>    \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "17"
>    ":"
>    \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "3"
>  } 
>
> irrtupletb = \once \override TupletNumber.text = 
>  \markup \concat { 
>     
>    \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "23"
>    ":"
>    \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "5"
>  } 
>  
>  irrtupletc = \once \override TupletNumber.text = 
>  \markup \concat { 
>     
>    \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "3"
>    
>  } 
>
> music = << \new Staff { \clef "treble"
>   \tempo 4 = 73 
>  \cadenzaOn
>
>   \override Staff.TimeSignature.stencil = #ly:text-interface::print 
>   \override Staff.TimeSignature.text = 
>   \markup \override #'(baseline-skip . 0) \center-column \number { 
>     \concat { 
>         \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "337" \tiny "/" "17"
>    
>    % sqr(3) + 4*sqr(17):sqr(3) =
>    % sqr(17)/[sqr(17)*sqr(3)] + sqr(16)*[sqr(3)/sqr(17)] =
>    % = sqr(289)/sqr(3) + sqr(48)/sqr(17) = 
>    % sqr(337)/sqr(17) = 4.45236 quarter notes.
>   
>     } 
>     \concat { 
>       
>       \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "17"
>    ":"
>    \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "3" 
>     } 
>   } 
>
>
>   \override TupletNumber.text = #tuplet-number::calc-fraction-text 
>
>   \relative c' { 
>    { 
>       \once \override TextScript #'padding = #1.0 
>       
>       \irrtuplet \tuplet 219/92 {f8[ g] a[ d,]} \irrtuplet \tuplet 219/92
> {e8[ g] b[ f]} \irrtupletc \tuplet 627/362 {r4}
>       |
>       \irrtuplet \tuplet 219/92 {a8[ g] a[ d,]} \irrtuplet \tuplet 219/92
> {e8[ g] b[ f]} \irrtupletc \tuplet 627/362 {r4}
>        
>        | 
>       } 
>     } 
>   } 
>   
>   \new Staff { \clef "bass"
>   
>  
>
>   \override Staff.TimeSignature.stencil = #ly:text-interface::print 
>   \override Staff.TimeSignature.text = 
>   \markup \override #'(baseline-skip . 0) \center-column \number { 
>     \concat { 
>       "4" 
>       
>     } 
>     \concat { 
>       
>       \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "23"
>    ":"
>    \tiny "√" 
>    \hspace #-0.15 
>    \override #'(offset . -16) 
>    \override #'(thickness . 1.6) 
>    \underline "5" 
>     } 
>   } 
>
>
>   \override TupletNumber.text = #tuplet-number::calc-fraction-text 
>
>   \relative c { 
>    { 
>       \once \override TextScript #'padding = #1.0 
>        
>       \irrtupletb \tuplet 716/395 {a'8[ e] c[ b']} \irrtupletb \tuplet
> 716/395 {e,8[ b] d[ a']} 
>       |
>       \irrtupletb \tuplet 716/395 {f8[ e] c[ b']} \irrtupletb \tuplet
> 716/395 {e,8[ b] d[ a']}   
>        | 
>       } 
>     } 
>   } 
>
> \score { 
>   \music 
>         \layout {
>         
>         #(set-default-paper-size "a4" 'landscape)
>         
>         }
> } 
>  
>
>
>
> --
> View this message in context: 
> http://lilypond.1069038.n5.nabble.com/Another-page-break-problem-particularly-fiendish-tp196126.html
> Sent from the User mailing list archive at Nabble.com.
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

Attachment: document.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]