lilypond-user
[Top][All Lists]
Advanced

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

Using \startTextSpan and \stopTextSpan in separate music functions


From: Abraham Lee
Subject: Using \startTextSpan and \stopTextSpan in separate music functions
Date: Fri, 16 Sep 2016 15:20:02 -0600

All,

Going off the of the thread here: 

http://lists.gnu.org/archive/html/lilypond-user/2016-09/msg00374.html

and some personal email exchanges, I tried out a few things (found a working solution, though not ideal) and ran into something curious. I'd like to do something like the following, but it doesn't seem to work:

%%%%%%%%%

\version "2.19.36"

myStartTextSpan = #(define-music-function (mus) (ly:music?)
#{
  \once \override TextSpanner.bound-details.left.text = "rit."
  $mus \startTextSpan
#})

myStopTextSpan = #(define-music-function (mus) (ly:music?)
#{
  $mus \stopTextSpan
  <>^\markup \italic "a tempo"
#})

\relative c' {
  \myStartTextSpan b'1 
  c1
  \myStopTextSpan e,1 
  g1
}

%%%%%%%%%

This results in "unexpected EVENT_IDENTIFIER" errors at both

  $mus \startTextSpan

and

  $mus \stopTextSpan

When I put everything into a single _expression_ without using music functions, it works as expected:

%%%%%%%%%

\version "2.19.36"

\relative c' {
  \override TextSpanner.bound-details.left.text = "rit."
  b'1\startTextSpan 
  c1
  e,1\stopTextSpan
  <>^\markup \italic "a tempo"
  g1
}

%%%%%%%%%

This is just a simple example. The real use-case has numerous other \override statements that should occur prior to \startTextSpan, but the general idea is the same.

Anyone know what's going on here?

Best,
Abraham

reply via email to

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