Hello, I would appreciate some help with this music function.

The end goal is have a define function produce a glissando after a note going either up or down to

undetermined second note.  For example a guitar slide down off the note.

I can get the behavior I want with a line of code directly in the score but not by using a function.

Below is sample code along with log output and a screenshot.



% The end goal of this is two have a function that will produce a slide out
% a given either up or down depending need.  The actual grace note is not
% needed except to give the slide an up or down direction.

\version "2.24.2"
slideOutOf =
#(define-music-function (startNote endNote)
   (ly:music? ly:music?)
   #{
     \afterGrace 1 #startNote \glissando
     { \hideNotes #endNote \unHideNotes }
   #})

%this works as I want.
notesOne = {
  \relative {
    r4
    \afterGrace 1 d''4 \glissando
    { \hideNotes c16 \unHideNotes }
    r2 |
  }
}

%This does not work. Two issues. Barcheck fail and no glissando
notesTwo = { r4 \slideOutOf d''4 c16 r2 |}

\score {
  {
    \notesOne
    \notesTwo
  }
}



Starting lilypond.exe 2.24.2 [test.ly]...

Processing `G:/My Drive/Sheet Music/Dobro/test.ly'

Parsing...

Interpreting music...

G:/My Drive/Sheet Music/Dobro/test.ly:25:41: warning: barcheck failed at: 1/16

notesTwo = { r4 \slideOutOf d''4 c16 r2

|}


Preprocessing graphical objects...

Finding the ideal number of pages...

Fitting music on 1 page...

Drawing systems...

Converting to `test.pdf'...

Success: compilation successfully completed

Completed successfully in 1.0".

Reply via email to