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