To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Revision:

root / _beattracker / getmeasures3 @ 8:b5b38998ef3b

History | View | Annotate | Download (701 Bytes)

1
function out = getmeasures4(fname,ts);
2

    
3
if nargin<2
4
	% optional argument to hand label the timesignature
5
    ts = 0;
6
end
7

    
8
sz = wavread(fn,'size');
9

    
10
[x fs] = wavread(fname,round([0.5 0.7]*sz(1)));
11
x = mean(x,2);
12

    
13
if fs~=11025,
14
    x = resample(x,11025,fs);
15
end
16

    
17
x = x + randn(length(x),1) * 0.0000001;
18

    
19
df = get_dfs(x,bt_parms(0.01161*4));
20
disp 'onset detection function'
21

    
22
[beats,localscore,timesig] = newtt_hmm_dp(df{1});
23
disp 'beats'
24

    
25
[bcf,frame] = getbcfs2(fname,beats);
26
if~timesig, timesig = 4; end
27

    
28
if ts
29
    measures = bcfm(bcf.spec,beats,ts);
30
else
31
    measures = bcfm(bcf.spec,beats,timesig);
32
end
33

    
34

    
35

    
36
out.beats = beats/44100;
37
out.measures = measures/44100;
38
out.timesig = timesig;
39
out.df = df{1};