lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: score in a music function?


From: Thomas Morley
Subject: Re: score in a music function?
Date: Wed, 6 Feb 2013 20:14:06 +0100

2013/2/6 Stefan Thomas <address@hidden>:
> Sorry, I can't find the mistake!
> Here's my code:
>
> \version "2.16.2"
> TheScore = #(define-scheme-function (parser location x y) (ly:music?
> ly:music?)
> #{
> \score {
> \new StaffGroup
> <<
> \new Staff \with { instrumentName = "first" } $x
> \new Staff \with { instrumentName = "second" } $y
>>>
> }
> #})
>
> first = \relative c' { c4 d e f g1 }
> second = \relative c'' { g4 f e d c1 }
> \score { \TheScore \first \second }
>
> 2013/2/6 David Kastrup <address@hidden>
>>
>> Stefan Thomas <address@hidden> writes:
>>
>> > Dear David,
>> > I also use version 2.16.2
>> > But Your example doesn't work for me.
>> > I get the error message
>> > partiturtest.ly:17:34: Fehler: syntax error, unexpected '} \score {
>> > \TheScore \first \second    }
>> >
>>
>> Looks more like a copy&paste error than anything else.  Non-breaking
>> spaces or something?
>>
>> --
>> David Kastrup
>
>
>
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>

David's suggestion works fine with 2.17.10

For 2.16.1 changing to _music_-function and deleting the
\score-command from the function seems to work:

\version "2.16.1"

TheScore = #(define-music-function (parser location x y) (ly:music? ly:music?)
#{
\new StaffGroup
<<
\new Staff \with { instrumentName = "first" } $x
\new Staff \with { instrumentName = "second" } $y
>>
#})

first = \relative c' { c4 d e f g1 }
second = \relative c'' { g4 f e d c1 }
\score { \TheScore \first \second }

Or, if you insist on a _scheme_-function,delete the \score-command
from the function and add
<< ... >> in the final \score-call.

\version "2.16.1"

TheScore = #(define-scheme-function (parser location x y) (ly:music? ly:music?)
#{
\new StaffGroup
<<
\new Staff \with { instrumentName = "first" } $x
\new Staff \with { instrumentName = "second" } $y
>>
#})

first = \relative c' { c4 d e f g1 }
second = \relative c'' { g4 f e d c1 }
\score { << \TheScore \first \second >> }


HTH,
  Harm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]