lilypond-user
[Top][All Lists]
Advanced

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

Re: Tremolos between two whole notes with LilyPond 2.20.0 and newer


From: Aaron Hill
Subject: Re: Tremolos between two whole notes with LilyPond 2.20.0 and newer
Date: Sun, 08 Nov 2020 07:59:03 -0800
User-agent: Roundcube Webmail/1.4.9

On 2020-11-08 1:52 am, Kuredant Kuredant wrote:
Hello,

I've been using the solution mentioned in
https://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00253.html to adjust the orientation of the tremolo beams between two whole notes, like
in this example: http://lilybin.com/vzv8uv/1

This works very well with LilyPond 2.18.2 and 2.19.48, but it no longer
works with the latest stable and development versions (2.20.0 and 2.21.7):
the beam stays horizontal.

convert-ly only tells me to remove "parser" and "location" from
"define-music-function", which doesn't improve the result, and I couldn't find anything in the release notes related to Beam.gap, Beam.extra-offset
or Beam.stencil.

Does somehave have a solution working with newer Lilypond versions?

Not certain why the original fails, but here is an updated version that seems to work:

%%%%
\version "2.20.0"

% From https://lists.gnu.org/archive/html/lilypond-user/2012-02/msg00253.html
% Updated for 2.20.0 and newer.
tweakWholeNoteTremolo =
#(define-music-function (y-offsets) (pair?)
  "Change the whole note tremolo orientation (default is horizontal)"
  #{ \once {
    \override Beam.gap = #1.3
    \override Beam.extra-offset = #(cons 0 (car y-offsets))
    \override Beam.positions =
    #(grob-transformer 'positions (lambda (grob orig)
      (cons (car orig) (+ (cdr orig) (cdr y-offsets)))))
  } #})

\relative c' {
  \tweakWholeNoteTremolo #'(-4.4 . 3.3)
  \repeat tremolo 16 { c32 c' }
}
%%%%

NOTE: While y¹off-y²off is a valid symbol in Scheme, I renamed it to something pure ASCII.

Also NOTE: This code is no longer backwards compatible due to the use of grob-transformer.


-- Aaron Hill



reply via email to

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