annotate base/constructors.lisp @ 33:d1010755f507
Large upload of local changes. Many additions, such as harmony and piece-level objects
darcs-hash:20070413100909-f76cc-a8aa8dfc07f438dc0c1a7c45cee7ace2ecc1e6a5.gz
author |
David Lewis <d.lewis@gold.ac.uk> |
date |
Fri, 13 Apr 2007 11:09:09 +0100 |
parents |
8d2b1662f658 |
children |
5bec705db9d6 |
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@24
|
32 (defun make-pitch-interval (span)
|
m@24
|
33 (make-instance 'pitch-interval :span span))
|
m@24
|
34
|
m@24
|
35 ;; Events
|
m@24
|
36
|
m@24
|
37 (defun make-chromatic-pitched-event (pitch-number onset duration)
|
m@24
|
38 (make-instance 'chromatic-pitched-event
|
m@24
|
39 :number pitch-number
|
m@24
|
40 :time onset
|
m@24
|
41 :interval duration))
|
m@24
|
42
|
m@24
|
43 (defun make-basic-time-signature (numerator denominator onset duration)
|
m@24
|
44 (make-instance 'basic-time-signature
|
m@24
|
45 :numerator numerator
|
m@24
|
46 :denominator denominator
|
m@24
|
47 :time onset
|
m@24
|
48 :interval duration))
|
m@24
|
49
|
m@24
|
50 (defun make-basic-key-signature (sharp-count onset duration)
|
m@24
|
51 (make-instance 'basic-key-signature
|
m@24
|
52 :sharp-count sharp-count
|
m@24
|
53 :time onset
|
m@24
|
54 :interval duration))
|
m@24
|
55
|
m@24
|
56 (defun make-tempo (bpm onset duration)
|
m@24
|
57 (make-instance 'tempo
|
m@24
|
58 :bpm bpm
|
m@24
|
59 :time onset
|
m@24
|
60 :interval duration))
|