[CM] CLM->CMN problem

Rodrigo Segnini rsegnini@ccrma.Stanford.EDU
20 Feb 2003 19:16:31 -0800


Hi Bill:

On Thu, 2003-02-20 at 05:01, Rodrigo Segnini wrote:
> Thanks Bill. Yes, cmn-store is part of my custom function (see below).
> With these extra functions, do you think that gray-scale will be
> supported as well?

I just realized the function <gray-scale> in cmn-objects.lisp takes care
of that. I did not know that a grayscale value was obtained by giving
the same value to red, green, and blue ;-)

Anyways, I modified <add-note> as part of my loaded code just to see
what I'm passing to <add-note-staff>:

(defun clm::add-note (score name begin-time duration frequency &rest
rest)
  (apply #'cmn::add-note-to-staff score
	 (cmn::find-staff score name) begin-time duration frequency
	 rest);(first rest))
  (format t "~s ~d ~d ~d ~d ~d ~%" ; debug what's passed to
add-note-to-staff
  	  score name begin-time duration frequency rest);(first rest))
  )

And this is the result:

#<CMN::SCORE @#x20cac73a> 0 2.2d0 1/5 261.73 ((COLOR (0.22 0 0)))

Since I was suspicious of the double parenthesis in the color object, I
tried pulling it out (the second version is commented as (first rest)
instead of plain rest).

It still doesn't write to hi.cmn the color attribute.

But  if you do it by hand as in this example:

(progn (setf hi (init-clm-input))
       (setf ins (add-staff hi "ins" nil))
       (add-note-to-staff hi ins 2.0d0 1/5 261 (GRAY-SCALE .9))
       (add-note-to-staff hi ins 2.2d0 1/5 261 (COLOR '(.9 .9 .9))) 
       (finish-clm-input hi nil nil))

It does, so I'm confused...

Thanks for your considerations,

Rodrigo
 
> (defun sp2cmn (...)  
>       (setf note-lists (append (notator2 :sound sound
> 					 :name partial
> 					 :partial partial
> 					 :amp-threshold threshold
> 					 :color color) note-lists)));))
>     ;(print note-lists) ; debug what's generated by notator2
>     (cmn::cmn-store 
>      (clm::display-notes (list (cmn::size 12) 
> 			       (cmn::all-output-in-one-file t)
> 			       (cmn::automatic-page-numbers t)
> 			       (cmn::automatic-measure-numbers t)
> 			       (cmn::redundant-accidentals nil)
> 			       (cmn::title-separation 5)
> 			       (cmn::title title))
> 			 note-lists numerator denominator)) 
> 
> Thanks for your quick reply,
> 
> Rodrigo
> 
> On Thu, 2003-02-20 at 02:54, Bill Schottstaedt wrote:
> > I take it you're using cmn-store to create hi.cmn, and that the
> > bug is that the color is lost in that case?  You can fix this by
> > adding identify-color, and including it in the-usual-suspects:
> > 
> > ;;; in cmn-objects.lisp:
> > (defun identify-color (obj &optional file)
> >   (if (color obj)
> >       (format file " (color '~A)" (color obj))
> >     ""))
> > 
> > ;;; in cmn1.lisp:
> > (defun the-usual-suspects (object)
> >   (format nil "~A~A~A~A~A"
> > 	  (identify-marks object)
> >   	  (check-for-cmn-store-tag object)
> >   	  (identify-matrix object)
> >  	  (identify-color object)
> >   	  (identify-visible object)))
> > 
> > I made these changes in the cmn tarball.
> > _______________________________________________
> > Cmdist mailing list
> > Cmdist@ccrma.stanford.edu
> > http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
>