I am working on a function to give myself a "slide into".
I've been able to get something to work that accepts a single pitch but
with two or more pitches. I tried using both ly:pitch and ly:music
(though I'm not sure what the ly:music type really represents).
See attached code.
It has something to do with not being able to attach the glissando
event. I can see with a test that the glissando is attaching to after
the second parameter.
In the example below the desired result is in the second measure (done
with inline code). The goal is to hide this in a function.
In my testing I see that the glissando is happening after the notes
instead of between the grace note and the notes.
Walt North
C:/Users/waltn/AppData/Local/Temp/frescobaldi-nrao5slu/tmp4c_xa8e2/document.ly:42:3:
warning: Unattached GlissandoEvent
\slideC <a c>4 <c e>1 |
The log has the following message:
\version "2.24.4"
\layout {
\context {
\Score
\override Glissando.minimum-length = #3
\override Glissando.springs-and-rods = #ly:spanner::set-spacing-rods
\override Glissando.thickness = #2
}
}
slideA =
#(define-music-function (grace) (ly:pitch?)
#{
{
\once \hideNotes \grace $grace \glissando \unHideNotes
}
#})
slideB =
#(define-music-function (sNotes eNotes) (ly:music? ly:music?)
#{
{
\grace $sNotes $eNotes
}
#})
slideC =
#(define-music-function (sNotes eNotes) (ly:music? ly:music?)
#{
{
\grace $sNotes \glissando $eNotes
}
#})
\relative c' {
\grace <a' c>4 \glissando <c e>1 |
\hideNotes \grace <a c>4 \glissando \unHideNotes <c e>1 |
\slideA a <c e>1 |
\slideB <a c>4 <c e>1 |
\slideC <a c>4 <c e>1 |
<c e>1 |
}