[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Change stem direction for voice?
From: |
David Kastrup |
Subject: |
Re: Change stem direction for voice? |
Date: |
Mon, 26 Aug 2024 10:44:45 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Timothy Lanfear <timothy@lanfear.me> writes:
> On 25/08/2024 17:11, Stefano Antonelli wrote:
>> 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.
>
> I think you have some misunderstandings about the way LilyPond functions.
>
> \new Voice = "voiceTwo" { ... }
>
> creates a voice and gives it an arbitrary label (voiceTwo) so it can
> be referred to later in the LilyPond code. Labeling the voice has no
> influence on the formatting. In this case, the label happens to be the
> name of a LilyPond command, but that is of no consequence.
\new Voice = "2" { ... } on the other hand will create a voice that the
<< \\ >> construct would recycle for its second voice _if_ it is
accessible at the moment the << \\ >> is encountered.
> (Also, the label has no effect when in a layout block).
It's worthwhile to note that there is a load of difference between
\layout {
\context {
\Voice
\override ...
}
}
and
\layout {
\context Voice {
\override ...
}
}
Cf this example:
\layout {
\context Voice {
\override Stem.color = #red
}
\context {
\Voice
\override Stem.thickness = #4
}
}
\new StaffGroup <<
\new TabStaff \with { \tabFullNotation } {
c'8 8 8 8 8 8 8 8
}
\new Staff {
\clef "violin_8"
c'8 8 8 8 8 8 8 8
}
>>
> The \\ construct automatically creates voices formatted as if
> \voiceOne, \voiceTwo etc., were present, although it seems these
> commands are not used explicitly.
>
> I can't see any method to achieve what you desire without explicitly
> creating voices and using overrides.
\\ uses make-voice-props-set and I would advise against redefining that.
--
David Kastrup