Mercurial > hg > amuse
view implementations/meredith/constructors.lisp @ 288:d1e5bbcc5ea4
Rationalise base and geerdes classes, constructors and methods.
Ignore-this: d9d4d88566a6d110844d91d4c70513cd
Towards a more standardised interface. Some of these changes (generalised
constructors and reader functions) are necessary for amuse-database-admin
functionality and some other CHARM-like things.
darcs-hash:20090716154406-16a00-8a9b4fb1fc1f5ba75af66a1bbd87e1bb68e02493.gz
author | j.forth <j.forth@gold.ac.uk> |
---|---|
date | Thu, 16 Jul 2009 16:44:06 +0100 |
parents | d22c67dac97d |
children | 6f0881af3403 |
line wrap: on
line source
(cl:in-package #:amuse-meredith) (defun make-meredith-composition-identifier (composition-id) (make-instance 'meredith-composition-identifier :composition-id composition-id)) (defun make-meredith-composition (&key events time interval identifier description) (make-instance 'meredith-composition :%data events :time time :interval interval :identifier identifier :description description)) (defun make-meredith-event (&rest args) (apply #'make-instance 'meredith-event args)) (defun db-event->meredith-event (db-event) (destructuring-bind (event-id tatum-on tatum-dur tactus-on tactus-dur crot-on crot-dur tatum-on-ms tatum-dur-ms beat-on-ms beat-dur-ms crot-on-ms crot-dur-ms pitch-name midi-note-number cpitch mpitch voice) db-event (make-meredith-event :identifier event-id :tatum-on tatum-on :tatum-dur tatum-dur :tactus-on tactus-on :tactus-dur tactus-dur :time crot-on ; define crotchet as standard time :interval crot-dur :tatum-on-ms tatum-on-ms :tatum-dur-ms tatum-dur-ms :beat-on-ms beat-on-ms :beat-dur-ms beat-dur-ms :crot-on-ms crot-on-ms :crot-dur-ms crot-dur-ms :pitch-name pitch-name :number midi-note-number :cp cpitch :mp mpitch :voice voice)))