annotate base/constructors.lisp @ 102:59e69a32b8d9

More docstrings darcs-hash:20070726091550-f76cc-32dfc4cc3e4922d6801b3b2717e5c19f15a1ef92.gz
author David Lewis <d.lewis@gold.ac.uk>
date Thu, 26 Jul 2007 10:15:50 +0100
parents 4e1538df0d10
children 7f139c81752e
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
d@33 14
d@33 15 ;; Should this take a moment and/or a period too?
m@24 16 (defun make-anchored-period (onset interval)
m@24 17 (make-instance 'anchored-period
m@24 18 :time onset
m@24 19 :interval interval))
m@24 20
m@24 21 ;; Pitch classes (no, not that sort of pitch class)
m@24 22
m@24 23 (defun make-chromatic-pitch (pitch-number)
m@24 24 (make-instance 'chromatic-pitch :number pitch-number))
m@24 25
m@24 26 (defun make-diatonic-pitch (name accidental octave)
m@24 27 (make-instance 'diatonic-pitch
m@24 28 :name name
m@24 29 :accidental accidental
m@24 30 :octave octave))
m@24 31
m@81 32 (defun make-mips-pitch (cp mp)
m@81 33 (make-instance 'mips-pitch :cp cp :mp mp))
m@81 34
m@24 35 (defun make-pitch-interval (span)
m@24 36 (make-instance 'pitch-interval :span span))
m@24 37
m@24 38 ;; Events
m@24 39
m@24 40 (defun make-chromatic-pitched-event (pitch-number onset duration)
m@24 41 (make-instance 'chromatic-pitched-event
m@24 42 :number pitch-number
m@24 43 :time onset
m@24 44 :interval duration))
m@24 45
m@24 46 (defun make-basic-time-signature (numerator denominator onset duration)
m@24 47 (make-instance 'basic-time-signature
m@24 48 :numerator numerator
m@24 49 :denominator denominator
m@24 50 :time onset
m@24 51 :interval duration))
m@24 52
m@24 53 (defun make-basic-key-signature (sharp-count onset duration)
m@24 54 (make-instance 'basic-key-signature
m@24 55 :sharp-count sharp-count
m@24 56 :time onset
m@24 57 :interval duration))
m@24 58
m@40 59 (defun make-midi-key-signature (sharp-count mode onset duration)
m@40 60 (make-instance 'midi-key-signature
m@40 61 :sharp-count sharp-count
m@40 62 :mode mode
m@40 63 :time onset
m@40 64 :interval duration))
m@40 65
m@24 66 (defun make-tempo (bpm onset duration)
m@24 67 (make-instance 'tempo
m@24 68 :bpm bpm
m@24 69 :time onset
m@24 70 :interval duration))