I’m looking for some help with Scheme.

I currently find writing a *SkipToBar* function very helpful for certain
things like tempi which only happen occasionally. An example would be:

stdRit = \tempo "rit"

pocoRit = \tempo "poco rit"

aTempo = \tempo "a tempo"

tempi = <<

    { 1 \pocoRit s1*2 \aTempo }

    { \skipToBar10 2 \pocoRit s2 | 1*2 | \aTempo }

    { \skipToBar18 \pocoRit s1 | 1*3 | \pocoRit s1 \aTempo }

    { \skipToBar28 2 \stdRit s2 | 1 | \aTempo s1*5 2 \stdRit s2 | \aTempo

    }

>>

But my current version of *SkipToBar* looks like this.

skipToBar = #(define-music-function (barNumber)(number?)

                #{ s1*#(+ barNumber -1) #}

            )

And if the time signature changes it doesn’t work. I tweak the function in
each file to handle 4/4 or ¾ and any initial partial bars.



I would like to have template so I could write a function which knows that
the time signature changes on a particular bar. I have tried writing scheme
to do it, but I’m afraid I have never been able to get to grips with it
properly.



Could some kind soul please write one for me?



Thanks in advance

Paul McKay

Reply via email to