Mercurial > hg > amuse
comparison base/methods.lisp @ 67:8b31d54c95be
base/: {TIME-SIGNATURE,KEY-SIGNATURE,TEMPO}-EQUAL moved here from implementations/mtp/
darcs-hash:20070706093228-c0ce4-9ca0951f98303474fb5da95fc20ebdb2c3fa4db0.gz
author | Marcus Pearce <m.pearce@gold.ac.uk> |
---|---|
date | Fri, 06 Jul 2007 10:32:28 +0100 |
parents | 0f31919a855d |
children | c9b0739d8dd6 |
comparison
equal
deleted
inserted
replaced
66:6c8fd815603e | 67:8b31d54c95be |
---|---|
28 (%basic-time-signature-numerator time-signature)) | 28 (%basic-time-signature-numerator time-signature)) |
29 | 29 |
30 (defmethod beat-units ((time-signature basic-time-signature)) | 30 (defmethod beat-units ((time-signature basic-time-signature)) |
31 (%basic-time-signature-denominator time-signature)) | 31 (%basic-time-signature-denominator time-signature)) |
32 | 32 |
33 (defmethod time-signature-equal ((ts1 basic-time-signature) | |
34 (ts2 basic-time-signature)) | |
35 (let ((n1 (time-signature-numerator ts1)) | |
36 (n2 (time-signature-numerator ts2)) | |
37 (d1 (time-signature-denominator ts1)) | |
38 (d2 (time-signature-denominator ts2))) | |
39 (and n1 n2 (= n1 n2) | |
40 d1 d2 (= d1 d2)))) | |
41 | |
33 (defmethod key-signature-sharps ((key-signature basic-key-signature)) | 42 (defmethod key-signature-sharps ((key-signature basic-key-signature)) |
34 (%basic-key-signature-sharp-count key-signature)) | 43 (%basic-key-signature-sharp-count key-signature)) |
35 | 44 |
36 (defmethod key-signature-mode ((ks midi-key-signature)) | 45 (defmethod key-signature-mode ((ks midi-key-signature)) |
37 (%midi-key-signature-mode ks)) | 46 (%midi-key-signature-mode ks)) |
38 | 47 |
48 (defmethod key-signature-equal ((ks1 basic-key-signature) | |
49 (ks2 basic-key-signature)) | |
50 (let ((s1 (key-signature-sharps ks1)) | |
51 (s2 (key-signature-sharps ks2))) | |
52 (and s1 s2 (= s1 s2)))) | |
53 | |
54 (defmethod key-signature-equal ((ks1 midi-key-signature) | |
55 (ks2 midi-key-signature)) | |
56 (let ((s1 (key-signature-sharps ks1)) | |
57 (s2 (key-signature-sharps ks2)) | |
58 (m1 (key-signature-mode ks1)) | |
59 (m2 (key-signature-mode ks2))) | |
60 (and s1 s2 (= s1 s2) | |
61 m1 m2 (= m1 m2)))) | |
62 | |
39 (defmethod bpm ((tempo tempo)) | 63 (defmethod bpm ((tempo tempo)) |
40 (%tempo-bpm tempo)) | 64 (%tempo-bpm tempo)) |
65 | |
66 (defmethod tempo-equal ((t1 tempo) (t2 tempo)) | |
67 (and (bpm t1) (bpm t2) (= t1 t2))) | |
68 | |
41 | 69 |
42 ;; Time protocol | 70 ;; Time protocol |
43 | 71 |
44 (defmethod time+ ((object1 moment) (object2 period)) | 72 (defmethod time+ ((object1 moment) (object2 period)) |
45 (make-moment (+ (timepoint object1) (duration object2)))) | 73 (make-moment (+ (timepoint object1) (duration object2)))) |