annotate _beattracker/getmeasures2.m @ 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 = getmeasures2(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
matthiasm@8 9 [x fs] = wavread(fname);
matthiasm@8 10 x = mean(x,2);
matthiasm@8 11
matthiasm@8 12 if fs~=11025,
matthiasm@8 13 x = resample(x,11025,fs);
matthiasm@8 14 end
matthiasm@8 15
matthiasm@8 16 x = x + randn(length(x),1) * 0.0000001;
matthiasm@8 17
matthiasm@8 18 df = get_dfs(x,bt_parms(0.01161*4));
matthiasm@8 19 disp 'onset detection function'
matthiasm@8 20
matthiasm@8 21 [beats,localscore,timesig] = newtt_hmm_dp(df{1});
matthiasm@8 22 disp 'beats'
matthiasm@8 23
matthiasm@8 24 [bcf,frame] = getbcfs2(fname,beats);
matthiasm@8 25 if~timesig, timesig = 4; end
matthiasm@8 26
matthiasm@8 27 if ts
matthiasm@8 28 measures = bcfm(bcf.spec,beats,ts);
matthiasm@8 29 else
matthiasm@8 30 measures = bcfm(bcf.spec,beats,timesig);
matthiasm@8 31 end
matthiasm@8 32
matthiasm@8 33
matthiasm@8 34
matthiasm@8 35 out.beats = beats/44100;
matthiasm@8 36 out.measures = measures/44100;
matthiasm@8 37 out.timesig = timesig;
matthiasm@8 38 out.df = df{1};