I want to define and change variables mid-stream in a music expression, while also using tags. Below is an example of what I am trying; but, it does not work.

\version "2.24.1"

\keepWithTag #'textI
%\keepWithTag #'textII


{
  \tag #'textI { #(define l "A") }
  \tag #'textII { #(define l "B") }
  c''1 ^\markup \l
  \tag #'textI { #(define l "C") }
  \tag #'textII { #(define l "D") }
  c''1 ^\markup \l
}


The tags are not keeping lilypond from skipping the define's that are in \tag #'textII. Is there a way to make this work?

Is there a way to define variables using lilypond syntax inside a music expression?


Peace,

David


Reply via email to