[CM] CLM->CMN problem
Rodrigo Segnini
rsegnini at ccrma.Stanford.EDU
Wed Feb 19 08:51:17 PST 2003
Hi. In CMN the following code produces a shaded single <C4:1/5 duration>
note with onset <2> in staff <ins> from score <hi>, as in the picture
that I'm attaching.
(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 0.458))
(finish-clm-input hi nil nil))
Most of the translation between CLM and CMN is handled by functions
inside cmn2.lisp. One of them, (display-notes args notes) takes a list
of arguments as score attributes and a list of notes in the same form as
the third line above (score name begin-time duration frequency &rest).
I have created a function that calls <display-notes> using note lists
similar to that same line. The output is correct, except that the
grayscale attribute is lost.
When peeking at hi.cmn, it is clear that it had no consequences on it.
;;; -*- syntax: common-lisp; package: cmn; base: 10; mode: lisp -*-
;;; cmn structure stored Tue 18-Feb-3 at 15:22
(in-package :cmn)
(cmn (title "speech2cmn test")
(size 12)
(title-separation 5)
(automatic-page-numbers T)
(automatic-measure-numbers T)
(all-output-in-one-file T)
(redundant-accidentals nil) (title "speech2cmn test")
(system
(staff (staff-name "75")
(treble)
(meter 2 4)
(ef6 (rq 1/5) (onset 0) stem-down begin-two-octaves-up)
(ef6 (rq 1/5) (onset 1/5) stem-down)
(...)
(ef6 (rq 1/5) (onset 11/5) stem-down end-two-octaves-up))
(staff (staff-name "71") ...
On the other hand, if one edits hi.cmn and adds the color attribute, and
(load "hi.cmn") as the current score, then color it goes.
I have traced what happens to the arguments after <display-notes> and
inserted print statements in reloaded sections of cmn2.lisp to observe
the state of the <&rest object> variable after every call.
<display-notes> calls <add-note>, which in turn calls
<add-note-to-staff>. At the end of it there is a conditional such that
if there are any extra arguments, <note> is applied to them (apply
#'note nt rest) before pushing the result to (staff-data staff),
otherwise (push nt (staff-data staff)).
Now, at this point it gets all too obscure for me as <note> just
encapsulates a call to <ur-note> which seems to be the place where
relevant information is added to the note object (self-acting-p,
rhythm-p, score-object-p, etc) and the rest is discarded.
Up to here I can trace that (GRAY-SCALE 0.458) is still alive as an
argument, but it has no consequence to the note object.
Any idea why that is happening?
Thanks,
Rodrigo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aaa.jpg
Type: image/jpeg
Size: 4116 bytes
Desc: not available
URL: <https://cm-mail.stanford.edu/pipermail/cmdist/attachments/20030219/103c7558/attachment.jpg>
More information about the Cmdist
mailing list