m@24
|
1 (cl:in-package #:amuse)
|
m@24
|
2
|
m@24
|
3 ;; collections of more than one event
|
m@24
|
4
|
d@33
|
5 (defclass constituent (anchored-period) ())
|
d@33
|
6 (defclass time-ordered-constituent (constituent list-slot-sequence)
|
d@33
|
7 ;; this won't work if lisp implementation doesn't support extensible
|
d@33
|
8 ;; sequences.
|
d@33
|
9 ())
|
d@33
|
10 (defclass composition (time-ordered-constituent) ())
|
d@33
|
11 (defclass monody (time-ordered-constituent) ())
|
m@24
|
12
|
m@24
|
13 ;; types of information-specifiers
|
m@24
|
14
|
d@35
|
15 (defclass identifier () ()) ;; for composition specification
|
m@24
|
16 (defclass moment-designator () ())
|
m@24
|
17 (defclass period-designator () ())
|
m@24
|
18 (defclass anchored-period-designator (moment-designator period-designator) ())
|
m@24
|
19 (defclass pitch-designator () ())
|
m@24
|
20 (defclass pitch-interval-designator () ())
|
m@24
|
21
|
m@24
|
22 ;; time-related classes
|
m@24
|
23
|
m@24
|
24 (defclass moment (moment-designator)
|
m@24
|
25 ((time :accessor %moment-time :initarg :time)))
|
m@24
|
26
|
m@24
|
27 (defclass period (period-designator)
|
m@24
|
28 ((interval :accessor %period-interval :initarg :interval)))
|
m@24
|
29
|
m@24
|
30 (defclass floating-period (period) ())
|
m@24
|
31 (defclass anchored-period (period moment anchored-period-designator) ())
|
m@24
|
32
|
m@24
|
33 ;; pitch-related classes
|
m@24
|
34
|
m@24
|
35 (defclass frequency () ())
|
m@24
|
36
|
m@24
|
37 (defclass pitch (pitch-designator) ())
|
m@24
|
38 (defclass chromatic-pitch (pitch)
|
m@24
|
39 ((number :accessor %chromatic-pitch-number :initarg :number)))
|
m@24
|
40 (defclass diatonic-pitch (pitch)
|
m@24
|
41 ((name :accessor %diatonic-pitch-name :initarg :name)
|
m@24
|
42 (accidental :accessor %diatonic-pitch-accidental :initarg :accidental)
|
m@24
|
43 (octave :accessor %diatonic-pitch-octave :initarg :octave)))
|
m@24
|
44
|
m@24
|
45 (defclass pitch-interval (pitch-interval-designator)
|
m@24
|
46 ((span :accessor %pitch-interval-span :initarg :span)))
|
m@24
|
47
|
m@24
|
48 ;; events
|
m@24
|
49
|
m@24
|
50 (defclass event (anchored-period) ())
|
m@24
|
51 (defclass pitched-event (event pitch-designator) ())
|
m@24
|
52 (defclass chromatic-pitched-event (pitched-event chromatic-pitch) ())
|
m@24
|
53 (defclass percussive-event (event) ())
|
m@24
|
54
|
m@24
|
55 ;;; Range-based `constituents'
|
m@24
|
56 ;; Whilst these are all constituents in the CHARM sense, their
|
m@24
|
57 ;; properties apply to a timed range rather than to a set of
|
m@24
|
58 ;; events. As such, they can be regarded as anchored-periods with
|
m@24
|
59 ;; properties.
|
m@24
|
60
|
m@24
|
61 (defclass time-signature (anchored-period) ())
|
m@24
|
62
|
m@24
|
63 (defclass basic-time-signature (anchored-period)
|
m@24
|
64 ;; N.B. Can only deal with numeric signatures
|
m@24
|
65 ((numerator :accessor %basic-time-signature-numerator
|
m@24
|
66 :initarg :numerator)
|
m@24
|
67 (denominator :accessor %basic-time-signature-denominator
|
m@24
|
68 :initarg :denominator)))
|
m@24
|
69
|
m@24
|
70 (defclass key-signature (anchored-period) ())
|
m@24
|
71
|
m@24
|
72 (defclass basic-key-signature (key-signature)
|
m@24
|
73 ;; Only has line-of-fifths distance from c, so custom signatures
|
m@24
|
74 ;; won't work
|
m@24
|
75 ((sharp-count :accessor %basic-key-signature-sharp-count
|
m@24
|
76 :initarg sharp-count)))
|
m@24
|
77
|
m@24
|
78 (defclass tempo (anchored-period)
|
m@24
|
79 ;; accel and rit in symbolic encoding will need other structures, as
|
m@24
|
80 ;; will textual tempo markings.
|
m@24
|
81 ((bpm :accessor %tempo-bpm
|
m@24
|
82 :initarg :bpm)))
|
m@24
|
83 |