annotate base/constructors.lisp @ 24:8d2b1662f658

base/*.lisp: move files in amuse-base to subdirectory. darcs-hash:20061215161617-aa3d6-1b63bd555b02ec02aa2db12d335e8b726e2108cd.gz
author m.pearce <m.pearce@gold.ac.uk>
date Fri, 15 Dec 2006 16:16:17 +0000
parents
children d1010755f507
rev   line source
m@24 1 (cl:in-package #:amuse)
m@24 2
m@24 3 ;; Time classes
m@24 4
m@24 5 (defun make-moment (time)
m@24 6 (make-instance 'moment :time time))
m@24 7
m@24 8 ;; N.B. period should never be constructed directly - it's either
m@24 9 ;; floating or anchored or some other subclass.
m@24 10
m@24 11 (defun make-floating-period (interval)
m@24 12 (make-instance 'floating-period :interval interval))
m@24 13
m@24 14 (defun make-anchored-period (onset interval)
m@24 15 (make-instance 'anchored-period
m@24 16 :time onset
m@24 17 :interval interval))
m@24 18
m@24 19 ;; Pitch classes (no, not that sort of pitch class)
m@24 20
m@24 21 (defun make-chromatic-pitch (pitch-number)
m@24 22 (make-instance 'chromatic-pitch :number pitch-number))
m@24 23
m@24 24 (defun make-diatonic-pitch (name accidental octave)
m@24 25 (make-instance 'diatonic-pitch
m@24 26 :name name
m@24 27 :accidental accidental
m@24 28 :octave octave))
m@24 29
m@24 30 (defun make-pitch-interval (span)
m@24 31 (make-instance 'pitch-interval :span span))
m@24 32
m@24 33 ;; Events
m@24 34
m@24 35 (defun make-chromatic-pitched-event (pitch-number onset duration)
m@24 36 (make-instance 'chromatic-pitched-event
m@24 37 :number pitch-number
m@24 38 :time onset
m@24 39 :interval duration))
m@24 40
m@24 41 (defun make-basic-time-signature (numerator denominator onset duration)
m@24 42 (make-instance 'basic-time-signature
m@24 43 :numerator numerator
m@24 44 :denominator denominator
m@24 45 :time onset
m@24 46 :interval duration))
m@24 47
m@24 48 (defun make-basic-key-signature (sharp-count onset duration)
m@24 49 (make-instance 'basic-key-signature
m@24 50 :sharp-count sharp-count
m@24 51 :time onset
m@24 52 :interval duration))
m@24 53
m@24 54 (defun make-tempo (bpm onset duration)
m@24 55 (make-instance 'tempo
m@24 56 :bpm bpm
m@24 57 :time onset
m@24 58 :interval duration))