lilypond-user
[Top][All Lists]

## Writing score definition in Scheme

 From: Urs Liska Subject: Writing score definition in Scheme Date: Mon, 26 Mar 2018 14:51:30 +0200 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

```Hi all,

```
I'm embarrassed to admit I don't know where to start looking in the manuals.
```
```
I have a scheme-function that returns a \score expression, and I'm sure I wouldn't have to hop around between LilyPond and Scheme syntax like this:
```
make-score =
#(define-scheme-function (movement-path)(symbol-list?)
#{
\score {
<<
\new GrandStaff <<
#(get-staff movement-path 'clarino-one)
#(get-staff movement-path 'clarino-two)
#(get-staff movement-path 'corno-one)
#(get-staff movement-path 'corno-two)
>>

#(get-staff movement-path 'tympano)

\new ChoirStaff <<
#(get-staff movement-path 'soprano)
#(get-staff movement-path 'alto)
#(get-staff movement-path 'tenor)
#(get-staff movement-path 'bass)
>>
\new StaffGroup <<
\new GrandStaff <<
#(get-staff movement-path 'violin-one)
#(get-staff movement-path 'violin-two)
#(get-staff movement-path 'viola)
>>
#(get-staff movement-path 'bc)
>>
>>
\midi {}
\layout {}
}
#})

```
The function is also called from within Scheme code, so I would like to write the same using Scheme only, without switching to LilyPond with #{ #} but also back to Scheme within these expressions.
```
```
```