cannam@229
|
1
|
cannam@229
|
2 /** \mainpage Vamp Plugin SDK
|
cannam@229
|
3
|
cannam@229
|
4 \section about About Vamp
|
cannam@229
|
5
|
cannam@229
|
6 Vamp is an API for C and C++ plugins that process sampled audio data
|
cannam@229
|
7 to produce descriptive output (measurements or semantic observations).
|
cannam@229
|
8 Find more information at http://www.vamp-plugins.org/ .
|
cannam@229
|
9
|
cannam@229
|
10 Although the official API for Vamp plugins is defined in C for maximum
|
cannam@229
|
11 binary compatibility, we strongly recommend using the provided C++
|
cannam@229
|
12 classes in the SDK to implement your own plugins and hosts.
|
cannam@229
|
13
|
cannam@229
|
14 \section plugins For Plugins
|
cannam@229
|
15
|
cannam@229
|
16 Plugins should subclass Vamp::Plugin, and then use a
|
cannam@229
|
17 Vamp::PluginAdapter to expose the correct C API for the plugin. Read
|
cannam@229
|
18 the documentation for Vamp::PluginBase and Vamp::Plugin before
|
cannam@229
|
19 starting.
|
cannam@229
|
20
|
cannam@229
|
21 Plugins should be compiled and linked into dynamic libraries using the
|
cannam@229
|
22 usual convention for your platform, and should link (preferably
|
cannam@229
|
23 statically) with -lvamp-sdk. Any number of plugins can reside in a
|
cannam@229
|
24 single dynamic library. See plugins.cpp in the example plugins
|
cannam@229
|
25 directory for the sort of code that will need to accompany your plugin
|
cannam@229
|
26 class or classes, to make it possible for a host to look up your
|
cannam@229
|
27 plugins properly.
|
cannam@229
|
28
|
cannam@229
|
29 You will also need to ensure that the entry point
|
cannam@229
|
30 vampGetPluginDescriptor is properly exported (made public) from your
|
cannam@229
|
31 shared library. The method to do this depends on your linker; for
|
cannam@229
|
32 example, when using the Windows Visual Studio linker, use the linker
|
cannam@229
|
33 flag "/EXPORT:vampGetPluginDescriptor". Exported symbols are the
|
cannam@229
|
34 default with most other current platforms' linkers.
|
cannam@229
|
35
|
cannam@229
|
36 The following example plugins are provided. You may legally reuse any
|
cannam@229
|
37 amount of the code from these examples in any plugins you write,
|
cannam@229
|
38 whether proprietary or open-source.
|
cannam@229
|
39
|
cannam@229
|
40 - ZeroCrossing calculates the positions and density of zero-crossing
|
cannam@229
|
41 points in an audio waveform.
|
cannam@229
|
42
|
cannam@229
|
43 - SpectralCentroid calculates the centre of gravity of the frequency
|
cannam@229
|
44 domain representation of each block of audio.
|
cannam@229
|
45
|
cannam@229
|
46 - AmplitudeFollower is a simple implementation of SuperCollider's
|
cannam@229
|
47 amplitude-follower algorithm.
|
cannam@229
|
48
|
cannam@229
|
49 - PercussionOnsetDetector estimates the locations of percussive
|
cannam@229
|
50 onsets using a simple method described in "Drum Source Separation
|
cannam@229
|
51 using Percussive Feature Detection and Spectral Modulation" by Dan
|
cannam@229
|
52 Barry, Derry Fitzgerald, Eugene Coyle and Bob Lawlor, ISSC 2005.
|
cannam@229
|
53
|
cannam@229
|
54 - FixedTempoEstimator calculates a single bpm value which is an
|
cannam@229
|
55 estimate of the tempo of a piece of music that is assumed to be of
|
cannam@229
|
56 fixed tempo, using autocorrelation of a frequency domain energy rise
|
cannam@229
|
57 metric. It has several outputs that return intermediate results used
|
cannam@229
|
58 in the calculation, and may be a useful example of a plugin having
|
cannam@229
|
59 several outputs with varying feature structures.
|
cannam@229
|
60
|
cannam@229
|
61 \section hosts For Hosts
|
cannam@229
|
62
|
cannam@229
|
63 Hosts will normally use a Vamp::PluginHostAdapter to convert each
|
cannam@229
|
64 plugin's exposed C API back into a useful Vamp::Plugin C++ object.
|
cannam@229
|
65
|
cannam@229
|
66 Starting with version 1.1 of the Vamp SDK, there are several classes
|
cannam@229
|
67 in the Vamp::HostExt namespace that aim to make the host's life as
|
cannam@229
|
68 easy as possible:
|
cannam@229
|
69
|
cannam@229
|
70 - Vamp::HostExt::PluginLoader provides a very simple interface for a
|
cannam@229
|
71 host to discover, load, and find out category information about the
|
cannam@229
|
72 available plugins. Most "casual" Vamp hosts will probably want to
|
cannam@229
|
73 use this class.
|
cannam@229
|
74
|
cannam@229
|
75 - Vamp::HostExt::PluginInputDomainAdapter provides a simple means for
|
cannam@229
|
76 hosts to handle plugins that expect frequency-domain input, without
|
cannam@229
|
77 having to convert the input themselves.
|
cannam@229
|
78
|
cannam@229
|
79 - Vamp::HostExt::PluginChannelAdapter provides a simple means for
|
cannam@229
|
80 hosts to use plugins that do not necessarily support the same number
|
cannam@229
|
81 of audio channels as they have available, without having to apply a
|
cannam@229
|
82 channel management / mixdown policy themselves.
|
cannam@229
|
83
|
cannam@229
|
84 - Vamp::HostExt::PluginBufferingAdapter (new in version 1.2) provides
|
cannam@229
|
85 a means for hosts to avoid having to negotiate the input step and
|
cannam@229
|
86 block size, instead permitting the host to use any block size they
|
cannam@229
|
87 desire (and a step size equal to it). This is particularly useful
|
cannam@229
|
88 for "streaming" hosts that cannot seek backwards in the input audio
|
cannam@229
|
89 stream and so would otherwise need to implement an additional buffer
|
cannam@229
|
90 to support step sizes smaller than the block size.
|
cannam@229
|
91
|
cannam@229
|
92 - Vamp::HostExt::PluginSummarisingAdapter (new in version 2.0)
|
cannam@229
|
93 provides summarisation methods such as mean and median averages of
|
cannam@229
|
94 output features, for use in any context where an available plugin
|
cannam@229
|
95 produces individual values but the result that is actually needed
|
cannam@229
|
96 is some sort of aggregate.
|
cannam@229
|
97
|
cannam@229
|
98 The PluginLoader class can also use the input domain, channel, and
|
cannam@229
|
99 buffering adapters automatically to make these conversions transparent
|
cannam@229
|
100 to the host if required.
|
cannam@229
|
101
|
cannam@229
|
102 Hosts should link with -lvamp-hostsdk.
|
cannam@229
|
103
|
cannam@229
|
104 (The following notes in this section are mostly relevant for
|
cannam@229
|
105 developers that are not using the HostExt classes, or that wish to
|
cannam@229
|
106 know more about the policy they implement.)
|
cannam@229
|
107
|
cannam@229
|
108 The Vamp API does not officially specify how to load plugin libraries
|
cannam@229
|
109 or where to find them. However, the SDK does include a function
|
cannam@229
|
110 (Vamp::PluginHostAdapter::getPluginPath()) that returns a recommended
|
cannam@229
|
111 directory search path that hosts may use for plugin libraries.
|
cannam@229
|
112
|
cannam@229
|
113 Our suggestion for a host is to search each directory in this path for
|
cannam@229
|
114 .DLL (on Windows), .so (on Linux, Solaris, BSD etc) or .dylib (on
|
cannam@229
|
115 OS/X) files, then to load each one and perform a dynamic name lookup
|
cannam@229
|
116 on the vampGetPluginDescriptor function to enumerate the plugins in
|
cannam@229
|
117 the library. The example host has some code that may help, but this
|
cannam@229
|
118 operation will necessarily be system-dependent.
|
cannam@229
|
119
|
cannam@229
|
120 Vamp also has an informal convention for sorting plugins into
|
cannam@229
|
121 functional categories. In addition to the library file itself, a
|
cannam@229
|
122 plugin library may install a category file with the same name as the
|
cannam@229
|
123 library but .cat extension. The existence and format of this file are
|
cannam@229
|
124 not specified by the Vamp API, but by convention the file may contain
|
cannam@229
|
125 lines of the format
|
cannam@229
|
126
|
cannam@229
|
127 \code
|
cannam@229
|
128 vamp:pluginlibrary:pluginname::General Category > Specific Category
|
cannam@229
|
129 \endcode
|
cannam@229
|
130
|
cannam@229
|
131 which a host may read and use to assign plugins a location within a
|
cannam@229
|
132 category tree for display to the user. The expectation is that
|
cannam@229
|
133 advanced users may also choose to set up their own preferred category
|
cannam@229
|
134 trees, which is why this information is not queried as part of the
|
cannam@229
|
135 Vamp API itself.
|
cannam@229
|
136
|
cannam@229
|
137 There is an example host in the "host" directory from which code may
|
cannam@229
|
138 be drawn.
|
cannam@229
|
139
|
cannam@229
|
140 \section license License
|
cannam@229
|
141
|
cannam@229
|
142 This plugin SDK is freely redistributable under a "new-style BSD"
|
cannam@229
|
143 licence. See the file COPYING for more details. In short, you may
|
cannam@229
|
144 modify and redistribute the SDK and example plugins within any
|
cannam@229
|
145 commercial or non-commercial, proprietary or open-source plugin or
|
cannam@229
|
146 application under almost any conditions, with no obligation to provide
|
cannam@229
|
147 source code, provided you retain the original copyright note.
|
cannam@229
|
148
|
cannam@229
|
149
|
cannam@229
|
150 */
|