comparison base/constructors.lisp @ 136:fd85f52d9f9d

Class revolution * PITCH-DESIGNATOR -> PITCH (PITCH removed) * MOMENT-DESIGNATOR -> MOMENT , MOMENT -> STANDARD-MOMENT * PERIOD-DESIGNATOR -> PERIOD , PERIOD -> STANDARD-PERIOD * ANCHORED-PERIOD-DESIGNATOR -> ANCHORED-PERIOD , ANCHORED-PERIOD -> STANDARD-ANCHORED-PERIOD * FLOATING-PERIOD removed * TIME-SIGNATURE-DESIGNATOR -> TIME-SIGNATURE & TIME-SIGNATURE-PERIOD * TIME-SIGNATURE -> STANDARD-TIME-SIGNATURE & STANDARD-TIME-SIGNATURE-PERIOD * KEY-SIGNATURE-DESIGNATOR -> KEY-SIGNATURE (& ...-PERIOD) * KEY-SIGNATURE -> STANDARD-KEY-SIGNATURE (& ...-PERIOD) * TEMPO now abstract (& TEMPO-PERIOD) * STANDARD-TEMPO AND STANDARD-TEMPO-PERIOD * COMPOSITION, CONSTITUENT & TIME-ORDERED-CONSTITUENT all have STANDARD- forms make-x methods and specialisers changes appropriately darcs-hash:20070831142943-f76cc-7be0d08963de06d87b36e4922076287d565c7ee2.gz
author David Lewis <d.lewis@gold.ac.uk>
date Fri, 31 Aug 2007 15:29:43 +0100
parents 5e362d998f29
children ee9dd7148eab
comparison
equal deleted inserted replaced
135:188fe5ea837f 136:fd85f52d9f9d
1 (cl:in-package #:amuse) 1 (cl:in-package #:amuse)
2 2
3 ;; Time classes 3 ;; Time classes
4 4
5 (defun make-moment (time) 5 (defun make-standard-moment (time)
6 "Returns a new moment, taking a number as input for the time 6 "Returns a new standard-moment, taking a number as input for
7 point." 7 the time point."
8 (make-instance 'moment :time time)) 8 (make-instance 'moment :time time))
9 9
10 ;; N.B. period should never be constructed directly - it's either 10 ;; N.B. period should never be constructed directly - it's either
11 ;; floating or anchored or some other subclass. 11 ;; floating or anchored or some other subclass.
12 12
13 (defun make-floating-period (interval) 13 (defun make-standard-period (interval)
14 "Returns a new floating-period, taking a number for the 14 "Returns a new (floating) period, taking a number for the
15 duration." 15 duration."
16 (make-instance 'floating-period :interval interval)) 16 (make-instance 'standard-period :interval interval))
17 17
18 18
19 ;; Should this take a moment and/or a period too? 19 ;; Should this take a moment and/or a period too?
20 (defun make-anchored-period (onset interval) 20 (defun make-standard-anchored-period (onset interval)
21 "Returns a new floating-period, taking numbers for onset and 21 "Returns a new floating-period, taking numbers for onset and
22 duration." 22 duration."
23 (make-instance 'anchored-period 23 (make-instance 'standard-anchored-period
24 :time onset 24 :time onset
25 :interval interval)) 25 :interval interval))
26 26
27 ;; Pitch classes (no, not that sort of pitch class) 27 ;; Pitch classes (no, not that sort of pitch class)
28 28
64 (make-instance 'chromatic-pitched-event 64 (make-instance 'chromatic-pitched-event
65 :number pitch-number 65 :number pitch-number
66 :time onset 66 :time onset
67 :interval duration)) 67 :interval duration))
68 68
69 (defun make-basic-time-signature (numerator denominator onset duration) 69 (defun make-standard-time-signature (numerator denominator)
70 (make-instance 'basic-time-signature 70 (make-instance 'standard-time-signature
71 :numerator numerator
72 :denominator denominator))
73
74 (defun make-standard-time-signature-period (numerator denominator onset duration)
75 (make-instance 'standard-time-signature-period
71 :numerator numerator 76 :numerator numerator
72 :denominator denominator 77 :denominator denominator
73 :time onset 78 :time onset
74 :interval duration)) 79 :interval duration))
75 80
76 (defun make-basic-key-signature (sharp-count onset duration) 81 (defun make-standard-key-signature (sharp-count)
77 (make-instance 'basic-key-signature 82 (make-instance 'standard-key-signature
83 :sharp-count sharp-count))
84
85 (defun make-standard-key-signature-period (sharp-count onset duration)
86 (make-instance 'standard-key-signature-period
78 :sharp-count sharp-count 87 :sharp-count sharp-count
79 :time onset 88 :time onset
80 :interval duration)) 89 :interval duration))
81 90
82 (defun make-midi-key-signature (sharp-count mode onset duration) 91 (defun make-midi-key-signature (sharp-count mode)
83 (make-instance 'midi-key-signature 92 (make-instance 'midi-key-signature
93 :sharp-count sharp-count
94 :mode mode))
95
96 (defun make-midi-key-signature-period (sharp-count mode onset duration)
97 (make-instance 'midi-key-signature-period
84 :sharp-count sharp-count 98 :sharp-count sharp-count
85 :mode mode 99 :mode mode
86 :time onset 100 :time onset
87 :interval duration)) 101 :interval duration))
88 102
89 (defun make-tempo (bpm onset duration) 103 (defun make-standard-tempo (bpm)
90 (make-instance 'tempo 104 (make-instance 'standard-tempo
91 :bpm bpm 105 :bpm bpm
92 :time onset 106 :time onset
93 :interval duration)) 107 :interval duration))
108
109 (defun make-standard-tempo-period (bpm onset duration)
110 (make-instance 'standard-tempo-period
111 :bpm bpm
112 :time onset
113 :interval duration))