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