Mercurial > hg > vamp-plugin-sdk
comparison README @ 239:cc467e52da4c
* Add platform README files
author | cannam |
---|---|
date | Mon, 10 Nov 2008 12:39:19 +0000 |
parents | 3ad28b1e2150 |
children | 7f3a806ed1df |
comparison
equal
deleted
inserted
replaced
238:4b5a3031cd08 | 239:cc467e52da4c |
---|---|
7 http://www.vamp-plugins.org/ | 7 http://www.vamp-plugins.org/ |
8 | 8 |
9 Vamp is an API for C and C++ plugins that process sampled audio data | 9 Vamp is an API for C and C++ plugins that process sampled audio data |
10 to produce descriptive output (measurements or semantic observations). | 10 to produce descriptive output (measurements or semantic observations). |
11 | 11 |
12 The principal differences between Vamp and a real-time audio | |
13 processing plugin system such as VST are: | |
14 | |
15 * Vamp plugins may output complex multidimensional data with labels. | |
16 As a consequence, they are likely to work best when the output | |
17 data has a much lower sampling rate than the input. (This also | |
18 means it is usually desirable to implement them in C++ using the | |
19 high-level base class provided rather than use the raw C API.) | |
20 | |
21 * While Vamp plugins receive data block-by-block, they are not | |
22 required to return output immediately on receiving the input. | |
23 A Vamp plugin may be non-causal, preferring to store up data | |
24 based on its input until the end of a processing run and then | |
25 return all results at once. | |
26 | |
27 * Vamp plugins have more control over their inputs than a typical | |
28 real-time processing plugin. For example, they can indicate to | |
29 the host their preferred processing block and step sizes, and these | |
30 may differ. | |
31 | |
32 * Vamp plugins may ask to receive data in the frequency domain | |
33 instead of the time domain. The host takes the responsibility | |
34 for converting the input data using an FFT of windowed frames. | |
35 This simplifies plugins that do straightforward frequency-domain | |
36 processing and permits the host to cache frequency-domain data | |
37 when possible. | |
38 | |
39 * A Vamp plugin is configured once before each processing run, and | |
40 receives no further parameter changes during use -- unlike real- | |
41 time plugin APIs in which the input parameters may change at any | |
42 time. This also means that fundamental properties such as the | |
43 number of values per output or the preferred processing block | |
44 size may depend on the input parameters. | |
45 | |
46 * Vamp plugins do not have to be able to run in real time. | |
47 | |
48 | |
49 About this SDK | |
50 ============== | |
51 | |
52 This is version 2.0 of the Vamp plugin Software Development Kit. | 12 This is version 2.0 of the Vamp plugin Software Development Kit. |
53 | |
54 Plugins and hosts built with this SDK are binary compatible with those | 13 Plugins and hosts built with this SDK are binary compatible with those |
55 built using version 1.0 of the SDK. | 14 built using version 1.0 of the SDK. See CHANGELOG for a list of the |
15 changes in this release. | |
56 | 16 |
57 A documentation guide to writing plugins using the Vamp SDK can be | 17 A documentation guide to writing plugins using the Vamp SDK can be |
58 found at http://www.vamp-plugins.org/guide.pdf . | 18 found at http://www.vamp-plugins.org/guide.pdf . |
59 | 19 |
20 | |
21 Compiling and Installing the SDK and Examples | |
22 ============================================= | |
23 | |
24 This SDK is intended for use on Windows, OS/X, Linux, and other POSIX | |
25 and GNU platforms. | |
26 | |
27 Please see the platform-specific README file (README.msvc, README.osx, | |
28 README.linux) in the build/ directory for details about how to compile | |
29 and install the SDK, how to build plugin libraries using it, and how | |
30 to install the example plugins so you can use them in a host. | |
31 | |
32 | |
33 What's In This SDK | |
34 ================== | |
35 | |
60 This SDK contains the following: | 36 This SDK contains the following: |
61 | 37 |
62 * vamp/vamp.h | 38 |
39 vamp/vamp.h | |
40 ----------- | |
63 | 41 |
64 The formal C language plugin API for Vamp plugins. | 42 The formal C language plugin API for Vamp plugins. |
65 | 43 |
66 A Vamp plugin is a dynamic library (.so, .dll or .dylib depending on | 44 A Vamp plugin is a dynamic library (.so, .dll or .dylib depending on |
67 platform) exposing one C-linkage entry point (vampGetPluginDescriptor) | 45 platform) exposing one C-linkage entry point (vampGetPluginDescriptor) |
68 which returns data defined in the rest of this C header. | 46 which returns data defined in the rest of this C header. |
69 | 47 |
70 Although the C API is the official API for Vamp, we don't recommend | 48 Although the C API is the official API for Vamp, we don't recommend |
71 that you program directly to it. The C++ abstraction found in the | 49 that you program directly to it. The C++ abstractions found in the |
72 vamp-sdk directory (below) is preferable for most purposes and is | 50 vamp-sdk and vamp-hostsdk directories (below) are preferable for most |
73 more thoroughly documented. | 51 purposes and are more thoroughly documented. |
74 | 52 |
75 * vamp-sdk | 53 |
54 vamp-sdk | |
55 -------- | |
76 | 56 |
77 C++ classes for implementing Vamp plugins. | 57 C++ classes for implementing Vamp plugins. |
78 | 58 |
79 Plugins should subclass Vamp::Plugin and then use Vamp::PluginAdapter | 59 Plugins should subclass Vamp::Plugin and then use Vamp::PluginAdapter |
80 to expose the correct C API for the plugin. Plugin authors should | 60 to expose the correct C API for the plugin. Plugin authors should |
81 read vamp-sdk/PluginBase.h and Plugin.h for code documentation, and | 61 read vamp-sdk/PluginBase.h and Plugin.h for code documentation. |
82 refer to the example plugin code in the examples directory. Plugins | 62 |
83 should link with -lvamp-sdk. | 63 See "examples" below for details of the example plugins in the SDK, |
84 | 64 from which you are welcome to take code and inspiration. |
85 * vamp-hostsdk | 65 |
66 Plugins should link with -lvamp-sdk. | |
67 | |
68 | |
69 vamp-hostsdk | |
70 ------------ | |
86 | 71 |
87 C++ classes for implementing Vamp hosts. | 72 C++ classes for implementing Vamp hosts. |
88 | 73 |
89 Hosts can use the Vamp::PluginHostAdapter to convert the loaded | 74 Hosts will normally use a Vamp::PluginHostAdapter to convert each |
90 plugin's C API back into a Vamp::Plugin object. | 75 plugin's exposed C API back into a useful Vamp::Plugin C++ object. |
91 | |
92 Host authors should refer to the example host code in the host | |
93 directory. Hosts should link with -lvamp-hostsdk. | |
94 | 76 |
95 The Vamp::HostExt namespace contains several additional C++ classes to | 77 The Vamp::HostExt namespace contains several additional C++ classes to |
96 make a host's life easier: | 78 do this work for them, and make the host's life easier: |
97 | 79 |
98 Vamp::HostExt::PluginLoader provides a very easy interface for a host | 80 - Vamp::HostExt::PluginLoader provides a very easy interface for a |
99 to discover, load, and find out category information about the | 81 host to discover, load, and find out category information about the |
100 available plugins. Most "casual" Vamp hosts will probably want to use | 82 available plugins. Most Vamp hosts will probably want to use this |
101 this class. | 83 class. |
102 | 84 |
103 Vamp::HostExt::PluginInputDomainAdapter provides a means for hosts to | 85 - Vamp::HostExt::PluginInputDomainAdapter provides a simple means for |
104 handle plugins that expect frequency-domain input, without having to | 86 hosts to handle plugins that want frequency-domain input, without |
105 convert the input themselves. | 87 having to convert the input themselves. |
106 | 88 |
107 Vamp::HostExt::PluginChannelAdapter provides a means for hosts to use | 89 - Vamp::HostExt::PluginChannelAdapter provides a simple means for |
108 plugins that do not necessarily support the same number of audio | 90 hosts to use plugins that do not necessarily support the same number |
109 channels as they have available, without having to worry about | 91 of audio channels as they have available, without having to apply a |
110 applying a channel management / mixdown policy themselves. | 92 channel management / mixdown policy themselves. |
111 | 93 |
112 Vamp::HostExt::PluginBufferingAdapter provides a means for hosts to | 94 - Vamp::HostExt::PluginBufferingAdapter provides a means for hosts to |
113 avoid having to negotiate the input step and block size, instead | 95 avoid having to negotiate the input step and block size, instead |
114 permitting the host to use any block size they desire (and a step size | 96 permitting the host to use any block size they desire (and a step |
115 equal to it). This is particularly useful for "streaming" hosts that | 97 size equal to it). This is particularly useful for "streaming" hosts |
116 cannot seek backwards in the input audio stream and so would otherwise | 98 that cannot seek backwards in the input audio stream and so would |
117 need to implement an additional buffer to support step sizes smaller | 99 otherwise need to implement an additional buffer to support step |
118 than the block size. | 100 sizes smaller than the block size. |
119 | 101 |
120 The PluginLoader class can also use the input domain and channel | 102 - Vamp::HostExt::PluginSummarisingAdapter provides summarisation |
121 adapters automatically to make the entire conversion process | 103 methods such as mean and median averages of output features, for use |
122 transparent to the host if required. | 104 in any context where an available plugin produces individual values |
123 | 105 but the result that is actually needed is some sort of aggregate. |
124 * examples | 106 |
125 | 107 The PluginLoader class can also use the input domain, channel, and |
126 Example plugins implemented using the C++ classes. ZeroCrossing | 108 buffering adapters automatically to make these conversions transparent |
127 calculates the positions and density of zero-crossing points in an | 109 to the host if required. |
128 audio waveform. SpectralCentroid calculates the centre of gravity of | 110 |
129 the frequency domain representation of each block of audio. | 111 Host authors should also refer to the example host code in the host |
130 AmplitudeFollower tracks the amplitude of a signal based on a method | 112 directory of the SDK. |
131 from the SuperCollider real-time audio system. | 113 |
132 PercussionOnsetDetector estimates the locations of percussive onsets | 114 Hosts should link with -lvamp-hostsdk. |
133 using a simple method described in "Drum Source Separation using | 115 |
134 Percussive Feature Detection and Spectral Modulation" by Dan Barry, | 116 |
135 Derry Fitzgerald, Eugene Coyle and Bob Lawlor, ISSC 2005. | 117 examples |
136 | 118 -------- |
137 * host | 119 |
120 Example plugins implemented using the C++ classes. | |
121 | |
122 These plugins are intended to be useful examples you can draw code | |
123 from in order to provide the basic shape and structure of a Vamp | |
124 plugin. They are also intended to be correct and useful, if simple. | |
125 | |
126 - ZeroCrossing calculates the positions and density of zero-crossing | |
127 points in an audio waveform. | |
128 | |
129 - SpectralCentroid calculates the centre of gravity of the frequency | |
130 domain representation of each block of audio. | |
131 | |
132 - AmplitudeFollower is a simple implementation of SuperCollider's | |
133 amplitude-follower algorithm. | |
134 | |
135 - PercussionOnsetDetector estimates the locations of percussive | |
136 onsets using a simple method described in "Drum Source Separation | |
137 using Percussive Feature Detection and Spectral Modulation" by Dan | |
138 Barry, Derry Fitzgerald, Eugene Coyle and Bob Lawlor, ISSC 2005. | |
139 | |
140 - FixedTempoEstimator calculates a single beats-per-minute value | |
141 which is an estimate of the tempo of a piece of music that is assumed | |
142 to be of fixed tempo, using autocorrelation of a frequency domain | |
143 energy rise metric. It has several outputs that return intermediate | |
144 results used in the calculation, and may be a useful example of a | |
145 plugin having several outputs with varying feature structures. | |
146 | |
147 | |
148 host | |
149 ---- | |
138 | 150 |
139 A simple command-line Vamp host, capable of loading a plugin and using | 151 A simple command-line Vamp host, capable of loading a plugin and using |
140 it to process a complete audio file, with its default parameters. | 152 it to process a complete audio file, with its default parameters. |
141 Requires libsndfile (http://www.mega-nerd.com/libsndfile/). | |
142 | |
143 If you don't have libsndfile, you may want to edit the Makefile to | |
144 change the default build target from "all" to "sdk", so as to compile | |
145 only the SDK and not the host. | |
146 | 153 |
147 | 154 |
148 Plugin Lookup and Categorisation | 155 Plugin Lookup and Categorisation |
149 ================================ | 156 ================================ |
150 | 157 |
181 trees, which is why this information is not queried as part of the | 188 trees, which is why this information is not queried as part of the |
182 Vamp plugin's API itself. The Vamp::HostExt::PluginLoader class also | 189 Vamp plugin's API itself. The Vamp::HostExt::PluginLoader class also |
183 provides support for plugin category lookup using this scheme. | 190 provides support for plugin category lookup using this scheme. |
184 | 191 |
185 | 192 |
186 Compiling the SDK and Examples | |
187 ============================== | |
188 | |
189 This SDK is intended for use on Windows, OS/X, Linux, and other POSIX | |
190 platforms. | |
191 | |
192 * Windows | |
193 | |
194 Two Visual C++ project files are included: | |
195 | |
196 VampPluginSDK.vcproj -- builds the SDK into a single static | |
197 library, but does not build the example plugins or host | |
198 | |
199 VampExamplePlugins.vcproj -- builds the example plugins DLL, but | |
200 does not build the library or host | |
201 | |
202 Alternatively, when using Visual Studio or another IDE to build a | |
203 plugin or host using the SDK, you may prefer to simply add the .h and | |
204 .cpp files in the vamp-sdk and vamp-sdk/hostext directories to your | |
205 existing project. | |
206 | |
207 As the command-line host has additional library dependencies (namely | |
208 libsndfile), no pre-packaged project is included to build it. | |
209 | |
210 When using Visual C++ to build plugins, you will need to ensure that | |
211 the plugin entry point (vampGetPluginDescriptor) is exported from the | |
212 DLL so that the plugins can be loaded. One way to achieve this is to | |
213 add the linker option /EXPORT:vampGetPluginDescriptor to your project. | |
214 The included VampExamplePlugins.vcproj does this. | |
215 | |
216 If you are using a Cygwin or MinGW GNU toolchain, use the included | |
217 Makefile (see Linux and other POSIX platforms below). | |
218 | |
219 * OS/X | |
220 | |
221 Run "make -f Makefile.osx" to build the SDK, example plugins, and | |
222 command-line host. | |
223 | |
224 Note that the host requires that you have libsndfile | |
225 (http://www.mega-nerd.com/libsndfile/) installed. To build only the | |
226 SDK and examples, "make -f Makefile.osx sdk examples". | |
227 | |
228 If you are using an IDE, you may prefer to simply add the .h and .cpp | |
229 files in the vamp-sdk and vamp-sdk/hostext directories to your | |
230 existing project. | |
231 | |
232 * Linux and other Unixesque platforms | |
233 | |
234 To build the SDK, example plugins, and command-line host, edit the | |
235 Makefile to suit your platform according to the comments in it, then | |
236 run "make". | |
237 | |
238 Note that the host requires that you have libsndfile | |
239 (http://www.mega-nerd.com/libsndfile/) installed. To build only the | |
240 SDK and examples, edit the Makefile then run "make sdk examples". | |
241 | |
242 | |
243 Installing the Example Plugins | |
244 ============================== | |
245 | |
246 Installing the example plugins so that they can be found by other Vamp | |
247 hosts depends on your platform: | |
248 | |
249 * Windows: copy the files | |
250 examples/vamp-example-plugins.dll | |
251 examples/vamp-example-plugins.cat | |
252 to | |
253 C:\Program Files\Vamp Plugins | |
254 | |
255 * Linux: copy the files | |
256 examples/vamp-example-plugins.so | |
257 examples/vamp-example-plugins.cat | |
258 to | |
259 /usr/local/lib/vamp/ | |
260 | |
261 * OS/X: copy the files | |
262 examples/vamp-example-plugins.dylib | |
263 examples/vamp-example-plugins.cat | |
264 to | |
265 /Library/Audio/Plug-Ins/Vamp | |
266 | |
267 | |
268 Licensing | 193 Licensing |
269 ========= | 194 ========= |
270 | 195 |
271 This plugin SDK is freely redistributable under a "new-style BSD" | 196 This plugin SDK is freely redistributable under a "new-style BSD" |
272 licence. See the file COPYING for more details. In short, you may | 197 licence. See the file COPYING for more details. In short, you may |