Valentin,

Thank you, for the  explanation! I see what you mean about controlling when evaluation happens by avoiding global variables that change during the flow of a music expression. I will avoid doing that.

I see now that it is better to create two or more static global variables and switch music/markup function behavior by calling different global variables as the input variable to a music or markup function in the music expression. I have been doing it that way.

 Could you please show me what you mean by the quote below from your response? That sounds interesting, but I am not getting it.


On 5/18/23 06:31, Valentin Petzel wrote:
More generally if you want have parts of your score behave in a conditionally
different manner it may also be an option to wrap your whole music expression
into a markup function which behaves differently based on some parameter.

The \keepWithTag #'... command outside the music expression when the staves are created, is the only way I know of switching behavior of markup functions between staves, while using the same music expression.

I would like to be able to declare a variable that has a scope at the staff level, and effects the markup/music functions within that staff and not other staves.

I hope that I am not belaboring the point. The method with the static global variables, tags, music function, and markup function works. I am just wondering if there is a simpler way.


Peace,

David



Reply via email to