lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Define markup with iteration


From: Pierre Perol-Schneider
Subject: Re: Define markup with iteration
Date: Tue, 14 Apr 2015 17:30:28 +0200

Merci Gilles,

Unfortunately I still cannot get anything.
So, if I follow your instructions here's what I get:

#(define-markup-command (staff-lines-it layout props n pad long) (number? number? number?)
     (interpret-markup layout props
         (if (= n 0)
             (markup (#:path 0.15 `((moveto  0  ,(* pad 0))(lineto  ,long  ,(* pad 0)))))
             (markup
                 (#:combine
                    (#:path 0.15
                      (fold
                        (lambda(i,prev)
                           (cons
                              (moveto  0  (* pad i))
                              (cons
                                (lineto  long  (* pad i))
                                prev)))
                          '()
                          (reverse (iota (1+ n))))
                    )))
             )))

\markup\staff-lines-it #5 #1 #10


And does not compile.
What am I missing?

Cheers,
Pierre


2015-04-14 15:09 GMT+02:00 Gilles THIBAULT <address@hidden>:

> ;;untested
>
> (#:path 0.15
>    (map
>       (lambda(i)
>          (moveto  0  (* pad i))(lineto  long  (* pad i))
>       (iota n)
>
> Perhaps (iota (1+ n))
Ok sorry,  (moveto  0  (* pad i))(lineto  long  (* pad i)) was not one
instruction but two :

(#:path 0.15
    (fold
      (lambda(i,prev)
         (cons
            (moveto  0  (* pad i))
            (cons
              (lineto  long  (* pad i))
              prev)))
        '()
        (reverse (iota (1+ n))))


--
Gilles

_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

[Prev in Thread] Current Thread [Next in Thread]