comparison 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
comparison
equal deleted inserted replaced
23:e2e19baba730 24:8d2b1662f658
1 (cl:in-package #:amuse)
2
3 ;; Time classes
4
5 (defun make-moment (time)
6 (make-instance 'moment :time time))
7
8 ;; N.B. period should never be constructed directly - it's either
9 ;; floating or anchored or some other subclass.
10
11 (defun make-floating-period (interval)
12 (make-instance 'floating-period :interval interval))
13
14 (defun make-anchored-period (onset interval)
15 (make-instance 'anchored-period
16 :time onset
17 :interval interval))
18
19 ;; Pitch classes (no, not that sort of pitch class)
20
21 (defun make-chromatic-pitch (pitch-number)
22 (make-instance 'chromatic-pitch :number pitch-number))
23
24 (defun make-diatonic-pitch (name accidental octave)
25 (make-instance 'diatonic-pitch
26 :name name
27 :accidental accidental
28 :octave octave))
29
30 (defun make-pitch-interval (span)
31 (make-instance 'pitch-interval :span span))
32
33 ;; Events
34
35 (defun make-chromatic-pitched-event (pitch-number onset duration)
36 (make-instance 'chromatic-pitched-event
37 :number pitch-number
38 :time onset
39 :interval duration))
40
41 (defun make-basic-time-signature (numerator denominator onset duration)
42 (make-instance 'basic-time-signature
43 :numerator numerator
44 :denominator denominator
45 :time onset
46 :interval duration))
47
48 (defun make-basic-key-signature (sharp-count onset duration)
49 (make-instance 'basic-key-signature
50 :sharp-count sharp-count
51 :time onset
52 :interval duration))
53
54 (defun make-tempo (bpm onset duration)
55 (make-instance 'tempo
56 :bpm bpm
57 :time onset
58 :interval duration))