lilypond-user
[Top][All Lists]
Advanced

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

Re: default stem directions


From: Pierre Perol-Schneider
Subject: Re: default stem directions
Date: Sun, 1 Mar 2020 10:43:37 +0100

Very elegant Torsten.
Cheers,
Pierre

Le sam. 29 févr. 2020 à 13:00, Torsten Hämmerle <address@hidden> a écrit :
Rick Kimpel-2 wrote
> I am trying to learn how to change the default stem directions.
> […]
> ...without having to do all the \stemUp \stemDown stuff.
> I'm ok with the manual beaming.

Hi Rick,

You could set up a custom function.
A simplistic example (see below) will read the 'default direction.
As you have already noticed, the default stem direction will be #UP for note
heads below the middle stave line and #DOWN otherwise.

Obviously, you'd like to have it the other way round. The custom function
will give back #DOWN if the default direction is #UP, and #DOWN otherwise).

%%%%%%%%%%
\version "2.19.83"

#(define (custom-stemdir)
   (lambda (grob)
     (let ((defdir (ly:grob-property grob 'default-direction)))
       (if (= defdir UP) DOWN UP))))

\score {
  \new Staff
  \with { \override StaffSymbol.line-count =  #1 }
  {
    \clef percussion
    \numericTimeSignature
    \autoBeamOff
    \relative c' {
      <>^"default"
      b8 c4 c8 b8[ b] b c |
      <>^"custom"
      \override Stem.direction = #(custom-stemdir)
      b8 c4 c8 b8[ b] b c |
    }
  }
}
%%%%%%%%%%

<http://lilypond.1069038.n5.nabble.com/file/t3887/custom-stemdir.png>

HTH,
Torsten
custom-stemdir.png
<http://lilypond.1069038.n5.nabble.com/file/t3887/custom-stemdir.png



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html


reply via email to

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