lilypond-user
[Top][All Lists]
Advanced

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

Re: default stem directions


From: Torsten Hämmerle
Subject: Re: default stem directions
Date: Sat, 29 Feb 2020 04:58:58 -0700 (MST)

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]