lilypond-user
[Top][All Lists]
Advanced

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

Re: the custos: understanding how it works


From: Thomas Morley
Subject: Re: the custos: understanding how it works
Date: Sun, 22 Nov 2015 18:43:39 +0100

2015-11-22 16:41 GMT+01:00 Leszek Wroński <address@hidden>:
> I was delighted to learn that Lilypond allows one to use custodes. I was
> wondering how they really work, namely, how one can, upon a linebreak, check
> what the next pitch is. I have limited Scheme experience. I first tried the
> code for the first example from here:
> http://www.lilypond.org/doc/v2.19/Documentation/notation/typesetting-mensural-music
> and enclosed it (that is, the part inside "\score { } ") in "\displayMusic{
> }" . But this, while enlightening in some respects, didn't really tell me
> what's going on when the custos is to be displayed. So I downloaded the
> source code, and after grepping found two files of interest: custos.cc and
> custos-engraver.cc . In the latter I found an expression headed by
>
> "void
>  Custos_engraver::acknowledge_note_head (Grob_info info)"
>
> (line 83). Could anyone tell me if I'm on the right track? My problem is
> that, while I'm willing to learn, I have a very limited experience with C++
> and with any object programming whatsoever (having spent much time decades
> ago with Turbo Pascal 5 :-)). I'd be very grateful for any pointers
> regarding what happens during a linebreak (and, in general, how one should
> learn such things).
>
> Best regards,
>
> Leszek Wronski.
>

Hi Leszek,

not sure what you want to achieve.

However, the following may be of some help, see comments inline:

\layout {
  \context {
    \Staff
    \consists "Custos_engraver"
    \override Custos.color = #red
    \override Custos.style = ##f
    %% The following will result in some errors of kind:
    %% programming error: No spacing entry from Item to `custos'
    %% Although resolveable, ignore them. This override demonstrates that
    %% custos is always (apart from first note) created, if forced.
    \override Custos.break-visibility = ##(#t #t #t)
    %% As a breakable item, it will be printed only at line-end, if the correct
    %% value for `break-visibility' is set.
    %% Which is the default, see: /scm/define-grobs.scm
  }
}

\relative {
  \repeat unfold 3 {
    c'1 d e f
    g a b c
  }
}


Cheers,
  Harm



reply via email to

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