Mercurial > hg > amuse
comparison methods.lisp @ 22:99ccd775245a
Moved midi out of main files
darcs-hash:20061214125711-f76cc-c9e7f9af1054c67473ff6d8a8e3b84e45fe43f35.gz
author | David Lewis <d.lewis@gold.ac.uk> |
---|---|
date | Thu, 14 Dec 2006 12:57:11 +0000 |
parents | 6eb54ad3b8b4 |
children |
comparison
equal
deleted
inserted
replaced
21:c389ba869ef9 | 22:99ccd775245a |
---|---|
1 (cl:in-package #:amuse) | 1 (cl:in-package #:amuse) |
2 | 2 |
3 (defmethod chromatic-pitch ((pitch-designator chromatic-pitch)) | 3 (defmethod chromatic-pitch ((pitch-designator chromatic-pitch)) |
4 pitch-designator) | 4 pitch-designator) |
5 | 5 |
6 (defmethod chromatic-pitch-number ((pitch-designator chromatic-pitch)) | 6 (defmethod midi-pitch-number ((pitch-designator chromatic-pitch)) |
7 (%chromatic-pitch-number pitch-designator)) | 7 (%chromatic-pitch-number pitch-designator)) |
8 | 8 |
9 (defmethod chromatic-pitch-number ((pitch-designator pitch)) | 9 (defmethod midi-pitch-number ((pitch-designator pitch)) |
10 (%chromatic-pitch-number (chromatic-pitch pitch-designator))) | 10 (%chromatic-pitch-number (chromatic-pitch pitch-designator))) |
11 | 11 |
12 (defmethod span ((pitch-interval-designator pitch-interval)) | 12 (defmethod span ((pitch-interval-designator pitch-interval)) |
13 (%pitch-interval-span pitch-interval-designator)) | 13 (%pitch-interval-span pitch-interval-designator)) |
14 | 14 |
202 (cond | 202 (cond |
203 ((disjoint object1 object2) | 203 ((disjoint object1 object2) |
204 ;; if they don't overlap, return nil, not a negative-valued | 204 ;; if they don't overlap, return nil, not a negative-valued |
205 ;; period | 205 ;; period |
206 nil) | 206 nil) |
207 (t | 207 ((let* ((start (if (time> (onset object2) (onset object1)) |
208 (let ((new-onset (max (timepoint object1) | 208 (onset object2) |
209 (timepoint object2)))) | 209 (onset object1))) |
210 (make-anchored-period new-onset | 210 (duration (duration (time- (if (time> (cut-off object2) (cut-off object1)) |
211 (time- (min (cut-off object1) | 211 (cut-off object1) |
212 (cut-off object2)) | 212 (cut-off object2)) |
213 new-onset)))))) | 213 start)))) |
214 (make-anchored-period (timepoint start) duration))))) | |
215 | |
214 | 216 |
215 | 217 |
216 | 218 |