lilypond-user
[Top][All Lists]
Advanced

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

Half-note stem length Function help


From: Carl Williams
Subject: Half-note stem length Function help
Date: Fri, 16 Dec 2016 11:20:19 +1300
User-agent: Mailbird/2.3.36.0

Hi all, 

I'm trying to create a function that will change the length of only the half-note stems. 
This is so, with \tabFullNotation, I can display a half-note with a half-length stem (I already know how to disable the double-stem bit). 

I can't quite get my head around the syntax, but all I want to do is measure if the note is a half-note, and then change the length of that one accordingly. 

Here is what I have so far:
\version "2.18.2"

shorten-stems = 
#(define-music-function
    (parser location)
    ()
  #{
    #(lambda (grob) 
 %if note is a half-note, 
 %then make Stem.length = 15 (value of 15 is just for testing)
 (if (= 1 (ly:grob-property grob 'duration-log))
        (\once \override Stem.length = #15)
 )
    )
  #}
)


\new TabStaff \with {
  stringTunings = #ukulele-tuning
  \tabFullNotation
  \stemUp
} {
  \shorten-stems
  \relative c' {
\partial 2.. a'8 a4 a2 | 
a1 |
  }
}
% end of .ly file

There's an example of what I mean attached

Any help is greatly appreciated. 

Thanks, 
Carl

Attachment: Half-note stem length.png
Description: PNG image


reply via email to

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