lilypond-user
[Top][All Lists]
Advanced

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

Re: missing stem


From: Simon Albrecht
Subject: Re: missing stem
Date: Mon, 23 Nov 2015 01:14:49 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

Hello Bogi,

On 23.11.2015 00:50, Bogi Lützen wrote:
Please help me with this little problem.

This is just one of my efforts, but in all of them I miss the stem on the
first g'2:

\version "2.18.0"

{
                
                <<{c''1^~|\stemUp c''2 c''4 c''| c''1}{\stemDown g'2 a' |g' a'4 a'| 
g'1}>>
                

        \bar "|."
}

first: your code example can be made much easier to read if you add some spaces and line breaks, and get indenting right (this is done automatically by Frescobaldi, a great program for working with LilyPond files <http://frescobaldi.org>):

%%%%%%%%%%%
{
  <<
    {
      c''1^~ |
      \stemUp c''2 c''4 c'' |
      c''1
    }
    {
      \stemDown g'2 a' |
      g' a'4 a' |
      g'1
    }
  >>
  \bar "|."
}
%%%%%%%%%%%

If you run your snippet, you should get three warnings in the log, one of them saying that ‘maybe your input should specify polyphonic voices’. And that is the problem here: your code only produces only one ‘voice’ (in the LilyPond sense of the word) and you need two of them. The most basic way to achieve that is inserting \\ between the music expressions:

%%%%%%%%%%%
{
  <<
    {
      c''1^~ |
      \stemUp c''2 c''4 c'' |
      c''1
    }
    \\
    {
      \stemDown g'2 a' |
      g' a'4 a' |
      g'1
    }
  >>
  \bar "|."
}
%%%%%%%%%%%%

This will work in this small example. In any more complex situations, you should create voices explicitly with \new Voice, and distinguish them by \voiceOne, \voiceTwo etc.

Did you read the Learning Manual <http://lilypond.org/doc/v2.18/Documentation/learning> already? It gives a great, ‘must-read’ introduction into working with LilyPond.

H(ope)T(hat)H(elps),
Simon



reply via email to

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