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