lilypond-user
[Top][All Lists]
Advanced

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

Re: Change stem direction for voice?


From: Stefano Antonelli
Subject: Re: Change stem direction for voice?
Date: Sun, 25 Aug 2024 16:11:38 +0000
User-agent: Evolution 3.36.5-0ubuntu1

On Sun, 2024-08-25 at 10:47 +0100, Timothy Lanfear wrote:
> \version "2.24.0"
> 
> \layout {
>   \context Voice = "voiceTwo" {
>     \override Stem.direction = #UP
>     \override Slur.direction = #DOWN
>     \override Beam.positions = #'(5 . 5)
>   }
> }
> 
> \new Voice = "voiceTwo" {
>   g'4 a' b'( c'') d''8 e'' f'' g'' r2
> }

That works just fine, but I don't want to create an explicit voice.  I
should have mentioned that.

Is something like this expected to work?

\layout {
  \context Voice = "voiceTwo" {
    \override Stem.direction = #UP
    \override Slur.direction = #DOWN
    \override Beam.positions = #'(5 . 5)
  }
  \context {
    \Score
    \override NoteColumn #'ignore-collision = ##t
    \mergeDifferentlyHeadedOn
    \mergeDifferentlyDottedOn
  }
}

<<
{ g'4 a' b }
\\
{ d''8 e'' f'' g'' r2 }
>>

I don't know if the music makes sense, I just cut and pasted the notes
from the previous example.  I also added the score context overrides so
the stems and noteheads align, but the reason everything is so broken
(see attached) is because of the:

    \override Beam.positions = #'(5 . 5)

in the voiceTwo context.  If I comment that out, the beams and stems
reappear, but the stem directions are wrong (also attached).

As I understand it, << {...} \\ {...} >> should implicitly create
voices using \voiceOne and \voiceTwo.  At least according to this:

<
https://lilypond.org/doc/v2.20/Documentation/learning/explicitly-instantiating-voices
>

Which says:

\new Staff {
  \relative {
    << { e'4 f g a } \\ { c,4 d e f } >>
  }
}

is equivalent to:

\new Staff <<
  \new Voice = "1" { \voiceOne \relative { e'4 f g a } }
  \new Voice = "2" { \voiceTwo \relative { c'4 d e f } }
>>

But maybe I'm confusing what \voiceTwo does.

I think I'm able to access those voices using either:

\context Voice = "voiceTwo" {

or

\context Voice = "2" {

Because the beam override causes the same problem.  However, stem
direction is never affected.

Actually, the beam override has an effect even if the context doesn't
match.  For example,

\context Voice = "any" {

So something doesn't work how I think it does.  I attached an mwe with
some of these things commented out.  If anyone wants to try.

Ultimately what I'd like to do is enter notes like this:

partA = << { ... } \\ { ... } \\ { ... } \\  { ... } >>
partB = << { ... } \\ { ... } \\ { ... } \\  { ... } >>
partC = << { ... } \\ { ... } \\ { ... } \\  { ... } >>

Then string them together:

\partA \partB \partC

and change the stem direction of the voices "grouped" as the first,
second, third, and fourth voices.  To be clear,

partA = << { ... } \\ { ... } \\ { ... } \\  { ... } >>
has voice    "1"        "2"        "3"         "4"
partB = << { ... } \\ { ... } \\ { ... } \\  { ... } >>
has voice    "5"        "6"        "7"         "8"
partC = << { ... } \\ { ... } \\ { ... } \\  { ... } >>
has voice    "9"        "10"       "11"        "12"

And I want to change the stem direction in groups (1, 5, 9), (2, 6,
10), (3, 7, 11), and (4, 8, 12).

After writing that I'm not sure it can be done since the number of
voices just keeps growing.

I am using 2.20 so if something has improved in 2.24 I can look into
installing newer lilypond alongside 2.20.  Though the last time I tried
this it didn't work.


Attachment: broken.png
Description: broken.png

Attachment: wrong.png
Description: wrong.png

Attachment: mwe.ly
Description: mwe.ly


reply via email to

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