lilypond-user
[Top][All Lists]
Advanced

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

Re: How to create a thick horizontal line (as its own staff)?


From: David Nalesnik
Subject: Re: How to create a thick horizontal line (as its own staff)?
Date: Wed, 20 Jul 2016 15:49:10 -0500

Hi Mojca,

On Wed, Jul 20, 2016 at 10:05 AM, Mojca Miklavec
<address@hidden> wrote:
> Dear David (and others),
>
> One further thought.
>
> Given that it's super difficult to "transfer" information "across staves" ...
>
> Would it be feasible to allow the following input syntax (or something 
> similar)?
>
>     melody = { c a c \startPush f g a \stopPush h c d }
>     \new PianoStaff <<
>         \new Voice = "melody" \fixed c' {
>           \melody
>        }
>        \new Dynamics \with {
>          \override VerticalAxisGroup.nonstaff-nonstaff-spacing.padding = 1
>        } {
>          \melody
>        }
>     >>
>

With the example I gave above, this would work fine.  The horizontal
line engraver is only consisted to the Dynamics context, so the
push/pull events will only produce a line there.  Conversely, the
Dynamics context won't typeset the notes.

You will run into problems with this approach if you add dynamics to
your melody, however, since they will of course appear in the Dynamics
context.

The best solution would be to define your own context.  (Instructions
for doing this are found here:
http://lilypond.org/doc/v2.19/Documentation/notation/defining-new-contexts)

I've gone ahead and defined an "AccordionPushPull" context which
modifies the definition of a Dynamics context (definition found in
engraver-init.ly in the source) to include the horizontal line
engraver and nothing else.  So you can safely include your melody
variable and not need to worry about extraneous elements being
typeset.


> There are modes like "\new RhythmicStaff" that discard half of the
> information about the scores.
>
> I would be super happy if there was a way to enter the input
> information only once because repeating it twice is calling for
> errors. But also because \startPush and \stopPush could then do
> different things inside the main melody.
>
> The "\new Voice" could ignore the \startPush/\stopPush directives (or
> do something special with them) and "\new Dynamics" could ignore
> typesetting the actual musical notes. I don't know how much tweaking
> of LilyPond internals would be needed to achieve that though.

In this case, I believe you'd need to write another engraver.  It
would listen for the push and pull events and do something different,
like create the downbows or color notes.  No problem at all.

Hope this helps--

David N

P.S. I've attached two files, showing how you can cut down on the
clutter in your input file by using an include.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Attachment: accordion.ily
Description: Binary data

Attachment: example.ly
Description: Text Data


reply via email to

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