shithub: aubio

Download patch

ref: 0cd995a1de29cce711b6d89852c0000d3169ebaf
parent: 4045ba4b18c20abf9aa3cda54416e1b0d8b6cd96
author: Paul Brossier <piem@altern.org>
date: Fri Feb 17 10:59:22 EST 2006

change rocloc to return list and abs list of differences
change rocloc to return list and abs list of differences


--- a/python/aubio/onsetcompare.py
+++ b/python/aubio/onsetcompare.py
@@ -79,6 +79,7 @@
     """
     orig, expc = len(ltru), len(lexp)
     l = []
+    labs = []
     mean = 0
     # if lexp is empty
     if expc == 0 : return orig,orig,0,0,0,0,l,mean
@@ -97,11 +98,12 @@
             if abs(x-y) <= eps:    
 	    	correspond += 1
             	l.append(y-x) 
+            	labs.append(abs(y-x))
         if correspond == 0:        bad += 1
         elif correspond > 1:       merged += correspond - 1
     # check consistancy of the results
     assert ( orig - missed - merged == expc - bad - doubled)
-    return orig, missed, merged, expc, bad, doubled, l, sum(l)/float(max(len(l),1))
+    return orig, missed, merged, expc, bad, doubled, l, labs
 
 def notes_roc (la, lb, eps):
     from numarray import transpose, add, resize