Re: to make a function with argument list or vector

2016-09-04 Thread Simon Albrecht
On 04.09.2016 20:47, Thomas Morley wrote: Urs suggestion would lead to the following, which I'd recommend as well: foo = #(define-music-function (parser location lst)(number-list?) #{ $@(map (lambda (i) #{ \repeat unfold $i { c2 } \bar "||" #}) lst) \bar "|." #}) \foo #'(5 7 10 8)

Re: to make a function with argument list or vector

2016-09-04 Thread Thomas Morley
Hi Оксана, you try to output music from a recursively defined scheme-function. As Urs already said use a music-function for music. Also some mistakes: 2016-09-04 18:52 GMT+02:00 Оксана Крымина : > \version "2.18.2" > musSpisok = #(define-scheme-function (parser location llen)(list?) >

Re: to make a function with argument list or vector

2016-09-04 Thread Urs Liska
Am 4. September 2016 19:30:02 MESZ, schrieb "Оксана Крымина" : >Great! It works! It works! >Thank You! > The first thing is you had to use define-music-function because that returns *music*. Then you can return a *list* of music expressions with something like @(map (lambda (len) #{

Re: to make a function with argument list or vector

2016-09-04 Thread Оксана Крымина
Great! It works! It works! Thank You! 2016-09-04 20:15 GMT+03:00, Simon Albrecht : > Hi Oxana, > > I _guess_ the reason it doesn’t work is because the parser doesn’t > accept a Scheme expression instead of the number after \repeat unfold. > The solution is creating music via Scheme. As a first ste

Re: to make a function with argument list or vector

2016-09-04 Thread Simon Albrecht
Hi Oxana, I _guess_ the reason it doesn’t work is because the parser doesn’t accept a Scheme expression instead of the number after \repeat unfold. The solution is creating music via Scheme. As a first step, you can always use something like %%% \version "2.19.47" \displayMusic { \repeat

to make a function with argument list or vector

2016-09-04 Thread Оксана Крымина
hello all! please, help me to write a function to convert several numbers like (5 7 10 8) to musical string like \repeat unfold 5 {c2} \bar "" \repeat unfold 7 {c2} \bar "" \repeat unfold 10 {c2} \bar "" \repeat unfold 8 {c2} \bar "" my code produces errors only: \version "2.18.2" musSpisok =