Brilliant Orm! Thank you very much.
Cheers,
Pierre

2018-07-07 14:39 GMT+02:00 Orm Finnendahl <
orm.finnend...@selma.hfmdk-frankfurt.de>:

> Hi Pierre,
>
>  I corrected your example (see below). It should work now.
>
> --
> Orm
>
>
> Am Samstag, den 07. Juli 2018 um 13:11:25 Uhr (+0200) schrieb Pierre
> Perol-Schneider:
> > Hi All,
> >
> > I'm not sure that a poscript would be ideal.
> > I'm thinking about a pattern markup command that would do :
> >
> > \markup{
> >   \combine
> >   \null
> >   \combine
> >   \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 1 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 2 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 3 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 4 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 5 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 6 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \combine
> >   \rotate #(* 7 (/ 90 7)) \concat { \null \hspace #5 "." }
> >   \null
> > }
> >
> > etc.
> > (Here it shows a 90° circled pattern with 7 dots (".") with radius 5)
> >
> > My attempt is limited by my Scheme knowledge...
>
> Here is the corrected example:
>
> %circled-pattern
> #(define-markup-command
>   (circled-pattern layout props radius angle num arg)
>   (number? number? number? string?)
>   (let* ((the-form
>           (markup
>            (#:combine
>             (#:null)
>             (fold
>              (lambda (i prev)
>               (markup
>                (#:combine
>                 (#:rotate
>                  (* i (/ angle num))
>                  (#:concat (#:null #:hspace radius arg)))
>                 prev)))
>              (markup (#:null))
>              (iota (1+ num)))))))
>    (interpret-markup layout props the-form)))
>
> % Test (markup a 180° circled pattern with radius 5 and 17 dots) :
> \markup\circled-pattern #5 #180 #17 #"."
>
> % an upside down pattern can be achieved with a negative angle:
>
> \markup\circled-pattern #5 #-180 #17 #"."
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to