MarcM <m...@mouries.net> writes:

> David the new syntax looks great. Is there a way to have the minimum-length
> taken into account?
>
> Where can i find more info about upgrading the old syntax to 2.17?

Well, the "Extending LilyPond" guide is still relevant and it is
probably what whoever created the original code was working from (though
the 2.14 version of it).

The changed syntax as written would have worked with 2.16 already, but
2.16 already appears to ignore minimum-length.  I did look at the 2.14
version for lily/glissando-engraver.cc and did not see any special
treatment of minimum-length (though it is accessed in lily/spanner.cc).
The 2.14 has a function \chordGlissando which overrides
Glissando.minimum-length, but this is no longer present.

However, it does this in concord with overriding springs-and-rods:

       \once \override Glissando #'minimum-length = #4
       \once \override Glissando #'springs-and-rods = 
#ly:spanner::set-spacing-rods

so it would appear that even in 2.14.2, Glissando did not heed
minimum-length by default unless you also overrode springs-and-rods (the
callback ly:spanner::set-spacing-rods is what actually looks at
minimum-length).

And indeed, it we try

\version "2.16.0"
glissSize =
#(define-event-function (parser location length)
  (number?)
  #{
  \tweak #'minimum-length #length
  \tweak #'springs-and-rods #ly:spanner::set-spacing-rods
  \glissando
  #}
)

\score {
   {
    a'' \glissando e'' 
    a'' \glissSize #5 e'' 
  }
  \header {piece = "The default glissando is too short. usage: is \glissSize #5 a e "}
}
it looks as though we have a winner.  Turns out that the override of
spacing-and-rods was also in the original code you posted, but I
probably considered it irrelevant.

Cough, cough.  This works both with 2.16 as well as current development
versions.

-- 
David Kastrup
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to