Hi Pierre,

Am Samstag, den 07. Juli 2018 um 15:54:41 Uhr (+0200) schrieb Pierre
Perol-Schneider:
> Plus : any idea why 'testTwo does not work ?

 because the argument type of "arg" was string?. Below is the updated
version:

--
Orm


%circled-pattern
#(define-markup-command
  (circled-pattern layout props radius angle num arg)
  (number? number? number? markup?)
  (interpret-markup layout props
   (let ((rep (abs num)))
    (cond
     ((= num 0) (markup ""))
     ((= num 1) (markup arg))
     (#t (markup
          (#:combine
           (#:null)
           (fold
            (lambda (i prev)
             (markup
              (#:combine
               (#:rotate
                (* i (/ angle rep))
                (#:concat (#:null #:hspace radius arg)))
               prev)))
            (markup (#:null))
            (iota (1+ rep))))))))))

testOne = \markup "."
testTwo = \markup { \rotate #45 "!" }

\markup\circled-pattern #5 #180 #15 \testOne
\markup\circled-pattern #5 #-180 #15 \testOne
\markup\circled-pattern #5 #180 #2 \testOne
\markup\circled-pattern #5 #180 #1 \testOne
\markup\circled-pattern #5 #180 #0 \testOne

\markup\circled-pattern #5 #360 #5 \testTwo


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

Reply via email to