lilypond-user
[Top][All Lists]
Advanced

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

Re: Switching to drummode and back


From: David Kastrup
Subject: Re: Switching to drummode and back
Date: Tue, 19 Jun 2018 15:16:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

foxfanfare <address@hidden> writes:

> Hi everyone,
>
> I'm currently working on a score in which I'd like to alternate from drums
> notation to instrument.
>
> I found this topic which explained how to make this, but in my case, I would
> like to start the score with the percussion line.

Well, you'll need to remove the first clef from the Staff line then or
reverse the context order (namely enclose in a DrumStaff).

> If I take the previous exemple given by Malte and uncomment the first line,
> it doesn't work :
>
> \new Staff \with {
>    \accepts DrumStaff
> } {
>    %\repeat unfold 8 {e''8}
>    \drums {
>      hh4. r4. hh4
>      % else an additional clef would be printed
>      \once \omit DrumStaff.Clef
>    }
>    \clef bass d1 e f g
> } 
>
> The notes after the bass clef are all the same, except when the staff didn't
> start directly with the \drums occurence.

The problem here is that the DrumVoice context doesn't end since it is
the first context in the first context started in the sequential
iterator.

You can force this using

\new Voice { \clef bass ... }

since the \new Voice can only be created in the enclosing Staff
(\context Voice does not work since it would accept the Voice alias from
the existing DrumVoice context).

Alternatively, you can write
<< \drums { ... } >>

since the parallel music iterator blocks the magic continuation of the
first context from leaking into the sequential music around it.  That
is, well, sort-of hackish.  I know what happens here but don't really
have a good idea what technical problems that mechanism is intended to
solve.  Probably making sure that when writing
\new Staff { { ... } { ... } }
that the second sequential expression (which could be unavoidable
because of being returned by a music function)  does not start a new
Voice, disrupting slurs and ties.

-- 
David Kastrup



reply via email to

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