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
|
m@24
|
15 (defclass moment-designator () ())
|
m@24
|
16 (defclass period-designator () ())
|
m@24
|
17 (defclass anchored-period-designator (moment-designator period-designator) ())
|
m@24
|
18 (defclass pitch-designator () ())
|
m@24
|
19 (defclass pitch-interval-designator () ())
|
m@24
|
20
|
m@24
|
21 ;; time-related classes
|
m@24
|
22
|
m@24
|
23 (defclass moment (moment-designator)
|
m@24
|
24 ((time :accessor %moment-time :initarg :time)))
|
m@24
|
25
|
m@24
|
26 (defclass period (period-designator)
|
m@24
|
27 ((interval :accessor %period-interval :initarg :interval)))
|
m@24
|
28
|
m@24
|
29 (defclass floating-period (period) ())
|
m@24
|
30 (defclass anchored-period (period moment anchored-period-designator) ())
|
m@24
|
31
|
m@24
|
32 ;; pitch-related classes
|
m@24
|
33
|
m@24
|
34 (defclass frequency () ())
|
m@24
|
35
|
m@24
|
36 (defclass pitch (pitch-designator) ())
|
m@24
|
37 (defclass chromatic-pitch (pitch)
|
m@24
|
38 ((number :accessor %chromatic-pitch-number :initarg :number)))
|
m@24
|
39 (defclass diatonic-pitch (pitch)
|
m@24
|
40 ((name :accessor %diatonic-pitch-name :initarg :name)
|
m@24
|
41 (accidental :accessor %diatonic-pitch-accidental :initarg :accidental)
|
m@24
|
42 (octave :accessor %diatonic-pitch-octave :initarg :octave)))
|
m@24
|
43
|
m@24
|
44 (defclass pitch-interval (pitch-interval-designator)
|
m@24
|
45 ((span :accessor %pitch-interval-span :initarg :span)))
|
m@24
|
46
|
m@24
|
47 ;; events
|
m@24
|
48
|
m@24
|
49 (defclass event (anchored-period) ())
|
m@24
|
50 (defclass pitched-event (event pitch-designator) ())
|
m@24
|
51 (defclass chromatic-pitched-event (pitched-event chromatic-pitch) ())
|
m@24
|
52 (defclass percussive-event (event) ())
|
m@24
|
53
|
m@24
|
54 ;;; Range-based `constituents'
|
m@24
|
55 ;; Whilst these are all constituents in the CHARM sense, their
|
m@24
|
56 ;; properties apply to a timed range rather than to a set of
|
m@24
|
57 ;; events. As such, they can be regarded as anchored-periods with
|
m@24
|
58 ;; properties.
|
m@24
|
59
|
m@24
|
60 (defclass time-signature (anchored-period) ())
|
m@24
|
61
|
m@24
|
62 (defclass basic-time-signature (anchored-period)
|
m@24
|
63 ;; N.B. Can only deal with numeric signatures
|
m@24
|
64 ((numerator :accessor %basic-time-signature-numerator
|
m@24
|
65 :initarg :numerator)
|
m@24
|
66 (denominator :accessor %basic-time-signature-denominator
|
m@24
|
67 :initarg :denominator)))
|
m@24
|
68
|
m@24
|
69 (defclass key-signature (anchored-period) ())
|
m@24
|
70
|
m@24
|
71 (defclass basic-key-signature (key-signature)
|
m@24
|
72 ;; Only has line-of-fifths distance from c, so custom signatures
|
m@24
|
73 ;; won't work
|
m@24
|
74 ((sharp-count :accessor %basic-key-signature-sharp-count
|
m@24
|
75 :initarg sharp-count)))
|
m@24
|
76
|
m@24
|
77 (defclass tempo (anchored-period)
|
m@24
|
78 ;; accel and rit in symbolic encoding will need other structures, as
|
m@24
|
79 ;; will textual tempo markings.
|
m@24
|
80 ((bpm :accessor %tempo-bpm
|
m@24
|
81 :initarg :bpm)))
|
m@24
|
82 |