lilypond-user
[Top][All Lists]
Advanced

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

Re: How to tie into a bar with split voices


From: David Kastrup
Subject: Re: How to tie into a bar with split voices
Date: Wed, 19 Apr 2023 16:51:33 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

John McWilliam <jsmcwilliam@gmail.com> writes:

> I’m trying to get a tie to cross the barline into a split voice
> measure. I have tried with and without the \voiceOne command but
> cannot get this to work. Can any one help me?

First let's point out everything you get "cargo-cult" wrong, having it
resemble working constructs without actual being them.  That does not in
itself solve your problem but may help you actually try out suggestions
and ideas.

LilyPond is a way of talking to a computer, and computers are masters at
not just playing but actually being dumb.

>    f2.~                                       | % 3
>    
>  
>       <<
>     { %\voiceOne                      % Voice = "1"
>       \stemUp 
>       f4 g8 a4 bes8                           | % 4
>       c2.~                                    | % 5
>       c4
>     }
>     
> \\
>     { \new Voice
>       \voiceTwo                               % Voice = "2"
>       \stemDown
>       r4 r8 f,4 f8                            | % 4
>       a2.~                                    | % 5
>       a4
>     }
>     
>>>

So here is the beef.  Someone may have told you that you must not create
new voices but rather only create a new voice for the non-tied part.
That's why you have "\new Voice" in the second bunch.  But for one
thing, this doesn't help at all since

<< ... \\ ... >>

_will_ for every part inside separated by \\ create a new voice, whether
you want it or not.  The only way to avoid this (outside of using
\voices trickery, see below) is not to write \\ at all.

Then "\new Voice" applies to the next music expression, meaning that you
usually form that expression writing "{ ... }".  But your "\new Voice"
is followed by "\voiceTwo", meaning that the _only_ thing placed into a
new voice here is "\voiceTwo", making it affect nothing at all.
Presumably this is why you readded "\stemDown" after (presumably)
someone told you you should be using \voiceOne/\voiceTwo instead.

So more likely than not, every advice you got has been incorporated by
you in a manner that doesn't actually work.  Which will appear to you
like you got bad advice that you needed to patch up in order to make it
at least do what you already thought you accomplished yourself.

That's frustrating both for you as well as your advisers, and hopefully
I got to make you a bit more acquainted to LilyPond's manner of thinking
such that you have better odds of successfully incorporating advice the
next time round.

Now here is how I would do things personally:

\version "2.24.0"
  \score {
    \relative c'' { 
     \clef "treble" \key f \major \time 6/8 

   c4 r8  f,4.                                  | % 2
   f2.~                                         | % 3
     \voices "", 2
      <<
    { \voiceOne                 % Voice = ""
      f4 g8 a4 bes8                             | % 4
      c2.~                                      | % 5
      c4
      \oneVoice
    }    
\\
    {                           % Voice = "2"
      r4 r8 f,4 f8                              | % 4
      a2.~                                      | % 5
      a4
    }
>>
   a8  a4  a8   
    } %end relative
  } %end score
Note that I _do_ use << ... \\ ... >> here, but I apply the \voices
construct to it which tells it to use \context Voice = "" for the first
part (and no voice-specific settings which is why I have to follow up
with \voiceOne/\oneVoice) and \context Voice = "2" for the second (with
\voiceTwo specific settings).

If your top Voice is not anonymous but an actually named Voice, instead
of writing \voices "", 2 ... you'd need to write
\voices "MyVoiceName", 2 ... in order to get LilyPond to continue your
voice with the given name, in this case "MyVoiceName".

-- 
David Kastrup

reply via email to

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