annotate implementations/meredith/constructors.lisp @ 330:2fbff655ba47 tip

Removed cpitch-adj and cents SQL columns
author Jeremy Gow <jeremy.gow@gmail.com>
date Mon, 21 Jan 2013 11:08:11 +0000
parents f5734df598f4
children
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@299 19 (defun db-event->meredith-event (db-event composition)
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@299 27 :composition composition
j@286 28 :tatum-on tatum-on
j@286 29 :tatum-dur tatum-dur
j@286 30 :tactus-on tactus-on
j@286 31 :tactus-dur tactus-dur
j@286 32 :time crot-on ; define crotchet as standard time
j@286 33 :interval crot-dur
j@286 34 :tatum-on-ms tatum-on-ms
j@286 35 :tatum-dur-ms tatum-dur-ms
j@286 36 :beat-on-ms beat-on-ms
j@286 37 :beat-dur-ms beat-dur-ms
j@286 38 :crot-on-ms crot-on-ms
j@286 39 :crot-dur-ms crot-dur-ms
j@286 40 :pitch-name pitch-name
j@286 41 :number midi-note-number
j@286 42 :cp cpitch
j@286 43 :mp mpitch
j@286 44 :voice voice)))