Re: Voicename not recognised in music function

2010-10-18 Thread David Kastrup
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


Voicename not recognised in music function

2010-10-16 Thread Marten Visser


 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?


Thanks for looking,
--Marten


%{
Welcome to LilyPond
===
** Unrecognised voice error **
Error occurs when calling music function typesetting lyrics.
%}

\version 2.13.32

\book {
\bookOutputSuffix Okay
\score {

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

\layout { }
}
}

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

\layout { }
}
}


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