To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / _beattracker / getmeasures3.m @ 8:b5b38998ef3b
History | View | Annotate | Download (678 Bytes)
| 1 |
function out = getmeasures3(x,fs,ts); |
|---|---|
| 2 |
|
| 3 |
if nargin<2 |
| 4 |
% optional argument to hand label the timesignature |
| 5 |
ts = 0; |
| 6 |
end |
| 7 |
|
| 8 |
|
| 9 |
% [x fs] = wavread(fname); |
| 10 |
% x = mean(x,2); |
| 11 |
|
| 12 |
if fs~=11025, |
| 13 |
x = resample(x,11025,fs); |
| 14 |
end |
| 15 |
|
| 16 |
x = x + randn(length(x),1) * 0.0000001; |
| 17 |
|
| 18 |
df = get_dfs(x,bt_parms(0.01161*4)); |
| 19 |
disp 'onset detection function' |
| 20 |
|
| 21 |
[beats,localscore,timesig] = newtt_hmm_dp(df{1});
|
| 22 |
disp 'beats' |
| 23 |
|
| 24 |
% [bcf,frame] = getbcfs2(fname,beats); |
| 25 |
% if~timesig, timesig = 4; end |
| 26 |
% |
| 27 |
% if ts |
| 28 |
% measures = bcfm(bcf.spec,beats,ts); |
| 29 |
% else |
| 30 |
% measures = bcfm(bcf.spec,beats,timesig); |
| 31 |
% end |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
out.beats = beats/44100; |
| 36 |
% out.measures = measures/44100; |
| 37 |
% out.timesig = timesig; |
| 38 |
% out.df = df{1};
|