-
Notifications
You must be signed in to change notification settings - Fork 0
/
demoChromaToolbox.m
85 lines (74 loc) · 2.88 KB
/
demoChromaToolbox.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
clear
close all
filename = 'Systematic_Chord-C-Major_Eight-Instruments.wav';
[f_audio,sideinfo] = wav_to_audio('', 'data_WAV/', filename);
shiftFB = estimateTuning(f_audio);
paramPitch.winLenSTMSP = 4410;
paramPitch.shiftFB = shiftFB;
paramPitch.visualize = 1;
[f_pitch,sideinfo] = ...
audio_to_pitch_via_FB(f_audio,paramPitch,sideinfo);
paramCP.applyLogCompr = 0;
paramCP.visualize = 1;
paramCP.inputFeatureRate = sideinfo.pitch.featureRate;
[f_CP,sideinfo] = pitch_to_chroma(f_pitch,paramCP,sideinfo);
paramCLP.applyLogCompr = 1;
paramCLP.factorLogCompr = 100;
paramCLP.visualize = 1;
paramCLP.inputFeatureRate = sideinfo.pitch.featureRate;
[f_CLP,sideinfo] = pitch_to_chroma(f_pitch,paramCLP,sideinfo);
paramCENS.winLenSmooth = 21;
paramCENS.downsampSmooth = 5;
paramCENS.visualize = 1;
paramCENS.inputFeatureRate = sideinfo.pitch.featureRate;
[f_CENS,sideinfo] = pitch_to_CENS(f_pitch,paramCENS,sideinfo);
paramCRP.coeffsToKeep = [55:120];
paramCRP.visualize = 1;
paramCRP.inputFeatureRate = sideinfo.pitch.featureRate;
[f_CRP,sideinfo] = pitch_to_CRP(f_pitch,paramCRP,sideinfo);
paramSmooth.winLenSmooth = 21;
paramSmooth.downsampSmooth = 5;
paramSmooth.inputFeatureRate = sideinfo.CRP.featureRate;
[f_CRPSmoothed, featureRateSmoothed] = ...
smoothDownsampleFeature(f_CRP,paramSmooth);
parameterVis.featureRate = featureRateSmoothed;
visualizeCRP(f_CRPSmoothed,parameterVis);
% filename = 'Systematic_Chord-C-Major_Eight-Instruments.wav';
% [f_audio,sideinfo] = wav_to_audio('', 'data_WAV/', filename);
% shiftFB = estimateTuning(f_audio);
%
% paramPitch.win_len = 4410;
% paramPitch.shiftFB = shiftFB;
% paramPitch.visualize = 1;
% [f_pitch,sideinfo] = ...
% audio_to_pitch_via_FB(f_audio,paramPitch,sideinfo);
%
% paramCP.applyLogCompr = 0;
% paramCP.visualize = 1;
% paramCP.inputFeatureRate = sideinfo.pitch.featureRate;
% [f_CP,sideinfo] = pitch_to_chroma(f_pitch,paramCP,sideinfo);
%
% paramCLP.applyLogCompr = 1;
% paramCLP.logParamMult = 100;
% paramCLP.visualize = 1;
% paramCLP.inputFeatureRate = sideinfo.pitch.featureRate;
% [f_CLP,sideinfo] = pitch_to_chroma(f_pitch,paramCLP,sideinfo);
%
% paramCENS.stat_window_length = 21;
% paramCENS.stat_downsample = 5;
% paramCENS.visualize = 1;
% paramCENS.inputFeatureRate = sideinfo.pitch.featureRate;
% [f_CENS,sideinfo] = pitch_to_CENS(f_pitch,paramCENS,sideinfo);
%
% paramCRP.coeffsToKeep = [55:120];
% paramCRP.visualize = 1;
% paramCRP.inputFeatureRate = sideinfo.pitch.featureRate;
% [f_CRP,sideinfo] = pitch_to_CRP(f_pitch,paramCRP,sideinfo);
%
% paramSmooth.stat_window_length = 21;
% paramSmooth.stat_downsample = 5;
% paramSmooth.inputFeatureRate = sideinfo.CRP.featureRate;
% [f_CRPSmoothed, featureRateSmoothed] = ...
% smoothDownsampleFeature(f_CRP,paramSmooth);
% parameterVis.featureRate = featureRateSmoothed;
% visualize_CRP(f_CRPSmoothed,parameterVis);