[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Warnings-polyphonic
From: |
Reinhold Kainhofer |
Subject: |
Re: Warnings-polyphonic |
Date: |
Wed, 9 Jun 2010 11:15:02 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.32-22-generic; KDE/4.4.4; i686; ; ) |
Am Mittwoch, 9. Juni 2010, 10:55:45 schrieb Mario Moles:
> Hi!
> How can i avoid these warnings?:
>
> SonataIII-III-tempo.ly:211:2: warning: adding note head to incompatible
> stem (type = 2)
>
> b,!4 r s|
> SonataIII-III-tempo.ly:211:2: warning: maybe input should specify
> polyphonic voices
>
> b,!4 r s|
In the second to last measure you effectively use a nested << ... \\ ... >>
construct: The whole score consists of <<\upper\\ \lower>>, while \upper
contains <<{r <dis g>[ <dis fis>] r r4} \\ {a2 b!4}>>
In the << ...\\ ... >> construct, LilyPond always calls the second part
"lower", so both \lower and the {a2 b!4} of \upper will be in a voice called
"lower". Thus, LilyPond will try to join stems (which fails since the upper
voice has a half note, while the lower has a quarter note).
As a solution, it's better to not use << ... \\ ... >> and let LilyPond
implicitly create two voices, but generate the voices yourself.
E.g. in the \score block, instead of
{ \clef "treble_8" << \upper \\ \lower >> }
better use:
{ \clef "treble_8" <<
\new Voice="UpperVoice" { \voiceOne \upper }
\new Voice="LowerVoice" { \voiceTwo \lower }
}
And in upper better use
<< { r <dis g>[ <dis fis>] r r4}
\new Voice="UpperDown"{\voiceFour a2 b!4}
>>|
<< { r8 <fis' b> <fis ais> r r4}
\new Voice="UpperDown" {\voiceFour c4~c8 gis a cis}
>>|
for the last two bars (notice that I'm also using explicit voices here, and
manually set \voiceFour, so LilyPond takes care of shifting notes a little bit
to prevent collisions).
Cheers,
Reinhold
--
------------------------------------------------------------------
Reinhold Kainhofer, address@hidden, http://reinhold.kainhofer.com/
* Financial & Actuarial Math., Vienna Univ. of Technology, Austria
* http://www.fam.tuwien.ac.at/, DVR: 0005886
* LilyPond, Music typesetting, http://www.lilypond.org