[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: adjusting double glissandi
From: |
Aaron Hill |
Subject: |
Re: adjusting double glissandi |
Date: |
Tue, 25 Jan 2022 14:00:43 -0800 |
On 2022-01-25 11:46 am, Rachel Green wrote:
Hi,
I’m trying to adjust the glissandi in this excerpt so that the lines
are parallel and not too close to each other. I found some settings
for adjusting a single glissando, but not for a double glissando. Any
ideas?
There is prior work on this subject. Harm has provided some code [1]
before.
[1]:
https://lists.gnu.org/archive/html/lilypond-user/2013-08/msg00547.html
Here is an adaptation of that logic:
%%%%
glissandoTweak =
#(define-music-function
(after? tweaks) ((boolean? #t) list?)
(define (proc grob)
(if after? (ly:spanner::kill-zero-spanned-time grob))
(for-each
(lambda (x)
(let ((prop (car x)) (value (cdr x)))
(if (key-list? prop)
(ly:grob-set-nested-property! grob prop value)
(ly:grob-set-property! grob prop value))))
(ly:assoc-get
(ly:grob-property grob 'glissando-index) tweaks '())))
(if after?
#{ \once \override Glissando.after-line-breaking = #proc #}
#{ \once \override Glissando.before-line-breaking = #proc #}))
{
\glissandoTweak
#`((0 . ((color . ,red)
(Y-offset . -0.5)))
(1 . ((color . ,blue)
((bound-details right arrow) . #t))))
<c' e'>2\glissando <g'' b''>
}
%%%%
-- Aaron Hill