On Fri, 2018-05-04 at 23:55 +0200, Simon Albrecht wrote:
> On 04.05.2018 19:23, David Sumbler wrote:
> >
> > It seems that if, in a
> > <<{\musicA} {\musicB}>>
> > passage, \musicA does not specify a new Voice, then the music
> > before
> > the << >> passage and, importantly, also the music afterwards will
> > all
> > be treated as belonging to the same voice. Is that correct?
> Have a look at this example:
>
>
> \version "2.19.80"
>
> <<
> c
> c
> >>
>
> \new Staff
> <<
> c
> c
> >>
>
> \new Staff
> <<
> c
> \\
> c
> >>
>
> \new Staff
> \new Voice
> <<
> c
> c
> >>
>
>
> resulting in the attached output.
> <<>> just combines music expressions simultaneously. Depending on
> which
> contexts are explicitly created, separate implicit contexts will be
> created or not.
>
> Best,
> Simon
I have always found the implicit creation of contexts etc. rather
confusing, which is why I have been inclined to define the higher
elements of the structure explicitly. I used even to have completely
unnecessary \bookpart-s etc. but I try to avoid that sort of thing now.
On the other hand, I suppose I have rather tended to take the implicit
creation of Voices for granted. Especially in the light of your
example, I am starting to think that perhaps I should make it a policy
always to define Voices explicitly.
As it is, I found your example quite hard to understand, and I dare say
I am not alone in that. However, having experimented with it quite a
bit, I now see (I think) that:
Example 1: here the << informs Lilypond that what follows is music, but
the Staff and Voice themselves are created by each of the simultaneous
'c's, which otherwise have nowhere to go.
Example 2: here a Staff has already been created, so the simultaneous
notes already have somewhere to go and therefore appear on to the same
Staff. I think that they each individually create a voice, since they
have separate stems and because of the warning that Lilypond gives.
Both voices seem to have voiceOne style, presumably since nothing else
has been specified; Lilypond is therefore protesting about the
resulting collision.
Example 3: The << \\ >> construct causes each of the simultaneous notes
to have its own voice, specifically voiceOne and voiceTwo. If I add
another \\ section the contents go into voiceThree etc. Is that
correct?
Example 4: Here a voice is explicitly defined, and therefore Lilypond
understands that the simultaneous notes both have to go into that one
voice, rather than creating new ones: hence the doubled notehead on a
single stem. If I add a third note at the same pitch, no more
noteheads are produced, but surprisingly Lilypond does not give a
warning.
Have I understood all of this correctly? Sorry if this all seems
elementary, especially since I have been using Lilypond on and off for
several years.
The automatic creation of contexts is obviously very useful, especially
when one is just a beginner at Lilypond. But I almost wish that there
were an option to turn it off, which would be useful for forcing
oneself to understand how this all actually works!
David
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user