lilypond-user
[Top][All Lists]
Advanced

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

Re: typesetting Christian Wolff Excersize


From: Lukas-Fabian Moser
Subject: Re: typesetting Christian Wolff Excersize
Date: Sun, 31 Oct 2021 19:54:48 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

Hi Ole,

Am 31.10.21 um 19:13 schrieb ole:
I've already removed the stem-engraver in the \layout part (to get the quarter notes without stem)

I just want to point out that removing the stem engraver removes the stems "for good". Often, one wants to remove the stems but wants to be able to switch them on again at some later point in the score; in this case, it's better to just do \omit Stem (in \layout {} or in your music) which can be undone.

(Strictly speaking, removing the engraver does more than just \omitting the object, which in turn is more than just \hide'ing it.)

Does someone have a solution for that particular spot by chance, otherwise I thing about using Inkscape..?

One possibility would be to abuse stems for this. (This does not work if the Stem engraver is removed, see above.)

A first approximation:

\version "2.22"

connectArrowStem =
#(define-music-function (dir) (ly:dir?)
   #{
     \once {
       \undo \omit Stem % in case someone \omit'ted them :-)
       \override Stem.length-fraction = 0
       \override Stem.X-offset = 0.65
       \override Stem.thickness = 2
       \override Stem.stencil =
       #(grob-transformer
         'stencil
         (lambda (grob stem)
           (let* ((Y-ext (ly:stencil-extent stem Y))
                  (Y-pos (interval-index Y-ext (* dir 0.3))))
             (ly:stencil-add
              stem
              (ly:stencil-translate-axis
               (grob-interpret-markup grob (markup #:arrow-head Y dir #f))
               Y-pos Y)))))
     }
   #})

{
  \omit Stem
  c'4 d' e'4
  \connectArrowStem #UP <c' g''>4
  \connectArrowStem #DOWN <b' g''>
}

This still causes problems if the two notes are too close together (because LilyPond still creates a stem protruding over one of the notes).

I also didn't implement the parentheses yet.

Lukas




reply via email to

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