[CM] CMN : glissando+final-note

Bill Schottstaedt bil@ccrma.Stanford.EDU
Fri, 28 Jun 2002 04:49:45 -0700


> At the end of a glissando-line I wish to put  a sort
> of auxiliary note (without duration). Is it possible ?

You could make a version of auxiliary-note that uses the
outer note's x1 value, rather than x0 -- i.e. change two
characters in auxiliary-note: (code reformatted to try
to keep the mailer from inserting bogus <cr>s)

(defun auxiliary-note-at-end (&rest objects)
  (let ((nt (apply #'note objects)))
    (make-self-acting
     :argument nt
     :action
     #'(lambda (owner note)
	 (add-to-marks
	  owner
	  (list
	   (make-instance
	    'sundry
	    :name :auxiliary-note
	    :source (format nil "(auxiliary-note ~A)" note)
	    :mark
	    #'(lambda (mark outer-note score &optional justifying)
		(declare (ignore mark))
		(let* ((grace-scale
			(if (and (matrix note) (not (identity-matrix-p note)))
			    (first (matrix note))
			  *grace-note-size*))
		       (inverse-scale (/ 1.0 grace-scale))
		       (old-separation *staff-line-separation*))
		  (if (not justifying)
		      (progn
			(setf *staff-line-separation* (* inverse-scale old-separation))
			(with-scaling
			 score grace-scale
			 (* (+ (box-x1 outer-note) ; x1 here
			       (vis-dx outer-note))
			    (scr-size score))
			 (* (staff-y0 outer-note) (scr-size score))
			 (setf (staff-y0 note) 0.0)
			 (setf (line note) (place-of-note-given-note outer-note note))
			 (setf (box-y0 note) (* (line note) *staff-line-separation*))
			 (setf (center note) .143)
			 ;; can this be a chord? if so, see grace note centering case.
			 (setf (box-x0 note) 0)
			 (display note nil score))
			(setf *staff-line-separation* old-separation))
		    (moveto score (+ (box-x1 outer-note) ; and here
				     (vis-dx outer-note)
				     (vis-dx note))
			    0)))))))))))

(cmn (size 24) (glissando-thickness 0.03)
   (staff bar (treble (text "sul E" (font-size 10) (dy 1.25) ))

	(e6   q begin-glissando)
	(gs5  e end-glissando begin-glissando)
	(c6   e end-glissando begin-glissando)
	(e6   h. end-glissando
	      (glissando-to fs5)
	      (auxiliary-note-at-end fs5 no-stem))
    ); end-staff
); end-cmn