[CM] ACL/win trick?

Kenny Tilton ktilton@nyc.rr.com
Wed, 05 Nov 2003 19:43:52 -0500


I am playing with one of the drum.ins instruments I found on the CCRMA 
site, so I had a problem with ACL under windows: once a DLL was loaded 
it was apparently held open or something, so a subsequent compile of the 
(definstrument...) (or compile-file of the same .ins) would fail on 
"unable to write file" or something. After that, using the instrument 
complained about the function no longer being loaded. Anyway, here's the 
fix I use:

(defun unload-instrument (ins-name)
  (dolist (dll (ff:list-all-foreign-libraries))
    (when (search (symbol-name ins-name) (pathname-name dll))
      (print `(Unloading foreign library ,dll))
      (ff:unload-foreign-library dll))))

Then: (unload-instrument 'djembe)
where the finstrument name was actually fm-djembe (SEARCH looks for 
subsequences)

Big warning: since the unloading goes by matching any substring, if I 
had three or four (the way developers often do) I'd zap them all with 
the above. So if I do start doing djembesoft and djembezzz and 
djembe123, I need to "unload" with enough of the name to nail the one I 
am after.

fwiw, kt

-- 
http://tilton-technology.com

Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film 

Your Project Here! http://alu.cliki.net/Industry%20Application