j@236: (cl:in-package #:amuse-midi-db) j@236: j@236: (defun import-midifiles (path collection-identifier database) j@236: " should be a string or pathname object, which designates a j@236: directory containing midifiles to be imported, j@236: e.g. '/home/foo/my-midi-files/' (note trailing slash)." j@236: (let ((midifile-paths j@236: (append (directory (merge-pathnames path "*.mid*")) j@236: (directory (merge-pathnames path "*.MID*"))))) j@236: (unless midifile-paths j@236: (warn "No midifiles in: ~A" path) j@236: (return-from import-midifiles nil)) j@236: (loop for midifile-path in midifile-paths j@236: for i from 1 j@236: do (import-composition j@236: (get-composition j@236: (make-midifile-identifier midifile-path)) j@236: collection-identifier database) j@236: finally (format t "~S midifiles added to database.~%" i))))