lilypond-user
[Top][All Lists]
Advanced

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

Re: dotted semicircle indicating harmonics


From: Orm Finnendahl
Subject: Re: dotted semicircle indicating harmonics
Date: Sat, 7 Jul 2018 14:39:12 +0200
User-agent: Mutt/1.10.0 (2018-05-17)

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 #"."



reply via email to

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