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 16:48:00 -0500

On Wed, Jul 20, 2016 at 3:49 PM, David Nalesnik
<address@hidden> wrote:

>
> On Wed, Jul 20, 2016 at 10:05 AM, Mojca Miklavec
> <address@hidden> wrote:

>>
>> 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.

Just to demonstrate how you could make an engraver to create different
behavior, I wrote one to color note heads red.

Add this definition to accordion.ily:

accordionRedPushEngraver =
#(lambda (context)
   (let ((push? #f))
     (make-engraver
      (listeners ((accordion-push-span-event engraver event)
                  (if (= START (ly:event-property event 'span-direction))
                      (set! push? #t)
                      (set! push? #f))))
      (acknowledgers
       ((note-head-interface engraver grob source-engraver)
        (if push?
            (set! (ly:grob-property grob 'color) red)))))))

Then add the engraver in example.ly like this:

\new PianoStaff <<
  \new Staff <<
    \new Voice = "melody" \with { \consists \accordionRedPushEngraver } {
      \melody
    }

[snip]


Adding Scripts (downbows) looks a bit harder, but I suppose it could be done.

David N



reply via email to

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