# HG changeset patch # User Marcus Pearce # Date 1302111023 -3600 # Node ID df2505dc6d1143c46336f2c83cb9873194c68295 # Parent d5ace22748dfb2ae6478760feb76c1633ffd79ad handle null time value in converting mtp-event to amuse-event. diff -r d5ace22748df -r df2505dc6d11 implementations/mtp/methods.lisp --- a/implementations/mtp/methods.lisp Thu Mar 24 15:54:27 2011 +0000 +++ b/implementations/mtp/methods.lisp Wed Apr 06 18:30:23 2011 +0100 @@ -112,12 +112,14 @@ (setf (slot-value mtp-event (car slts)) (convert-time-slot (car db-atts) timebase)) (setf (slot-value mtp-event (car slts)) (car db-atts)))))) - (defun convert-time-slot (value timebase) - "Convert native representation of time into a representation where +(defun convert-time-slot (value timebase) + "Convert native representation of time into a representation where a crotchet has a value of 96." - (let ((multiplier (/ 96 timebase))) - (* value multiplier))) - + (if (or (null value) (null timebase)) + nil + (let ((multiplier (/ 96 timebase))) + (* value multiplier)))) + ;;; Monodies (defmethod monody ((identifier mtp-composition-identifier))