lilypond-user
[Top][All Lists]
Advanced

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

Re: Making feathered beams more variable


From: Thomas Morley
Subject: Re: Making feathered beams more variable
Date: Sun, 30 Oct 2011 13:39:44 +0100

Hi David,

2011/10/28 Thomas Morley <address@hidden>
Hi David,

2011/10/28 David Nalesnik <address@hidden>
Hi Harm,

(...)

 I tried various overrides to adjust the length of the final stem only, and the solution I got to work is this:

xy = \once\override Stem #'french-beaming = ##t

\relative c {
  \once \override Beam #'stencil = #(grow-beam-var 5)
  f32 [ \xy f''' f,,, \xy f''' f,,, \xy f''' f,,, \xy f''' f,,, \xy
  \once \override  Stem #'stencil = #(lambda (grob) (ly:grob-set-property! grob 'length 11)
    (ly:stem::print grob))  
  f''']
}

I changed your suggestion to a function (I've no problems using a function in this case) and tested both:
1. It doesn't works with "2.14.2", but with "2.15.13" there are no problems.
    Does it work with "2.14.2" for you?
2. Using it with \change Staff doesn't work! Maybe an issue with \change Staff?

\version "2.15.13"

xy = \once\override Stem #'french-beaming = ##t

#(define ((stem-length y) grob)
   (ly:grob-set-property! grob 'length y)
   (ly:stem::print grob))

xyOut =
#(define-music-function (parser location y-length)(number?)
#{
        \once \override  Stem #'stencil = #(stem-length $y-length)
#})

% This works

\relative c {
  \once \override Beam #'stencil = #(grow-beam-var 5)
  f32 [ \xy f''' f,,, \xy f''' f,,, \xy f''' f,,, \xy f''' f,,,
  \xyOut #11
  f''']
}

% This not. Issue in \change Staff ?

top = \change Staff = "1"
bottom = \change Staff = "2"

music = \relative c {
  \override Beam #'auto-knee-gap = #0
  \override Beam #'stencil = #(grow-beam-var 1)
    \bottom cis32[
    f
    %\xyOut #0
    \once \override  Stem #'stencil = #(lambda (grob) (ly:grob-set-property! grob 'length 0)
    (ly:stem::print grob)) 
    \top f'']
}

\score {
  \new PianoStaff <<
    \new Staff = "1" {
      s16.
    }
    \new Staff = "2" {
      \clef bass
      \music
    }
  >>


I added (if (ly:stencil? (ly:stem::print grob)) ... to the function (and some construction-helpers, maybe deleted). Now it works with \change Staff, too. "2.15.13" or higher is still needed.
Any idea how to change to make it work with "2.14.2"?

#(define ((stem-length y) grob)
  (if (ly:stencil? (ly:stem::print grob))
    (begin
      (and
        (ly:grob-set-property! grob 'length y)
        (ly:grob-set-property! grob 'color red)    ;; construction-helper, comment out!
        (ly:grob-set-property! grob 'layer 6)    ;; construction-helper, comment out!
        )
     (ly:stem::print grob))
     ))
  
xyOut =
#(define-music-function (parser location y-length)(number?)
#{
        \once \override  Stem #'stencil = #(stem-length $y-length)
#})

%----- Test

top = \change Staff = "1"
bottom = \change Staff = "2"

music = \relative c {
  \override Beam #'auto-knee-gap = #0
  %\override Beam #'stencil = #(grow-beam-var -1)
  \once \override  Beam #'positions = #'(4.5 . 5)
    \bottom c32[ g' \top  \xyOut #4 eis']
}

\score {
  \new PianoStaff <<
    \new Staff = "1" {
      s16.
    }
    \new Staff = "2" {
      \clef bass
      \music
    }
  >>
}

Best,
  Harm



reply via email to

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