[CM] import, typos, midi example links

rm@fabula.de rm@fabula.de
Wed, 8 Jan 2003 21:19:47 +0100


On Wed, Jan 08, 2003 at 12:22:30PM -0600, Rick Taube wrote:
> Ive made a new tar of 2.4.0 with bug fixes and the import-events function added back for midi (ill do csound and clm when i get a chance). to import data without meta events do:
> 
> 	(import-events "foo.midi" :meta-exclude true)
> 
> i tested in guile and cmu and importing works but i havent tried a level 1 file yet...
> 
> ftp://ftp-ccrma.stanford.edu/pub/Lisp/cm/sources/cm-2.4.0.tar.gz
> 

Oh, sorry, i forgot to report one little bug/feature that has been  bugging me
for quite some time now: the intial load of cm for guile (the one that's supposed
to create the final script) odesn't work when guile is given a relative path:
|  
|  bash-2.05b$ guile -l src/cm.scm
|  ...
|  
|  ; Loading: ssrc/scales.scm
|  ; Loading: ssrc/patterns.scm
|  ; Help! Can't copy "ssrc/cminit.lisp" -> "sbin/cminit.lisp".Backtrace:
|  In unknown file:
|     ?: 0* [primitive-load "src/cm.scm"]
|     
|

The porblem is in file src/cm.scm, line 17:

 (set! cm-directory (substring curfile 0 (1+ parent-slash)))

which ends up in a call to (set! cm-directory (substring curfile 0 1))
for relative filenames ....
I've modified the code to use guile's 'dirname' and a more schemish way of proccessing
the files, the relevant bit is here (i modified quite a bit more, so this is only
a "backported" sample):

;; .....

(let ((srcdir (dirname (port-filename (current-load-port)))))
    ;; fix relative path
    (if (not (char=? (string-ref srcdir 0) #\/))
        (set! cm-directory (string-append (getcwd) "/" srcdir))
        (set! cm-directory srcdir))

;; .....

BTW, what's the reason for not making the '*.scm' files into true Guile
modules. This would really ease loading. 
Another (not too serious) problem i encountered (but wasn't yet able to hunt down):
reloading of some of the startup files (io.scm i think) makes guile segfault.

> [...]
> 
> by the way does anybody know how to get a browser to play the midi file witout going to a blank page? if so, please tell me! right now my quicktime plugin plays in a new blank page and so i have to hit "back" each time, this is very annoying!....
> 

What browser do you use? It works fine on my box (Mozilla/5.0 (X11; U; 
Linux i586; en-US; rv:1.0.0) Gecko/20020615 Debian/1.0.0-3)

Thanks for all that great work

 Ralf Mattes
> 
> 
> _______________________________________________
> Cmdist mailing list
> Cmdist@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist