annotate constructors.lisp @ 17:930e9880ed3f
Pitch methods and added constructors.lisp file
darcs-hash:20061212144422-f76cc-194cd746d5d7eaf40f24ca5788093b25066de77c.gz
author |
David Lewis <d.lewis@gold.ac.uk> |
date |
Tue, 12 Dec 2006 14:44:22 +0000 |
parents |
|
children |
70e76c1c87b7 |
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
|