comparison implementations/mtp/methods.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 ea542c06c364
children a45da9b93b37
comparison
equal deleted inserted replaced
135:188fe5ea837f 136:fd85f52d9f9d
123 monody)) 123 monody))
124 124
125 ;;; Constituents from compositions: time-signatures 125 ;;; Constituents from compositions: time-signatures
126 126
127 (defmethod crotchet ((dataset mtp-dataset)) 127 (defmethod crotchet ((dataset mtp-dataset))
128 (amuse:make-floating-period 128 (amuse:make-standard-period
129 (/ (dataset-timebase dataset) 4))) 129 (/ (dataset-timebase dataset) 4)))
130 130
131 #.(clsql:locally-enable-sql-reader-syntax) 131 #.(clsql:locally-enable-sql-reader-syntax)
132 (defmethod crotchet ((composition mtp-composition)) 132 (defmethod crotchet ((composition mtp-composition))
133 (let ((timebase 133 (let ((timebase
134 (car (clsql:select [timebase] :from [mtp-dataset] 134 (car (clsql:select [timebase] :from [mtp-dataset]
135 :where [= [dataset-id] 135 :where [= [dataset-id]
136 (dataset-id composition)] 136 (dataset-id composition)]
137 :flatp t 137 :flatp t
138 :field-names nil)))) 138 :field-names nil))))
139 (amuse:make-floating-period (/ timebase 4)))) 139 (amuse:make-standard-period (/ timebase 4))))
140 (defmethod crotchet ((event mtp-event)) 140 (defmethod crotchet ((event mtp-event))
141 (let ((timebase 141 (let ((timebase
142 (car (clsql:select [timebase] :from [mtp-dataset] 142 (car (clsql:select [timebase] :from [mtp-dataset]
143 :where [= [dataset-id] 143 :where [= [dataset-id]
144 (dataset-id event)] 144 (dataset-id event)]
145 :flatp t 145 :flatp t
146 :field-names nil)))) 146 :field-names nil))))
147 (amuse:make-floating-period (/ timebase 4)))) 147 (amuse:make-standard-period (/ timebase 4))))
148 #.(clsql:restore-sql-reader-syntax-state) 148 #.(clsql:restore-sql-reader-syntax-state)
149 149
150 (defmethod get-applicable-time-signatures ((e mtp-event) c) 150 (defmethod get-applicable-time-signatures ((e mtp-event) c)
151 (declare (ignore c)) 151 (declare (ignore c))
152 (let ((pulses (%mtp-pulses e)) 152 (let ((pulses (%mtp-pulses e))
153 (barlength (%mtp-barlength e)) 153 (barlength (%mtp-barlength e))
154 (timebase (* 4 (duration (crotchet e))))) 154 (timebase (* 4 (duration (crotchet e)))))
155 (list 155 (list
156 (amuse:make-basic-time-signature pulses 156 (amuse:make-standard-time-signature-period pulses
157 (/ timebase (/ barlength pulses)) 157 (/ timebase (/ barlength pulses))
158 (timepoint e) 158 (timepoint e)
159 (duration e))))) 159 (duration e)))))
160 160
161 (defmethod time-signatures ((c mtp-composition)) 161 (defmethod time-signatures ((c mtp-composition))
162 (let ((results nil) 162 (let ((results nil)
163 (interval 0) 163 (interval 0)
164 (current nil)) 164 (current nil))
185 (defmethod get-applicable-key-signatures ((e mtp-event) c) 185 (defmethod get-applicable-key-signatures ((e mtp-event) c)
186 (declare (ignore c)) 186 (declare (ignore c))
187 (let* ((sharps (%mtp-keysig e)) 187 (let* ((sharps (%mtp-keysig e))
188 (mode (%mtp-mode e)) 188 (mode (%mtp-mode e))
189 (midi-mode (and mode (if (= mode 0) 0 1)))) 189 (midi-mode (and mode (if (= mode 0) 0 1))))
190 (list (amuse:make-midi-key-signature sharps midi-mode 190 (list (amuse:make-midi-key-signature-period sharps midi-mode
191 (timepoint e) 191 (timepoint e)
192 (duration e))))) 192 (duration e)))))
193 193
194 (defmethod key-signatures ((c mtp-composition)) 194 (defmethod key-signatures ((c mtp-composition))
195 (let ((results nil) 195 (let ((results nil)
196 (interval 0) 196 (interval 0)
197 (current nil)) 197 (current nil))
215 215
216 ;;; Constituents from compositions: tempi 216 ;;; Constituents from compositions: tempi
217 217
218 (defmethod get-applicable-tempi ((e mtp-event) c) 218 (defmethod get-applicable-tempi ((e mtp-event) c)
219 (declare (ignore c)) 219 (declare (ignore c))
220 (list (amuse:make-tempo (%mtp-tempo e) 220 (list (amuse:make-standard-tempo-period (%mtp-tempo e)
221 (timepoint e) 221 (timepoint e)
222 (duration e)))) 222 (duration e))))
223 223
224 (defmethod tempi ((c mtp-composition)) 224 (defmethod tempi ((c mtp-composition))
225 (let ((results nil) 225 (let ((results nil)
226 (interval 0) 226 (interval 0)
227 (current nil)) 227 (current nil))