annotate implementations/meredith/constructors.lisp @ 296:68aadc4eb96d

add chromatic-pitch reader method Ignore-this: 1aba35b7d196e0994a817609337746e1 darcs-hash:20090828145217-16a00-312e63170f50f0bf2834b8959a72e5c857cba9b8.gz
author j.forth <j.forth@gold.ac.uk>
date Fri, 28 Aug 2009 15:52:17 +0100
parents d22c67dac97d
children 6f0881af3403
rev   line source
j@286 1 (cl:in-package #:amuse-meredith)
j@286 2
j@286 3 (defun make-meredith-composition-identifier (composition-id)
j@286 4 (make-instance 'meredith-composition-identifier
j@286 5 :composition-id composition-id))
j@286 6
j@286 7 (defun make-meredith-composition (&key events time interval
j@286 8 identifier description)
j@286 9 (make-instance 'meredith-composition
j@286 10 :%data events
j@286 11 :time time
j@286 12 :interval interval
j@286 13 :identifier identifier
j@286 14 :description description))
j@286 15
j@286 16 (defun make-meredith-event (&rest args)
j@286 17 (apply #'make-instance 'meredith-event args))
j@286 18
j@286 19 (defun db-event->meredith-event (db-event)
j@286 20 (destructuring-bind (event-id tatum-on tatum-dur tactus-on
j@286 21 tactus-dur crot-on crot-dur
j@286 22 tatum-on-ms tatum-dur-ms beat-on-ms
j@286 23 beat-dur-ms crot-on-ms crot-dur-ms
j@286 24 pitch-name midi-note-number cpitch
j@286 25 mpitch voice) db-event
j@286 26 (make-meredith-event :identifier event-id
j@286 27 :tatum-on tatum-on
j@286 28 :tatum-dur tatum-dur
j@286 29 :tactus-on tactus-on
j@286 30 :tactus-dur tactus-dur
j@286 31 :time crot-on ; define crotchet as standard time
j@286 32 :interval crot-dur
j@286 33 :tatum-on-ms tatum-on-ms
j@286 34 :tatum-dur-ms tatum-dur-ms
j@286 35 :beat-on-ms beat-on-ms
j@286 36 :beat-dur-ms beat-dur-ms
j@286 37 :crot-on-ms crot-on-ms
j@286 38 :crot-dur-ms crot-dur-ms
j@286 39 :pitch-name pitch-name
j@286 40 :number midi-note-number
j@286 41 :cp cpitch
j@286 42 :mp mpitch
j@286 43 :voice voice)))