annotate _beattracker/getmeasures3 @ 9:4ea6619cb3f5 tip

removed log files
author matthiasm
date Fri, 11 Apr 2014 15:55:11 +0100
parents b5b38998ef3b
children
rev   line source
matthiasm@8 1 function out = getmeasures4(fname,ts);
matthiasm@8 2
matthiasm@8 3 if nargin<2
matthiasm@8 4 % optional argument to hand label the timesignature
matthiasm@8 5 ts = 0;
matthiasm@8 6 end
matthiasm@8 7
matthiasm@8 8 sz = wavread(fn,'size');
matthiasm@8 9
matthiasm@8 10 [x fs] = wavread(fname,round([0.5 0.7]*sz(1)));
matthiasm@8 11 x = mean(x,2);
matthiasm@8 12
matthiasm@8 13 if fs~=11025,
matthiasm@8 14 x = resample(x,11025,fs);
matthiasm@8 15 end
matthiasm@8 16
matthiasm@8 17 x = x + randn(length(x),1) * 0.0000001;
matthiasm@8 18
matthiasm@8 19 df = get_dfs(x,bt_parms(0.01161*4));
matthiasm@8 20 disp 'onset detection function'
matthiasm@8 21
matthiasm@8 22 [beats,localscore,timesig] = newtt_hmm_dp(df{1});
matthiasm@8 23 disp 'beats'
matthiasm@8 24
matthiasm@8 25 [bcf,frame] = getbcfs2(fname,beats);
matthiasm@8 26 if~timesig, timesig = 4; end
matthiasm@8 27
matthiasm@8 28 if ts
matthiasm@8 29 measures = bcfm(bcf.spec,beats,ts);
matthiasm@8 30 else
matthiasm@8 31 measures = bcfm(bcf.spec,beats,timesig);
matthiasm@8 32 end
matthiasm@8 33
matthiasm@8 34
matthiasm@8 35
matthiasm@8 36 out.beats = beats/44100;
matthiasm@8 37 out.measures = measures/44100;
matthiasm@8 38 out.timesig = timesig;
matthiasm@8 39 out.df = df{1};