lilypond-user
[Top][All Lists]
Advanced

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

Re: Triangle Arrow shape above Staff


From: Pierre Perol-Schneider
Subject: Re: Triangle Arrow shape above Staff
Date: Tue, 13 Nov 2018 00:51:28 +0100

Hi Reggie,
For the triangle, see https://archiv.lilypondforum.de/index.php/topic,1279.msg7040.html#msg7040
e.g. :

\version "2.19.80"

#(define-markup-command (n-agon layout props corners radius arg)
  (number? number? markup?)
  #:category graphic
  #:properties ((thickness 1))
  (let* ((th (* (ly:output-def-lookup layout 'line-thickness)
               thickness))
         (alpha-step (if (= corners 0) 99 (/ (* 2 PI) corners)))
         (alpha-start (if (>= radius 0) (/ alpha-step 2) 0))
          (polypoints
           (let loop ((alpha alpha-start))
             (if (> alpha (* 2 PI))
                 '()
                 (cons (* (abs radius) (sin alpha)) (cons (- 0 (* (abs radius) (cos alpha)))
                    (loop (+ alpha alpha-step)))))))
         (m (interpret-markup layout props arg))
         (x-ext (ly:stencil-extent m X))
         (y-ext (ly:stencil-extent m Y)))

    (ly:stencil-add m
      (ly:stencil-translate
         (if (equal? polypoints '())
            (ly:make-stencil (list 'circle radius th #f))
            (ly:make-stencil `(polygon ',polypoints  ,th #f)))
         (cons (/ (cdr x-ext) 2) (/ (cdr y-ext) 2))))))
 

% TEST:
 
{
  \mark\markup\n-agon #3 #-3 \bold\fontsize #1.5 "3"
  c'
}

For the arrow, maybe you'll find something interesting here: http://lsr.di.unimi.it/LSR/Item?id=1026

HTH, cheers,
Pierre

Le lun. 12 nov. 2018 à 23:11, Reggie <address@hidden> a écrit :
How do you put a triangle shape with duration beat number inside above staff
in 2.19 please as well as a standard conductor arrow thank you I cannot find
how to.

shapee.png <http://lilypond.1069038.n5.nabble.com/file/t5625/shapee.png



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html

_______________________________________________
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]