Marten Visser <msvis...@planet.nl> writes:

>> I'm not top posting.
>
> A voicename not is recognised in a music function.
>
> In the example below, I'd expect to get two documents with the same
> content. However, in the "error" document, no lyrics are typeset, and
> an error is sent into the logfile. Why?

>       \score {
>               <<
>                       \new Voice = "melody" { \relative c'' { d cis b a } }
>                       \new Lyrics     \lyricsto "melody" \lyricmode { An ex 
> -- am -- ple. }
>               >>
>       }

vs.

> MusFunc = #(define-music-function (parser location) ()
>       #{
>               \new Voice = "melody" { \relative c'' { d cis b a } }
>               \new Lyrics     \lyricsto "melody" \lyricmode { An ex -- am -- 
> ple. }
>       #} )
>
> \book {
>       \bookOutputSuffix "Error"
>       \score {
>               <<
>                       \MusFunc
>               >>
>       }

Music functions return sequential music by default, not a sequence of
partial music expressions folded into an upper syntactical construct.
So the lower is the equivalent of

        \score {
                << {
                        \new Voice = "melody" { \relative c'' { d cis b a } }
                        \new Lyrics     \lyricsto "melody" \lyricmode { An ex 
-- am -- ple. }
                } >>
        }

if I am not mistaken.

It is likely that you can return a parallel music expression explicitly
using Scheme.

Perhaps it would be nice to allow #<< instead of #{ as a shortcut for
creating a music expression returning parallel music.

-- 
David Kastrup


_______________________________________________
bug-lilypond mailing list
bug-lilypond@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-lilypond

Reply via email to