lilypond-user
[Top][All Lists]
Advanced

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

Re: Bar counts and repeats in repetitive music


From: David Nalesnik
Subject: Re: Bar counts and repeats in repetitive music
Date: Fri, 17 Feb 2017 12:34:56 -0600

On Fri, Feb 17, 2017 at 12:17 PM, Jeffery Shivers
<address@hidden> wrote:
>>
>>
>  But it's also essential that the performer is told how many times to repeat
> each fragment! At the moment I've chickened out and used percent repeats
> with counts :(
>
>>
> I'll have a look at this - probably a matter of adding a new engraver; I've
> seen a trick that used \Dynamic context to display centered measure numbers
> before, so maybe something like that.
>
> If you don't care so much about the alignment though, you can just put a
> markup in that repeat function. Like:
>
> == snip
>
> repeatSect =
> #(define-music-function (parser location num mus)
>   (number? ly:music?)
>   (define startBar #f)
>   #{
>     #(make-apply-context
>       (lambda (context)
>        (let ((currentBar (ly:context-property context 'currentBarNumber)))
>          (set! startBar currentBar))))
>    \mark \markup { \hspace #30 "repeat this" #(number->string num) "times" }
>    \repeat volta #num { #mus }
>    #(context-spec-music
>        (make-apply-context
>          (lambda (context)
>            (let* ((endBar (ly:context-property context 'currentBarNumber))
>                    (repLength (- endBar startBar))
>                    (lenScaled (* repLength num))
>                    (nextBar (+ startBar lenScaled)))
>              (ly:context-set-property! context 'currentBarNumber nextBar))))
>        'Score)
>  #})
>
> == snip
>

Attached is my take.  It's based on a combinations of Jeffery's
functions and http://lsr.di.unimi.it/LSR/Snippet?id=954.  Note that it
will work for multi-measure repeated spans.

Best,
David

Attachment: fancy-repeats.ly
Description: Text Data


reply via email to

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