Hi,

I'm trying to typeset a number of short pieces into multiple scores in one
file. I can do this manually, as:

```
musicOne = \relative c'' { g4 a b c }
musicTwo = \relative c'' { g4 a b c }

\score {
 \musicOne
}

\score {
  \musicTwo
}
```

However, there's a lot more common stuff in my real \score block, which
means this approach gets very tedious. What I'm trying to do instead looks
like:


```
printTheScore =
#(define-music-function
     (parser location number )
     (string? )
#{
\score {
 \music#number
}
#})

\printTheScore "One"
\printTheScore "Two"
```

This doesn't work; my substitution syntax is clearly wrong here, but I'd be
interested to see if there's a way to do it.  Or does the way the code is
parsed mean music functions can't be referenced in this way?

I've attached a ly file including the code I've pasted here.

thanks,

Chris
\version "2.19.35"

musicOne = \relative c'' { g4 a b c }
musicTwo = \relative c'' { g4 a b c }

% Manually create all scores

\score {  
 \musicOne
}

\score { 
  \musicTwo
}

% Programmatically create scores?

printTheScore = 
#(define-music-function
     (parser location number )
     (string? )
#{     
\score {
 \music#number
}
#})

\printTheScore "One"
\printTheScore "Two"
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to