1

I want to put some commands into a variable, so that I can write the variable instead of repeating the commands over and over:

myvar = \once \override Beam.beam-thickness = #tremBeamThickness \override Beam.gap = #3 

This is throwing an error when I use it like \myvar in my ly file. What am I doing wrong?

1 Answer 1

5

Two \overrides are separate elements. Your code is an assignment myvar = \once \override Beam.beam-thickness = #tremBeamThickness followed by a spurious override \override Beam.gap = #3 that is at the top level, trying to make up an entire score by itself. You should put braces around them to unite them into a single "sequential expression" that you can then put into a variable, i.e.,

myvar = {
  \once \override ...
  \once \override ...
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.