lilypond-devel
[Top][All Lists]
Advanced

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

Re: Incipits


From: David Kastrup
Subject: Re: Incipits
Date: Thu, 03 Jul 2014 16:57:55 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

"Phil Holmes" <address@hidden> writes:

> As I said earlier, I'm working on the incipit snippet to make it fit
> as a Lilypond command.  I've spent a loooong time trying to work out
> how the spacing of the incipit (its length and placing) is related to
> the indent of the main music.  In summary, it doesn't work.  In the
> code attached, you can see 2 versions of the incipit code, both with
> fixed incipit length (8 cm) and left indent (2 cm).  One uses \layout
> { $(ly:grob-layout grob) and the other a simple \layout.  The attached
> image shows that the incipit size on the first version is wrong; on
> the second it's right.
>
> Does anyone know what's happening here?

Here is the explanation:

\pointAndClickOff

incipitA =
#(define-music-function (parser location incipit-music) (ly:music?)
  #{
    \once \override Staff.InstrumentName.self-alignment-Y = ##f
    \once \override Staff.InstrumentName.self-alignment-X = #RIGHT
    \once \override Staff.InstrumentName.stencil =
      #(lambda (grob)
        (let* ((instrument-name (ly:grob-property grob 'long-text)))
        (set! (ly:grob-property grob 'long-text)
          #{ \markup {
            \score
            {
              \new Staff
              {
                \once \override Staff.InstrumentName.self-alignment-X = #LEFT
                \set Staff.instrumentName = #instrument-name
                $incipit-music
              }
              \layout { $(ly:grob-layout grob)
                #(format #t "grob::cm: ~a\n" (module-ref (current-module) 'cm))
                line-width = 8\cm
                indent = 2\cm
                ragged-right = ##f
                ragged-last = ##f
                \context {
                  \Score
                  \remove "Default_bar_line_engraver"
                }
              }
            }
            }
          #})
          (system-start-text::print grob)))
  #}
)

incipitB =
#(define-music-function (parser location incipit-music) (ly:music?)
  #{
    \once \override Staff.InstrumentName.self-alignment-Y = ##f
    \once \override Staff.InstrumentName.self-alignment-X = #RIGHT
    \once \override Staff.InstrumentName.stencil =
      #(lambda (grob)
        (let* ((instrument-name (ly:grob-property grob 'long-text)))
        (set! (ly:grob-property grob 'long-text)
          #{ \markup {
            \score
            {
              \new Staff
              {
                \once \override Staff.InstrumentName.self-alignment-X = #LEFT
                \set Staff.instrumentName = #instrument-name
                $incipit-music
              }
              \layout {
                #(format #t "layout::cm: ~a\n" (module-ref (current-module) 
'cm))
                line-width = 8\cm
                indent = 2\cm
                ragged-right = ##f
                ragged-last = ##f
                \context {
                  \Score
                  \remove "Default_bar_line_engraver"
                }
              }
            }
            }
          #})
          (system-start-text::print grob)))
  #}
)

\score {
  {
    \set Staff.instrumentName = #"Altus"
    \incipitA { f''1 }
    \repeat unfold 10 c''1 \break
    \repeat unfold 10 c''1
  }
  \layout { indent = 8\cm }
}

\score {
  {
    \set Staff.instrumentName = #"Altus"
    \incipitB { f''1 }
    \repeat unfold 10 c''1 \break
    \repeat unfold 10 c''1
  }
  \layout { indent = 8\cm }
}
This would supposedly be related to

commit ae49e0dd10feea60fb5bd76cfb6406b7a0cf3e95
Author: David Kastrup <address@hidden>
Date:   Tue Mar 19 09:37:23 2013 +0100

    Issue 3261: regtest 'incipit.ly' compressed
    
    After dimensions in \score markup have been fixed in issue 677,
    several example of incipits in the LilyPond codebase were
    overcompensating for the previous bug.  This fixes them.

and

commit 84cf69f7c840700a83ca6a9ae9e6b6f2e9f9f1f9
Author: David Kastrup <address@hidden>
Date:   Mon Dec 31 18:15:41 2012 +0100

    Issue 677: \score markup confuses paper settings
    
    I actually have no idea whether this is the right fix, but it seems to
    do something related to the TODO comments and the issue report.


I don't really have an idea where the scale of ly:grob-layout is
actually coming from, but it would appear like the compensation for
issue 677 will not work for both the standard \layout and the grob
layout, the latter apparently already being scaled ?

At any rate, if calculations with sizes are done, it would seem
imperative to be talking about the same cm, so possibly the scaling in
issue 677 does not happen at the right place.

-- 
David Kastrup

reply via email to

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