Mercurial > hg > amuse
comparison implementations/mtp/methods.lisp @ 292:80c227c1c0da
The MTP implementation of AMUSE:MONODY now uses the voice of the first event in the piece.
darcs-hash:20090723085710-c0ce4-0324442e9897c7a903fa20cfd16d18f880718439.gz
author | Marcus Pearce <m.pearce@gold.ac.uk> |
---|---|
date | Thu, 23 Jul 2009 09:57:10 +0100 |
parents | 2d2bc910c364 |
children | 2284dbc7d51a 984e0b4dfaab 5271a0aa06d6 |
comparison
equal
deleted
inserted
replaced
291:2d2bc910c364 | 292:80c227c1c0da |
---|---|
105 | 105 |
106 (defmethod monody ((identifier mtp-composition-identifier)) | 106 (defmethod monody ((identifier mtp-composition-identifier)) |
107 (monody (get-composition identifier))) | 107 (monody (get-composition identifier))) |
108 | 108 |
109 (defmethod monody ((c mtp-composition)) | 109 (defmethod monody ((c mtp-composition)) |
110 ;; using the voice of the first event in the piece | |
110 (let ((monody (make-instance 'mtp-monody | 111 (let ((monody (make-instance 'mtp-monody |
111 :dataset-id (dataset-id c) | 112 :dataset-id (dataset-id c) |
112 :composition-id (composition-id c) | 113 :composition-id (composition-id c) |
113 :description (description c) | 114 :description (description c) |
114 :time 0 | 115 :time 0 |
115 :interval (duration c))) | 116 :interval (duration c))) |
116 (events nil) | 117 (events nil) |
117 (monody-voice 1)) | 118 (monody-voice nil)) |
118 (sequence:dosequence (event c) | 119 (sequence:dosequence (event c) |
120 (when (null monody-voice) | |
121 (setf monody-voice (%mtp-voice event))) | |
119 (when (= (%mtp-voice event) monody-voice) | 122 (when (= (%mtp-voice event) monody-voice) |
120 (push event events))) | 123 (push event events))) |
121 (sequence:adjust-sequence | 124 (sequence:adjust-sequence |
122 monody (length events) | 125 monody (length events) |
123 :initial-contents (sort events #'< :key #'amuse:timepoint)) | 126 :initial-contents (sort events #'< :key #'amuse:timepoint)) |