lilypond-user
[Top][All Lists]
Advanced

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

Mysterious behavior in music function


From: Marc Evanstein
Subject: Mysterious behavior in music function
Date: Sun, 4 Aug 2019 13:48:20 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Hi all,

I'm trying to define a music function that adds a gliss after a note down to a second parenthesized grace note. I've tried the following, but the gliss doesn't show up:

\version "2.19.83"
\language "english"

bendDown =
#(define-music-function
   (parser location firstNote secondNote)
   (ly:music? ly:music?)
    #{
      \afterGrace
      $firstNote
      \glissando
      \once \override Stem.stencil = ##f
      \once \override Flag.stencil = ##f
      \parenthesize $secondNote
    #}
  )

\score {
  \new Staff \with { instrumentName = #"Flute" }
  {
    \bendDown g'2 f'4
  }
}

More than this, what I'm truly puzzled by is that if I remove "\afterGrace" and just let the second note be a normal note, I get an error:

error: syntax error, unexpected EVENT_IDENTIFIER

\glissando

If I copy paste the function text replacing the variables, then I get almost what I want, except that the stem of the grace note is still there:

\score {
  \new Staff \with { instrumentName = #"Flute" }
  {
    \afterGrace
    g'2
    \glissando
    \once \override Stem.stencil = ##f
    \once \override Flag.stencil = ##f
    \parenthesize f'4
  }
}

What does seem to totally work is to use a regular grace instead of an afterGrace, except that I can't seem to write it as a music function without getting that same "unexpected EVENT_IDENTIFIER" error:

\score {
  \new Staff \with { instrumentName = #"Flute" }
  {
    g'2
    \glissando
    \grace
    \once \override Stem.stencil = ##f
    \once \override Flag.stencil = ##f
    \parenthesize f'4
  }
}

Can anyone shed some light on this for me?

Thanks in advance!

Marc

Attachment: pEpkey.asc
Description: application/pgp-keys


reply via email to

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