lilypond-user
[Top][All Lists]
Advanced

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

Re: default stem directions


From: Rick Kimpel
Subject: Re: default stem directions
Date: Mon, 2 Mar 2020 16:15:45 +0000

Torsten,
That worked perfectly for my needs. Thank you.
I was worried I would have to assign each note name a stem direction.
Another solution was using different voices, but it was very unwieldy.
This is much simpler.
Rick


From: lilypond-user <lilypond-user-bounces+rick.kimpel=address@hidden> on behalf of Torsten Hämmerle <address@hidden>
Sent: Saturday, February 29, 2020 5:58 AM
To: address@hidden <address@hidden>
Subject: Re: default stem directions
 
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]