[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: arbitrary repeat counter
From: |
Simon Bailey |
Subject: |
Re: arbitrary repeat counter |
Date: |
Wed, 1 Jun 2022 17:04:29 +0100 |
On Wed, 1 Jun 2022 at 16:14, Jean Abou Samra <jean@abou-samra.fr> wrote:
> > 1. What is the duration of a measure dependent on the current time
> > signature?
>
> In an engraver :-)
>
> (ly:context-property context 'measureLength)
>
> You can't get it in the music function, since timing is not
> established at that point (just think that the time signature
> could come from another element of a << >> construct, for
> example).
>
> Remember, though, that the time signature might change
> in the middle of the repeat. Thus it will be a bit
> more reliable to actually acknowledge the PercentRepeatCount
> grobs and increment a counter whenever you see one.
I actually tried that and ran into scheme problems (incrementing a
counter didn't seem to work).
> > 2. How long is a given musical expression (in measures or beats)?
>
> (ly:music-length your-music)
>
I think I might use your engraver ;) But I've definitely learnt more
today. Thanks!
I did make one small change to your engraver:
(if (> count 1)
(ly:grob-set-property! spanner 'text (number->string count))) ;;;
<====== here
So that it only prints the numbers for repeated phrases.
Kind regards,
sb
--
Do not meddle in the affairs of trombonists, for they are subtle and
quick to anger.
- arbitrary repeat counter, Simon Bailey, 2022/06/01
- Re: arbitrary repeat counter, Jean Abou Samra, 2022/06/01
- Re: arbitrary repeat counter, Simon Bailey, 2022/06/01
- Re: arbitrary repeat counter, Simon Bailey, 2022/06/01
- Re: arbitrary repeat counter, Jean Abou Samra, 2022/06/01
- Re: arbitrary repeat counter, Simon Bailey, 2022/06/01
- Re: arbitrary repeat counter, Jean Abou Samra, 2022/06/01
- Re: arbitrary repeat counter, Simon Bailey, 2022/06/01
- Re: arbitrary repeat counter, Jean Abou Samra, 2022/06/01
- Re: arbitrary repeat counter,
Simon Bailey <=
- Re: arbitrary repeat counter, Jean Abou Samra, 2022/06/01
- Re: arbitrary repeat counter, Simon Bailey, 2022/06/01
- Re: arbitrary repeat counter, Jean Abou Samra, 2022/06/01
- Re: arbitrary repeat counter, Simon Bailey, 2022/06/01
- Re: arbitrary repeat counter, Jean Abou Samra, 2022/06/01
- Re: arbitrary repeat counter, Simon Bailey, 2022/06/04
- Re: arbitrary repeat counter, Wols Lists, 2022/06/06
- Re: arbitrary repeat counter, Jean Abou Samra, 2022/06/06
- Re: arbitrary repeat counter, Wols Lists, 2022/06/06
- Re: arbitrary repeat counter, David Kastrup, 2022/06/06