comparison base/methods.lisp @ 33:d1010755f507

Large upload of local changes. Many additions, such as harmony and piece-level objects darcs-hash:20070413100909-f76cc-a8aa8dfc07f438dc0c1a7c45cee7ace2ecc1e6a5.gz
author David Lewis <d.lewis@gold.ac.uk>
date Fri, 13 Apr 2007 11:09:09 +0100
parents 8d2b1662f658
children 81b4228e26f5
comparison
equal deleted inserted replaced
32:5e705b6f94b6 33:d1010755f507
13 (%pitch-interval-span pitch-interval-designator)) 13 (%pitch-interval-span pitch-interval-designator))
14 14
15 (defmethod duration ((period-designator period)) 15 (defmethod duration ((period-designator period))
16 (%period-interval period-designator)) 16 (%period-interval period-designator))
17 17
18 (defmethod (setf duration) ((value real) (period-designator period))
19 (setf (%period-interval period-designator) value))
20
18 (defmethod timepoint ((moment-designator moment)) 21 (defmethod timepoint ((moment-designator moment))
19 (%moment-time moment-designator)) 22 (%moment-time moment-designator))
23
24 (defmethod (setf timepoint) ((value real) (moment-designator moment))
25 (setf (%moment-time moment-designator) value))
20 26
21 (defmethod beat-units-per-bar ((time-signature basic-time-signature)) 27 (defmethod beat-units-per-bar ((time-signature basic-time-signature))
22 (%basic-time-signature-numerator time-signature)) 28 (%basic-time-signature-numerator time-signature))
23 29
24 (defmethod beat-units ((time-signature basic-time-signature)) 30 (defmethod beat-units ((time-signature basic-time-signature))
194 (defmethod ends ((object1 anchored-period) 200 (defmethod ends ((object1 anchored-period)
195 (object2 anchored-period)) 201 (object2 anchored-period))
196 (time= (cut-off object1) (cut-off object2))) 202 (time= (cut-off object1) (cut-off object2)))
197 203
198 ;; ...and 204 ;; ...and
205
206 (defmethod period= ((object1 anchored-period)
207 (object2 anchored-period))
208 (and (time= object1 object2)
209 (duration= object1 object2)))
210 (defmethod period= ((object1 floating-period)
211 (object2 floating-period))
212 (duration= object1 object2))
199 213
200 (defmethod period-intersection ((object1 anchored-period) 214 (defmethod period-intersection ((object1 anchored-period)
201 (object2 anchored-period)) 215 (object2 anchored-period))
202 (cond 216 (cond
203 ((disjoint object1 object2) 217 ((disjoint object1 object2)
210 (duration (duration (time- (if (time> (cut-off object2) (cut-off object1)) 224 (duration (duration (time- (if (time> (cut-off object2) (cut-off object1))
211 (cut-off object1) 225 (cut-off object1)
212 (cut-off object2)) 226 (cut-off object2))
213 start)))) 227 start))))
214 (make-anchored-period (timepoint start) duration))))) 228 (make-anchored-period (timepoint start) duration)))))
215 229
216 230
217
218