Dear Neil,
thanks for Your proposal.
I've tried Your code, but unfortunately Your code connects always two notes
under one slur, no matter which number I've choosen for x.

2011/9/17 Neil Puttock <n.putt...@gmail.com>

> On 17 September 2011 14:23, Stefan Thomas
> <kontrapunktste...@googlemail.com> wrote:
> > Dear community,
> > I would like to define a variable with sheme and I want to substract the
> > number one from this variable.
> > I tried it with:
> >
> >> % the following defines a Slur, lasting a certain number of eigth-notes
> >> xaS = #(define-music-function (parser location x) (number?)
> >>   #{ % in der folgenden Zeile Lilypondcode eingeben
> >>     s1*0 (  \repeat unfold  #(- $x 1)  {s8 } s8)
> >> #})
> >
> > Unfortunately without succes!
>
> This doesn't work since the unfold count argument isn't a scheme
> number.  I suggest resetting 'repeat-count inside scheme instead:
>
> \version "2.15.11"
>
> xaS =
> #(define-music-function (parser location x) (number?)
>    (let ((repeat-music #{ \repeat unfold 1 s8 #}))
>     (set! (ly:music-property repeat-music 'repeat-count)
>           (1- x))
>     (make-sequential-music
>      (list #{ s1*0( #} repeat-music #{ s8) #}))))
>
> \new Voice \relative c' {
>  << { c8 d e f } \xaS #4 >>
> }
>
> Cheers,
> Neil
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to