lilypond-user
[Top][All Lists]
Advanced

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

Re: Repeats with bar-engraver removed


From: J Stasko
Subject: Re: Repeats with bar-engraver removed
Date: Tue, 5 Jan 2021 20:16:25 +0800

Dear Pierre Perol-Schneider,  I am sorry, but \bar ".|:" and \bar ":|." did not work.  
Dear Kieren MacMillan, I am sorry, but "\omit BarLine" did not work.  Indeed, it did omit bar lines, but the composition ran off the left margin of the page.
Dear Laura Conrad, I am sorry, but your solution also did not work, the behaviour was the same as that of Ms. MacMillan's solution.

For all of the above three tests, I included the Bar_engraver and removed the statement regarding \set ScoreTiming.

Dear Jean@abou-samra.fr, it looks like your solution does indeed work!  Thank you for your careful work. 

And to answer one question which arose: the idea to remove the bar engraver is included in the manual under chant music.  

I would like to thank everyone who provided answers!  This is not something I could have found time to figure out myself, and I certainly wish one of the simpler solutions would have worked.

Happy New Year! Bonne et heureuse année!  

Sincerely,
John Staško


вт, 5 янв. 2021 г. в 03:32, Pierre Perol-Schneider <pierre.schneider.paris@gmail.com>:
Maybe it's a silly question but why not simply something like:

\version "2.18"
{ c'1 \bar ".|:" c' c' c' \bar ":|." c' c'  }

Cheers,
Pierre

Le lun. 4 janv. 2021 à 20:23, Jean Abou Samra <jean@abou-samra.fr> a écrit :
> I need to be able to engrave repeats, but I fear that the
> bar-engraver, which I turned off for chant music, is responsible for
> engraving the repeats: when I turn it back on, then the repeats
> appear, but since the music is chant, it runs off the page.
>
> How to do this?
>
> The work is attached.
>
> Thank you.

Hello,

Your diagnosis is right. The Bar_engraver is responsible for engraving
all kinds of bars and preventing breaks when there aren't any.

Here is one solution (though not the only one and most probably not the
most concise one): rewrite it to engrave just repeat bar lines while
ignoring requests for regular bar lines and not preventing lines breaks
anywhere.


\version "2.21.80"

%  Original file is at
% https://gitlab.com/lilypond/lilypond/-/blob/master/lily/bar-engraver.cc

#(define (Tweaked_bar_engraver context)
    (let ((bar #f)
          (spanners '())
          (considered-bar #f))
      (make-engraver
        ((process-acknowledged translator)
           (if (not considered-bar)
               (begin
                 (set! considered-bar #t)
                 (let ((gl (ly:context-property context 'whichBar))
                       (default-bar-type (ly:context-property context
'defaultBarType)))
                   (if (and (string? gl)
                            (not (equal? gl default-bar-type)))
                       (begin
                         (set! bar (ly:engraver-make-grob translator
'BarLine '()))
                         (ly:grob-set-property! bar 'glyph gl))))))
           (if bar
               (for-each
                 (lambda (sp) (ly:spanner-set-bound! sp RIGHT bar))
                 spanners))
           (set! spanners '()))
        (end-acknowledgers
          ((spanner-interface engraver grob source-engraver)
             (if (and
                   (or bar (not considered-bar))
                   (ly:grob-property grob 'to-barline))
                 (set! spanners (cons grob spanners)))))
        ((stop-translation-timestep translator)
           (set! bar #f)
           (set! considered-bar #f)))))

\layout {
   \context {
     \Staff
     \remove "Bar_engraver"
     \consists #Tweaked_bar_engraver
     \remove "Time_signature_engraver"
   }
}

See complete example attached.

Best,
Jean



reply via email to

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