|
From: | Pierre Perol-Schneider |
Subject: | Re: dotted semicircle indicating harmonics |
Date: | Sat, 7 Jul 2018 15:07:07 +0200 |
Hi Pierre,
I corrected your example (see below). It should work now.
--
Orm
> My attempt is limited by my Scheme knowledge...
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)
>
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 #"."
[Prev in Thread] | Current Thread | [Next in Thread] |