annotate constructors.lisp @ 18:70e76c1c87b7

Bug fixes and exports in package.lisp darcs-hash:20061213114049-f76cc-4c4175a1ad8b24e1c5df82c9fb67445ac32977d9.gz
author David Lewis <d.lewis@gold.ac.uk>
date Wed, 13 Dec 2006 11:40:49 +0000
parents 930e9880ed3f
children 2f331bbdfab8
rev   line source
d@17 1 (cl:in-package #:amuse)
d@17 2
d@17 3 ;; Time classes
d@17 4
d@17 5 (defun make-moment (time)
d@17 6 (make-instance 'moment :time time))
d@17 7
d@17 8 ;; N.B. period should never be constructed directly - it's either
d@17 9 ;; floating or anchored or some other subclass.
d@17 10
d@17 11 (defun make-floating-period (interval)
d@17 12 (make-instance 'floating-period :interval interval))
d@17 13
d@17 14 (defun make-anchored-period (onset interval)
d@17 15 (make-instance 'anchored-period
d@17 16 :time onset
d@17 17 :interval interval))
d@17 18
d@17 19 ;; Pitch classes (no, not that sort of pitch class)
d@17 20
d@17 21 (defun make-chromatic-pitch (pitch-number)
d@17 22 (make-instance 'chromatic-pitch :number pitch-number))
d@17 23
d@17 24 (defun make-diatonic-pitch (name accidental octave)
d@17 25 (make-instance 'diatonic-pitch
d@17 26 :name name
d@17 27 :accidental accidental
d@17 28 :octave octave))
d@17 29
d@17 30 (defun make-pitch-interval (span)
d@17 31 (make-instance 'pitch-interval :span span))
d@17 32
d@18 33 ;; Events
d@18 34
d@18 35 (defun make-midi-pitched-event (pitch-number onset duration)
d@18 36 (make-instance 'midi-pitched-event
d@18 37 :number pitch-number
d@18 38 :time onset
d@18 39 :interval duration))