Thanks, that helped a lot! I boiled it down to:
\version "2.19.82"
glissTweak =
#(define-music-function (parser location lst)(pair?)
#{
\once \override Glissando #'after-line-breaking =
#(lambda (grob)
(let ((gliss-count (ly:grob-property grob 'glissando-index)))
(map (lambda (x)
(let ((gliss-nmbr (car x))
(property-value-alist (cdr x)))
(if (eq? gliss-nmbr gliss-count)
(map
(lambda (y) (ly:grob-set-property! grob (car y) (cdr y)))
property-value-alist)
#f)))
lst)))
$(make-music 'EventChord 'elements (list (make-music 'GlissandoEvent)))
#})
c'' {
\glissTweak #`((0 . ((Y-offset . 0.25)))
(1 . ((Y-offset . -0.25))))
g2 a
}
two = \relative c'' {
\context Voice = "one" {
c2 d
}
}
\new Staff <<
\new Voice = "one" \one
\two
>>
This is lovely and very flexible and does what I need it to do (and more).
But I would also be interested in a more minimal version because I usually only care about Y-offsets. Preferably something that wouldn’t remove the \glissandos from the syntax, so I could have something like
\once \override Glissando.Y-offset =
#(lambda (grob) (and
(if (= 0 (ly:grob-property grob 'glissando-index)) '0.25)
(if (= 1 (ly:grob-property grob 'glissando-index)) '-0.25)))
<g c>2\glissando <a d>
if only that would work. It probably won’t be as easy as that. But my Scheme is very modest, and I don’t even know where to begin with something like that. Any ideas?