lilypond-user
[Top][All Lists]
Advanced

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

Re: "Mensurstriche" (barlines between systems) and Repeat signs.


From: Thomas Morley
Subject: Re: "Mensurstriche" (barlines between systems) and Repeat signs.
Date: Sun, 3 Feb 2019 18:23:49 +0100

Am Sa., 2. Feb. 2019 um 20:45 Uhr schrieb Thomas Morley
<address@hidden>:

> Am Sa., 2. Feb. 2019 um 14:21 Uhr schrieb Aaron Hill <address@hidden>:

> > Alternately, the \defineBarLine function could be split:
> >
> >      \defineBarLine "bar" #'("end" "begin" "span")
> >      % becomes
> >      \setBarLineSpanning "bar" "span"
> >      \setBarLineBreaking "bar" "end" "begin"
> >
> > We gain some clarity and self-documentation; and in fact, the line
> > breaking arguments no longer need to be grouped in a list.  Users who
> > only need to change the default behavior for one aspect need only use
> > its associated function.  But would the added verbosity be a justifiable
> > cost?
>
> I think this suggestion would need a bit more work.
> Not sure it's worth the afford. But that's only me. I was involved in
> coding this scheme-interface, so I'm familiar with most of it (albeit
> not all). It's always difficult to write a good user-interface or
> documentation, if one is too familiar with things...
> So I'm open for suggestions as well.
> Currently I haven't researched the possibilities of setBarLineSpanning
> etc in depth maybe later or tomorrow, I may change my mind then ...

I had a closer look today, and I think it would be not so much work to
implement such things as I thought.
For now I come up with the code below.

Disclaimer:
It uses some special syntax to get non-public procedures etc. Don't do
so in codings for serious work.
The guile manual says it's meant only for debugging or as last resort.
Usually there is a reason why non-public procedures are non-public. ;)
It's done here only to offer everyone the possibility to test without
patching internals.

\version "2.19.82"

setBarLineSpanning =
#(define-void-function (bar span)(string? string?)
  (let* ((raw-bar ((@@ (lily) strip-string-annotation) bar))
         (bar-from-glyph-alist
           (or (assoc-get bar (@@ (lily) bar-glyph-alist))
               (assoc-get raw-bar (@@ (lily) bar-glyph-alist)))))
    (if bar-from-glyph-alist
        (define-bar-line
          bar (car bar-from-glyph-alist) (cdr bar-from-glyph-alist) span)
        (let ((raw-bar-proc
                (assoc-get raw-bar (@@ (lily) bar-glyph-print-procedures))))

          (if (not raw-bar-proc)
              (ly:warning
                "No printing-procedure for bar of type \"~a\"."
                raw-bar))
          (ly:warning
            "Behaviour of bar type \"~a\" is not defined, use \\defineBarLine."
            raw-bar)))))

\setBarLineSpanning "|-dashed" "!"

m = {
  R1 R1 \break R1 R1 R1
}

\score {
  \new StaffGroup << \m \m >>
  \layout {
    \set Score.defaultBarType = "|-dashed"
  }
}

#(define (boolean-or-string? x)
  (or (boolean? x) (string? x)))

setBarLineBreaking =
#(define-void-function
  (bar end begin)(string? boolean-or-string? boolean-or-string?)
  (let* ((raw-bar ((@@ (lily) strip-string-annotation) bar))
         (span-bar
           (or (assoc-get bar (@@ (lily) span-bar-glyph-alist))
               (assoc-get raw-bar (@@ (lily) span-bar-glyph-alist)))))
    (if span-bar
        (define-bar-line bar end begin span-bar)
        (let ((raw-bar-proc
                (assoc-get raw-bar (@@ (lily) bar-glyph-print-procedures))))

          (if (not raw-bar-proc)
              (ly:warning
                "No printing-procedure for bar of type \"~a\"."
                raw-bar))
          (ly:warning
            "Behaviour of bar type \"~a\" is not defined, use \\defineBarLine."
            raw-bar)
          #f))))


\setBarLineBreaking "|-alt" "." "S"

m = {
  R1 R1 \break R1 R1 R1
}

\score {
  \new StaffGroup << \m \m >>
  \layout {
    \set Score.defaultBarType = "|-alt"
  }
}


Opinions?


Cheers,
  Harm



reply via email to

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