[gsharp-cvs] CVS gsharp

mjonsson mjonsson at common-lisp.net
Fri Jun 15 16:26:15 UTC 2007


Update of /project/gsharp/cvsroot/gsharp
In directory clnet:/tmp/cvs-serv27451

Modified Files:
	buffer.lisp play.lisp 
Log Message:
Changed test.mid to /tmp/test.mid in play.lisp, removed code duplication calculating durations of bars

--- /project/gsharp/cvsroot/gsharp/buffer.lisp	2007/06/06 13:16:02	1.44
+++ /project/gsharp/cvsroot/gsharp/buffer.lisp	2007/06/15 16:26:14	1.45
@@ -646,7 +646,7 @@
 ;;; kind of cache, in order to avoid looping over each 
 ;;; element and computing the duration of each one each time.
 (defmethod duration ((bar bar))
-  (reduce #'+ (mapcar #'duration (elements bar))))
+  (reduce #'+ (elements bar) :key #'duration))
 
 (defgeneric make-bar-for-staff (staff &rest args &key elements))
 
--- /project/gsharp/cvsroot/gsharp/play.lisp	2006/03/02 09:29:44	1.5
+++ /project/gsharp/cvsroot/gsharp/play.lisp	2007/06/15 16:26:14	1.6
@@ -14,9 +14,7 @@
 
 (defun measure-durations (slices)
   (let ((durations (mapcar (lambda (slice)
-			     (mapcar (lambda (bar)
-				       (reduce #'+ (elements bar)
-					       :key #'duration))
+			     (mapcar #'duration
 				     (bars slice)))
 			   slices)))
     (loop while durations
@@ -80,11 +78,11 @@
 		     :format 1
 		     :division 25
 		     :tracks tracks)))
-    (write-midi-file midifile "test.mid")
+    (write-midi-file midifile "/tmp/test.mid")
     #+cmu
-    (ext:run-program "timidity" '("test.mid"))
+    (ext:run-program "timidity" '("/tmp/test.mid"))
     #+sbcl
-    (sb-ext:run-program "timidity" '("test.mid") :search t)
+    (sb-ext:run-program "timidity" '("/tmp/test.mid") :search t)
     #-(or cmu sbcl)
     (error "write compatibility layer for RUN-PROGRAM")))
 




More information about the Gsharp-cvs mailing list