Thanks again. But there's a slight problem: I didn't mention that I'm a pianist, so have 2 separate staves with the same repeat pattern. The snippet below shows some very interesting results, not least at the bar number check.
-------------------------
Saturday, February 18, 2017, 12:24:51 AM, you wrote:
> On Fri, Feb 17, 2017 at 4:06 PM, David Nalesnik
> <address@hidden> wrote:
>> On Fri, Feb 17, 2017 at 1:22 PM, Peter Toye <address@hidden> wrote:
>>> David,
>>> That looks fantastic. Thanks ever so much. Haven’t had time to try it out in
>>> anger yet
>>> -------------------------
>>> Friday, February 17, 2017, 6:34:56 PM, you wrote:
>>>> 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.
>> At the moment, it will mess up if the number of repetitions is less
>> than the number of bars in the repeated pattern!