Mercurial > hg > amuse
changeset 273:df2505dc6d11
handle null time value in converting mtp-event to amuse-event.
author | Marcus Pearce <m.pearce@gold.ac.uk> |
---|---|
date | Wed, 06 Apr 2011 18:30:23 +0100 |
parents | d5ace22748df |
children | 7e2d0b5a5e35 |
files | implementations/mtp/methods.lisp |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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))