comparison implementations/mtp/methods.lisp @ 291:2d2bc910c364

Handle missing time signature in MTP implementation of GET-APPLICABLE-TIME-SIGNATURES. darcs-hash:20090722123745-c0ce4-b153c9962f3d9f4cc6ce2a44cf1c3a65951c3ce7.gz
author Marcus Pearce <m.pearce@gold.ac.uk>
date Wed, 22 Jul 2009 13:37:45 +0100
parents 03be243f9003
children f0e742e8de06
comparison
equal deleted inserted replaced
290:6af1f19a4475 291:2d2bc910c364
148 (amuse:make-standard-period (/ timebase 4)))) 148 (amuse:make-standard-period (/ timebase 4))))
149 #.(clsql:restore-sql-reader-syntax-state) 149 #.(clsql:restore-sql-reader-syntax-state)
150 150
151 (defmethod get-applicable-time-signatures ((e mtp-event) c) 151 (defmethod get-applicable-time-signatures ((e mtp-event) c)
152 (declare (ignore c)) 152 (declare (ignore c))
153 (let ((pulses (%mtp-pulses e)) 153 ;(format t "~&GATS ~A ~A ~A: pulses = ~A; barlength = ~A.~%" (dataset-id e) (composition-id e) (event-id e) (%mtp-pulses e) (%mtp-barlength e))
154 (barlength (%mtp-barlength e)) 154 (let* ((pulses (%mtp-pulses e))
155 (timebase (* 4 (duration (crotchet e))))) 155 (barlength (%mtp-barlength e))
156 (list 156 (timebase (* 4 (duration (crotchet e))))
157 (amuse:make-standard-time-signature-period pulses 157 (numerator (if (null pulses) 0 pulses))
158 (/ timebase (/ barlength pulses)) 158 (denominator (if (null barlength)
159 1
160 (/ timebase (/ barlength pulses)))))
161 (list
162 (amuse:make-standard-time-signature-period numerator
163 denominator
159 (timepoint e) 164 (timepoint e)
160 (duration e))))) 165 (duration e)))))
161 166
162 (defmethod time-signatures ((c mtp-composition)) 167 (defmethod time-signatures ((c mtp-composition))
163 (let ((results nil) 168 (let ((results nil)