Wiki » History » Version 3

Mi Tian, 2015-08-05 05:51 PM

1 1 Mi Tian
h1. Wiki
2 1 Mi Tian
3 1 Mi Tian
h2. Vamp environment for feature extraction
4 1 Mi Tian
5 1 Mi Tian
_Vamp_ is an audio processing plugin system for plugins that extract descriptive information from audio data — typically referred to as audio analysis plugins or audio feature extraction plugins. The _vamp plugins_ are distributed in shared library files with extension _.dll_, _.so_, or _.dylib_ depending on the platform.  A vamp plugin cannot be used on its own, but only with a conforming _host_ application which loads the plugin from its shared library and calls functions within the plugin code to configure it, supply it with data, and run it.
6 1 Mi Tian
7 1 Mi Tian
See [[http://vamp-plugins.org/]] for more details about Vamp plugins.
8 2 Mi Tian
9 2 Mi Tian
h2. Host applications
10 2 Mi Tian
11 3 Mi Tian
* Sonic Visualiser
12 3 Mi Tian
[[http://www.sonicvisualiser.org/]]
13 3 Mi Tian
* Sonic Annotator 
14 3 Mi Tian
[[https://code.soundsoftware.ac.uk/projects/sonic-annotator]]
15 3 Mi Tian
* Audacity
16 3 Mi Tian
[[http://audacityteam.org/]]
17 2 Mi Tian
18 3 Mi Tian
Once the plugins and 
19 1 Mi Tian
20 1 Mi Tian
h2. Example usages of the onset detectors
21 3 Mi Tian
22 3 Mi Tian
<pre>
23 3 Mi Tian
mitian$ sonic-annotator -l | grep vampy-onsets
24 3 Mi Tian
vamp:vampy:vampy-onsets-bersf:vampy-onsets-bersf-onsets
25 3 Mi Tian
vamp:vampy:vampy-onsets-cdsf:vampy-onsets-cdsf-onsets
26 3 Mi Tian
vamp:vampy:vampy-onsets-ber:vampy-onsets-ber-df
27 3 Mi Tian
vamp:vampy:vampy-onsets-ber:vampy-onsets-ber-onsets
28 3 Mi Tian
vamp:vampy:vampy-onsets-ber:vampy-onsets-ber-sdf
29 3 Mi Tian
vamp:vampy:vampy-onsets-cd:vampy-onsets-cd-df
30 3 Mi Tian
vamp:vampy:vampy-onsets-cd:vampy-onsets-cd-onsets
31 3 Mi Tian
vamp:vampy:vampy-onsets-cd:vampy-onsets-cd-sdf
32 3 Mi Tian
vamp:vampy:vampy-onsets-hfc:vampy-onsets-hfc-df
33 3 Mi Tian
vamp:vampy:vampy-onsets-hfc:vampy-onsets-hfc-onsets
34 3 Mi Tian
vamp:vampy:vampy-onsets-hfc:vampy-onsets-hfc-sdf
35 3 Mi Tian
vamp:vampy:vampy-onsets-pd:vampy-onsets-pd-df
36 3 Mi Tian
vamp:vampy:vampy-onsets-pd:vampy-onsets-pd-onsets
37 3 Mi Tian
vamp:vampy:vampy-onsets-pd:vampy-onsets-pd-sdf
38 3 Mi Tian
vamp:vampy:vampy-onsets-sd:vampy-onsets-sd-df
39 3 Mi Tian
vamp:vampy:vampy-onsets-sd:vampy-onsets-sd-onsets
40 3 Mi Tian
vamp:vampy:vampy-onsets-sd:vampy-onsets-sd-sdf
41 3 Mi Tian
vamp:vampy:vampy-onsets-sf:vampy-onsets-sf-df
42 3 Mi Tian
vamp:vampy:vampy-onsets-sf:vampy-onsets-sf-onsets
43 3 Mi Tian
vamp:vampy:vampy-onsets-sf:vampy-onsets-sf-sdf
44 3 Mi Tian
mitian$
45 3 Mi Tian
mitian$ sonic-annotator -d vamp:vampy:vampy-onsets-cdsf:vampy-onsets-cdsf-onsets -w csv test.wav --csv-basedir /homes/mt302/hg/workspace/onsetdetection
46 3 Mi Tian
Extracting and writing features... Done
47 3 Mi Tian
48 3 Mi Tian
Vampy::~PyExtensionManager: Extension module cleaned.
49 3 Mi Tian
mitian$
50 3 Mi Tian
mitian$
51 3 Mi Tian
</pre>
52 3 Mi Tian
53 3 Mi Tian
Sonic Anntator also allows for batch processing in one go. 
54 3 Mi Tian
<pre>
55 3 Mi Tian
mitian$
56 3 Mi Tian
mitian$ sonic-annotator -d vamp:vampy:vampy-onsets-cdsf:vampy-onsets-cdsf-onsets -w csv /homes/mt302/documents/audio/*.wav --csv-basedir /homes/mt302/hg/workspace/onsetdetection
57 3 Mi Tian
Extracting and writing features... Done
58 3 Mi Tian
59 3 Mi Tian
Vampy::~PyExtensionManager: Extension module cleaned.
60 3 Mi Tian
mitian$
61 3 Mi Tian
mitian$
62 3 Mi Tian
</pre>
63 3 Mi Tian
64 3 Mi Tian
h2. Play around with your vamp plugin feature extractors with _Vamp Ontologies_
65 3 Mi Tian
66 3 Mi Tian
We may want use parameter settings other the default. With Sonic Visualiser or Audacity, users can easily access the GUI to modify them. Whiles  with Sonic Annotator, you would need to interact with 
67 3 Mi Tian
68 3 Mi Tian
Firstly, we can check the current parameter configurations using Sonic Annotator's @-s@ cammand.
69 3 Mi Tian
70 3 Mi Tian
<pre>
71 3 Mi Tian
mitian$
72 3 Mi Tian
mitian$ sonic-annotator -s vamp:vampy:vampy-onsets-cdsf:vampy-onsets-cdsf-onsets
73 3 Mi Tian
@prefix xsd:      <http://www.w3.org/2001/XMLSchema> .
74 3 Mi Tian
  @prefix vamp:     <http://purl.org/ontology/vamp/> .
75 3 Mi Tian
  @prefix :         <#> .
76 3 Mi Tian
77 3 Mi Tian
 
78 3 Mi Tian
:transform_plugin a vamp:Plugin ;
79 3 Mi Tian
    vamp:identifier "vampy-onsets-cdsf" .
80 3 Mi Tian
81 3 Mi Tian
:transform_library a vamp:PluginLibrary ;
82 3 Mi Tian
    vamp:identifier "vampy" ;
83 3 Mi Tian
    vamp:available_plugin :transform_plugin .
84 3 Mi Tian
85 3 Mi Tian
:transform a vamp:Transform ;
86 3 Mi Tian
    vamp:plugin :transform_plugin ;
87 3 Mi Tian
    vamp:step_size "512"^^xsd:int ;
88 3 Mi Tian
    vamp:block_size "1024"^^xsd:int ;
89 3 Mi Tian
    vamp:parameter_binding [
90 3 Mi Tian
        vamp:parameter [ vamp:identifier "bt-threshold" ] ;
91 3 Mi Tian
        vamp:value "0.9"^^xsd:float ;
92 3 Mi Tian
    ] ;
93 3 Mi Tian
    vamp:parameter_binding [
94 3 Mi Tian
        vamp:parameter [ vamp:identifier "cut-off" ] ;
95 3 Mi Tian
        vamp:value "0.34"^^xsd:float ;
96 3 Mi Tian
    ] ;
97 3 Mi Tian
    vamp:parameter_binding [
98 3 Mi Tian
        vamp:parameter [ vamp:identifier "dthreshold" ] ;
99 3 Mi Tian
        vamp:value "0"^^xsd:float ;
100 3 Mi Tian
    ] ;
101 3 Mi Tian
    vamp:parameter_binding [
102 3 Mi Tian
        vamp:parameter [ vamp:identifier "filtfilt" ] ;
103 3 Mi Tian
        vamp:value "1"^^xsd:float ;
104 3 Mi Tian
    ] ;
105 3 Mi Tian
    vamp:parameter_binding [
106 3 Mi Tian
        vamp:parameter [ vamp:identifier "fusion-type" ] ;
107 3 Mi Tian
        vamp:value "2"^^xsd:float ;
108 3 Mi Tian
    ] ;
109 3 Mi Tian
    vamp:parameter_binding [
110 3 Mi Tian
        vamp:parameter [ vamp:identifier "lin-threshold" ] ;
111 3 Mi Tian
        vamp:value "0.5"^^xsd:float ;
112 3 Mi Tian
    ] ;
113 3 Mi Tian
    vamp:parameter_binding [
114 3 Mi Tian
        vamp:parameter [ vamp:identifier "med-threshold" ] ;
115 3 Mi Tian
        vamp:value "7"^^xsd:float ;
116 3 Mi Tian
    ] ;
117 3 Mi Tian
    vamp:parameter_binding [
118 3 Mi Tian
        vamp:parameter [ vamp:identifier "medfilt" ] ;
119 3 Mi Tian
        vamp:value "1"^^xsd:float ;
120 3 Mi Tian
    ] ;
121 3 Mi Tian
    vamp:parameter_binding [
122 3 Mi Tian
        vamp:parameter [ vamp:identifier "polyfit" ] ;
123 3 Mi Tian
        vamp:value "1"^^xsd:float ;
124 3 Mi Tian
    ] ;
125 3 Mi Tian
    vamp:parameter_binding [
126 3 Mi Tian
        vamp:parameter [ vamp:identifier "threshold" ] ;
127 3 Mi Tian
        vamp:value "50"^^xsd:float ;
128 3 Mi Tian
    ] ;
129 3 Mi Tian
    vamp:parameter_binding [
130 3 Mi Tian
        vamp:parameter [ vamp:identifier "tol-threshold" ] ;
131 3 Mi Tian
        vamp:value "0.03"^^xsd:float ;
132 3 Mi Tian
    ] ;
133 3 Mi Tian
    vamp:parameter_binding [
134 3 Mi Tian
        vamp:parameter [ vamp:identifier "whitening" ] ;
135 3 Mi Tian
        vamp:value "0"^^xsd:float ;
136 3 Mi Tian
    ] ;
137 3 Mi Tian
    vamp:output [ vamp:identifier "vampy-onsets-cdsf-onsets" ] .
138 3 Mi Tian
mitian$
139 3 Mi Tian
</pre>
140 3 Mi Tian
141 3 Mi Tian
Transforms are usually described in _RDF_, following the transform part of the _Vamp plugin ontology_. Now, how can be change the parameter settings in the transform specification file? 
142 3 Mi Tian
143 3 Mi Tian
Say, we want to use a higher threshold and change it from 50 to 70. 
144 3 Mi Tian
145 3 Mi Tian
h2.That's all guys! :)