j@251: (cl:in-package #:amuse-datasets) j@251: j@251: (defmethod make-dataset ((identifier midifile-dataset-identifier) j@251: composition-identifiers &optional j@251: description) j@251: (make-instance 'midifile-dataset j@251: :%data composition-identifiers j@251: :identifier identifier j@251: :description description)) j@251: j@251: (defmethod get-dataset ((dataset-identifier midifile-dataset-identifier)) j@251: (let ((midifile-paths j@251: (append (directory (merge-pathnames (dataset-path j@251: dataset-identifier) "*.mid*")) j@251: (directory (merge-pathnames (dataset-path j@251: dataset-identifier) "*.MID*"))))) j@251: (unless midifile-paths j@251: (warn "No midifiles in: ~A" (dataset-path dataset-identifier)) j@251: (return-from get-dataset nil)) j@251: (loop for path in midifile-paths j@251: collect (make-composition-identifier j@251: (implementation-package dataset-identifier) path) j@251: into composition-identifiers j@251: finally (return (make-dataset dataset-identifier j@251: composition-identifiers))))) j@251: j@251: