annotate src/vamp-plugin-sdk-2.5/README @ 23:619f715526df sv_v2.1

Update Vamp plugin SDK to 2.5
author Chris Cannam
date Thu, 09 May 2013 10:52:46 +0100
parents
children
rev   line source
Chris@23 1
Chris@23 2 Vamp
Chris@23 3 ====
Chris@23 4
Chris@23 5 An API for audio analysis and feature extraction plugins.
Chris@23 6
Chris@23 7 http://www.vamp-plugins.org/
Chris@23 8
Chris@23 9 Vamp is an API for C and C++ plugins that process sampled audio data
Chris@23 10 to produce descriptive output (measurements or semantic observations).
Chris@23 11
Chris@23 12 This is version 2.5 of the Vamp plugin Software Development Kit.
Chris@23 13
Chris@23 14 Plugins and hosts built with this SDK are binary compatible with those
Chris@23 15 built using version 1.0 of the SDK, with certain restrictions. See
Chris@23 16 the file README.compat for more details.
Chris@23 17
Chris@23 18 See the file CHANGELOG for a list of the changes in this release.
Chris@23 19
Chris@23 20 A documentation guide to writing plugins using the Vamp SDK can be
Chris@23 21 found at http://www.vamp-plugins.org/guide.pdf .
Chris@23 22
Chris@23 23
Chris@23 24 Compiling and Installing the SDK and Examples
Chris@23 25 =============================================
Chris@23 26
Chris@23 27 This SDK is intended for use on Windows, OS/X, Linux, and other POSIX
Chris@23 28 and GNU platforms.
Chris@23 29
Chris@23 30 Please see the platform-specific README file (README.msvc, README.osx,
Chris@23 31 README.linux) in the build/ directory for details about how to compile
Chris@23 32 and install the SDK, how to build plugin libraries using it, and how
Chris@23 33 to install the example plugins so you can use them in a host.
Chris@23 34
Chris@23 35
Chris@23 36 What's In This SDK
Chris@23 37 ==================
Chris@23 38
Chris@23 39 This SDK contains the following:
Chris@23 40
Chris@23 41
Chris@23 42 vamp/vamp.h
Chris@23 43 -----------
Chris@23 44
Chris@23 45 The formal C language plugin API for Vamp plugins.
Chris@23 46
Chris@23 47 A Vamp plugin is a dynamic library (.so, .dll or .dylib depending on
Chris@23 48 platform) exposing one C-linkage entry point (vampGetPluginDescriptor)
Chris@23 49 which returns data defined in the rest of this C header.
Chris@23 50
Chris@23 51 Although the C API is the official API for Vamp, we don't recommend
Chris@23 52 that you program directly to it. The C++ abstractions found in the
Chris@23 53 vamp-sdk and vamp-hostsdk directories (below) are preferable for most
Chris@23 54 purposes and are more thoroughly documented.
Chris@23 55
Chris@23 56
Chris@23 57 vamp-sdk
Chris@23 58 --------
Chris@23 59
Chris@23 60 C++ classes for implementing Vamp plugins.
Chris@23 61
Chris@23 62 Plugins should subclass Vamp::Plugin and then use Vamp::PluginAdapter
Chris@23 63 to expose the correct C API for the plugin. Plugin authors should
Chris@23 64 read vamp-sdk/PluginBase.h and Plugin.h for code documentation.
Chris@23 65
Chris@23 66 See "examples" below for details of the example plugins in the SDK,
Chris@23 67 from which you are welcome to take code and inspiration.
Chris@23 68
Chris@23 69 Plugins should link with -lvamp-sdk.
Chris@23 70
Chris@23 71
Chris@23 72 vamp-hostsdk
Chris@23 73 ------------
Chris@23 74
Chris@23 75 C++ classes for implementing Vamp hosts.
Chris@23 76
Chris@23 77 Hosts will normally use a Vamp::PluginHostAdapter to convert each
Chris@23 78 plugin's exposed C API back into a useful Vamp::Plugin C++ object.
Chris@23 79
Chris@23 80 The Vamp::HostExt namespace contains several additional C++ classes to
Chris@23 81 do this work for them, and make the host's life easier:
Chris@23 82
Chris@23 83 - Vamp::HostExt::PluginLoader provides a very easy interface for a
Chris@23 84 host to discover, load, and find out category information about the
Chris@23 85 available plugins. Most Vamp hosts will probably want to use this
Chris@23 86 class.
Chris@23 87
Chris@23 88 - Vamp::HostExt::PluginInputDomainAdapter provides a simple means for
Chris@23 89 hosts to handle plugins that want frequency-domain input, without
Chris@23 90 having to convert the input themselves.
Chris@23 91
Chris@23 92 - Vamp::HostExt::PluginChannelAdapter provides a simple means for
Chris@23 93 hosts to use plugins that do not necessarily support the same number
Chris@23 94 of audio channels as they have available, without having to apply a
Chris@23 95 channel management / mixdown policy themselves.
Chris@23 96
Chris@23 97 - Vamp::HostExt::PluginBufferingAdapter provides a means for hosts to
Chris@23 98 avoid having to negotiate the input step and block size, instead
Chris@23 99 permitting the host to use any block size they desire (and a step
Chris@23 100 size equal to it). This is particularly useful for "streaming" hosts
Chris@23 101 that cannot seek backwards in the input audio stream and so would
Chris@23 102 otherwise need to implement an additional buffer to support step
Chris@23 103 sizes smaller than the block size.
Chris@23 104
Chris@23 105 - Vamp::HostExt::PluginSummarisingAdapter provides summarisation
Chris@23 106 methods such as mean and median averages of output features, for use
Chris@23 107 in any context where an available plugin produces individual values
Chris@23 108 but the result that is actually needed is some sort of aggregate.
Chris@23 109
Chris@23 110 The PluginLoader class can also use the input domain, channel, and
Chris@23 111 buffering adapters automatically to make these conversions transparent
Chris@23 112 to the host if required.
Chris@23 113
Chris@23 114 Host authors should also refer to the example host code in the host
Chris@23 115 directory of the SDK.
Chris@23 116
Chris@23 117 Hosts should link with -lvamp-hostsdk.
Chris@23 118
Chris@23 119
Chris@23 120 examples
Chris@23 121 --------
Chris@23 122
Chris@23 123 Example plugins implemented using the C++ classes.
Chris@23 124
Chris@23 125 These plugins are intended to be useful examples you can draw code
Chris@23 126 from in order to provide the basic shape and structure of a Vamp
Chris@23 127 plugin. They are also intended to be correct and useful, if simple.
Chris@23 128
Chris@23 129 - ZeroCrossing calculates the positions and density of zero-crossing
Chris@23 130 points in an audio waveform.
Chris@23 131
Chris@23 132 - SpectralCentroid calculates the centre of gravity of the frequency
Chris@23 133 domain representation of each block of audio.
Chris@23 134
Chris@23 135 - PowerSpectrum calculates a power spectrum from the input audio.
Chris@23 136 Actually, it doesn't do any work except calculating power from a
Chris@23 137 cartesian complex FFT output. The work of calculating this frequency
Chris@23 138 domain output is done for it by the host or host SDK; the plugin just
Chris@23 139 needs to declare that it wants frequency domain input. This is the
Chris@23 140 simplest of the example plugins.
Chris@23 141
Chris@23 142 - AmplitudeFollower is a simple implementation of SuperCollider's
Chris@23 143 amplitude-follower algorithm.
Chris@23 144
Chris@23 145 - PercussionOnsetDetector estimates the locations of percussive
Chris@23 146 onsets using a simple method described in "Drum Source Separation
Chris@23 147 using Percussive Feature Detection and Spectral Modulation" by Dan
Chris@23 148 Barry, Derry Fitzgerald, Eugene Coyle and Bob Lawlor, ISSC 2005.
Chris@23 149
Chris@23 150 - FixedTempoEstimator calculates a single beats-per-minute value
Chris@23 151 which is an estimate of the tempo of a piece of music that is assumed
Chris@23 152 to be of fixed tempo, using autocorrelation of a frequency domain
Chris@23 153 energy rise metric. It has several outputs that return intermediate
Chris@23 154 results used in the calculation, and may be a useful example of a
Chris@23 155 plugin having several outputs with varying feature structures.
Chris@23 156
Chris@23 157
Chris@23 158 skeleton
Chris@23 159 --------
Chris@23 160
Chris@23 161 Skeleton code that could be used as a template for your new plugin
Chris@23 162 implementation.
Chris@23 163
Chris@23 164
Chris@23 165 host
Chris@23 166 ----
Chris@23 167
Chris@23 168 A simple command-line Vamp host, capable of loading a plugin and using
Chris@23 169 it to process a complete audio file, with its default parameters.
Chris@23 170
Chris@23 171 This host also contains a number of options for listing the installed
Chris@23 172 plugins and their properties in various formats. For that reason, it
Chris@23 173 isn't really as simple as one might hope. The core of the code is
Chris@23 174 still reasonably straightforward, however.
Chris@23 175
Chris@23 176
Chris@23 177 Plugin Lookup and Categorisation
Chris@23 178 ================================
Chris@23 179
Chris@23 180 The Vamp API does not officially specify how to load plugin libraries
Chris@23 181 or where to find them. However, the SDK does include a function
Chris@23 182 (Vamp::PluginHostAdapter::getPluginPath()) that returns a recommended
Chris@23 183 directory search path that hosts may use for plugin libraries, and a
Chris@23 184 class (Vamp::HostExt::PluginLoader) that implements a sensible
Chris@23 185 cross-platform lookup policy using this path. We recommend using this
Chris@23 186 class in your host unless you have a good reason not to want to. This
Chris@23 187 implementation also permits the user to set the environment variable
Chris@23 188 VAMP_PATH to override the default path if desired.
Chris@23 189
Chris@23 190 The policy used by Vamp::HostExt::PluginLoader -- and our
Chris@23 191 recommendation for any host -- is to search each directory in the path
Chris@23 192 returned by getPluginPath for .DLL (on Windows), .so (on Linux,
Chris@23 193 Solaris, BSD etc) or .dylib (on OS/X) files, then to load each one and
Chris@23 194 perform a dynamic name lookup on the vampGetPluginDescriptor function
Chris@23 195 to enumerate the plugins in the library. This operation will
Chris@23 196 necessarily be system-dependent.
Chris@23 197
Chris@23 198 Vamp also has an informal convention for sorting plugins into
Chris@23 199 functional categories. In addition to the library file itself, a
Chris@23 200 plugin library may install a category file with the same name as the
Chris@23 201 library but .cat extension. The existence and format of this file are
Chris@23 202 not specified by the Vamp API, but by convention the file may contain
Chris@23 203 lines of the format
Chris@23 204
Chris@23 205 vamp:pluginlibrary:pluginname::General Category > Specific Category
Chris@23 206
Chris@23 207 which a host may read and use to assign plugins a location within a
Chris@23 208 category tree for display to the user. The expectation is that
Chris@23 209 advanced users may also choose to set up their own preferred category
Chris@23 210 trees, which is why this information is not queried as part of the
Chris@23 211 Vamp plugin's API itself. The Vamp::HostExt::PluginLoader class also
Chris@23 212 provides support for plugin category lookup using this scheme.
Chris@23 213
Chris@23 214
Chris@23 215 Licensing
Chris@23 216 =========
Chris@23 217
Chris@23 218 This plugin SDK is freely redistributable under a "new-style BSD"
Chris@23 219 licence. See the file COPYING for more details. In short, you may
Chris@23 220 modify and redistribute the SDK and example plugins within any
Chris@23 221 commercial or non-commercial, proprietary or open-source plugin or
Chris@23 222 application under almost any conditions, with no obligation to provide
Chris@23 223 source code, provided you retain the original copyright note.
Chris@23 224
Chris@23 225
Chris@23 226 See Also
Chris@23 227 ========
Chris@23 228
Chris@23 229 Sonic Visualiser, an interactive open-source graphical audio
Chris@23 230 inspection, analysis and visualisation tool supporting Vamp plugins.
Chris@23 231 http://www.sonicvisualiser.org/
Chris@23 232
Chris@23 233
Chris@23 234 Authors
Chris@23 235 =======
Chris@23 236
Chris@23 237 Vamp and the Vamp SDK were designed and made at the Centre for Digital
Chris@23 238 Music at Queen Mary, University of London.
Chris@23 239
Chris@23 240 The SDK was written by Chris Cannam, copyright (c) 2005-2009
Chris@23 241 Chris Cannam and QMUL.
Chris@23 242
Chris@23 243 Mark Sandler and Christian Landone provided ideas and direction, and
Chris@23 244 Mark Levy, Dan Stowell, Martin Gasser and Craig Sapp provided testing
Chris@23 245 and other input for the 1.0 API and SDK. The API also uses some ideas
Chris@23 246 from prior plugin systems, notably DSSI (http://dssi.sourceforge.net)
Chris@23 247 and FEAPI (http://feapi.sourceforge.net).
Chris@23 248