shithub: aubio

ref: 26d9f8f56c485712e30a5d418a12e128c954fcb3
dir: /python/bench-onset/

View raw version
#! /usr/bin/python

from aubio.bench.config import *
from aubio.bench.node import *

datapath = "%s%s" % (DATADIR,'/onset/DB')
respath = '/var/tmp/DB-testings'

MODES = 'hfc', 'complexdomain', 'energy', 'phase', 'specdiff', 'kl', 'mkl'
THRESHOLD = range(1,14,1)

#        prepareresultpath
act_on_results(mkdir,datapath,respath,filter='d')

def compute_data(input,output):
        aubiocmd = "%s%s %s%s" % \
                ("LD_LIBRARY_PATH=",LD_LIBRARY_PATH,AUBIOHOME,"/examples/aubioonset")
        for m in MODES:
                for k in THRESHOLD:
                        cmd = "%s --input \"%s\" --onset %s --threshold %s > \"%s--%s--%s.txt\"" \
                                % (aubiocmd,input,m,k/10.,output,m,k/10.)
                        runcommand(cmd,debug=1)


#        computedata
act_on_data(compute_data,datapath,respath,suffix='',filter='f -name \'*.wav\'')

#        gatherdata
#act_on_data(my_print,datapath,respath,suffix='.txt',filter='f -name \'*.wav\'')
#        gatherthreshold
#        gathermodes
#        comparediffs
#        gatherdiffs