j@215: (cl:in-package #:amuse-meredith) j@215: j@215: (defun make-meredith-composition-identifier (composition-id) j@215: (make-instance 'meredith-composition-identifier j@215: :composition-id composition-id)) j@215: j@215: (defun make-meredith-composition (&key events time interval j@215: identifier description) j@215: (make-instance 'meredith-composition j@215: :%data events j@215: :time time j@215: :interval interval j@215: :identifier identifier j@215: :description description)) j@215: j@215: (defun make-meredith-event (&rest args) j@215: (apply #'make-instance 'meredith-event args)) j@215: j@225: (defun db-event->meredith-event (db-event composition) j@215: (destructuring-bind (event-id tatum-on tatum-dur tactus-on j@215: tactus-dur crot-on crot-dur j@215: tatum-on-ms tatum-dur-ms beat-on-ms j@215: beat-dur-ms crot-on-ms crot-dur-ms j@215: pitch-name midi-note-number cpitch j@215: mpitch voice) db-event j@215: (make-meredith-event :identifier event-id j@225: :composition composition j@215: :tatum-on tatum-on j@215: :tatum-dur tatum-dur j@215: :tactus-on tactus-on j@215: :tactus-dur tactus-dur j@215: :time crot-on ; define crotchet as standard time j@215: :interval crot-dur j@215: :tatum-on-ms tatum-on-ms j@215: :tatum-dur-ms tatum-dur-ms j@215: :beat-on-ms beat-on-ms j@215: :beat-dur-ms beat-dur-ms j@215: :crot-on-ms crot-on-ms j@215: :crot-dur-ms crot-dur-ms j@215: :pitch-name pitch-name j@215: :number midi-note-number j@215: :cp cpitch j@215: :mp mpitch j@215: :voice voice)))