Hi David,

2011/10/28 Thomas Morley <thomasmorle...@googlemail.com>

> Hi David,
>
> 2011/10/28 David Nalesnik <david.nales...@gmail.com>
>
>> 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
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to