[CM] cmn, arrow

Bill Schottstaedt bil at ccrma.Stanford.EDU
Mon Mar 19 11:00:18 PDT 2012


> I need a good symbol for an arrow upon a note, a rest or a bar. 

Here's a possibility -- you can make the arrow any size and style
you like:

(defun display-lone-arrow (mark obj score &optional size)
  (let* ((y-off (+ (y0 mark) (dy mark) (staff-y0 obj) 1.5))
	 (width .3)                  ; arrow width
	 (height .4)                 ; arrow height
	 (x-off (+ (x0 obj) (dx mark) (center obj) (x0 mark))))
    (with-thickness score mark .035  ; this is the stem thickness
      (moveto score x-off (+ y-off 0.7))
      (lineto score x-off y-off)
      (draw score)
      (moveto score (- x-off (* 0.5 width)) y-off)
      (rlineto score width 0)
      (rlineto score (* -0.5 width) (* -0.5 height))
      (rlineto score (* -0.5 width) (* 0.5 height))
      (fill-in score))))

(defvar lone-arrow
  (make-instance 'write-protected-sundry 
    :name :lone-arrow :mark #'display-lone-arrow))

(defun lone-arrow (&rest objects) 
  (apply #'mark #'display-lone-arrow :lone-arrow objects))


(cmn (staff treble 
	    (g5 q (lone-arrow))
	    (bar lone-arrow)
	    (quarter-rest (lone-arrow))))





More information about the Cmdist mailing list