[CM] accessing data in seq
taube@uiuc.edu
taube@uiuc.edu
Sun, 15 Feb 2004 07:14:00 -0600
>i need some help or clarification on the following: after importing events,
>is there a way to access the data inside #&whatever-track ? just as an
>example, what should i do to transpose all :keynumber, or say, to add a
>number to each :time ?
you can use 'subobjects' or 'map-subobjects' to access the data and then 'sv' or a slot accessor to set the slot value
(dolist (x (subobjects #&myseq))
(sv x keynum (+ (sv x keynum) 1)))
both subobjects and map-subobjects are in the dictionary, SV is not. its not there because im not happy about its syntax. if you want to avoid 'sv' then you can use the object's slot accessors:
(dolist (x (subobjects #&myseq))
(setf (midi-keynum x)
(+ (midi-keynum x) 1))
or whatever else your Lisp gives your (slot-value, slot-ref etc)
(dolist (x (subobjects #&myseq))
(setf (slot-value x 'keynum)
(+ (slot-value x 'keynum))))
there are not any more 'heigher level' algorithmic editing tools because that is what plotter is for. i hope to be able to get plotter going again sometime this year. but of course ive been saying that for two years now!