comparison vamp-sdk/Plugin.h @ 9:44113b1e296b

* Add valueNames to parameter descriptor * Change valueCount and valueNames to binCount and binNames in output descriptor, to avoid confusion with other uses of value * Some explanatory notes about FFT alignment
author cannam
date Wed, 05 Apr 2006 16:50:07 +0000
parents c4662bbef275
children a67eeb9d6341
comparison
equal deleted inserted replaced
8:c4662bbef275 9:44113b1e296b
203 * The unit of the output, in human-readable form. 203 * The unit of the output, in human-readable form.
204 */ 204 */
205 std::string unit; 205 std::string unit;
206 206
207 /** 207 /**
208 * True if the output has the same number of values per result 208 * True if the output has the same number of values per sample
209 * for every output result. Outputs for which this is false 209 * for every output sample. Outputs for which this is false
210 * are unlikely to be very useful in a general-purpose host. 210 * are unlikely to be very useful in a general-purpose host.
211 */ 211 */
212 bool hasFixedValueCount; 212 bool hasFixedBinCount;
213 213
214 /** 214 /**
215 * The number of values per result of the output. Undefined 215 * The number of values per result of the output. Undefined
216 * if hasFixedValueCount is false. If this is zero, the output 216 * if hasFixedBinCount is false. If this is zero, the output
217 * is point data (i.e. only the time of each output is of 217 * is point data (i.e. only the time of each output is of
218 * interest, the value list will be empty). 218 * interest, the value list will be empty).
219 * 219 */
220 * Note that this gives the number of values of a single 220 size_t binCount;
221 * output result, not of the output stream (which has one more 221
222 * dimension: time). 222 /**
223 */ 223 * The names of each of the bins, if appropriate. This is
224 size_t valueCount;
225
226 /**
227 * The names of each of the values, if appropriate. This is
228 * always optional. 224 * always optional.
229 */ 225 */
230 std::vector<std::string> valueNames; 226 std::vector<std::string> binNames;
231 227
232 /** 228 /**
233 * True if the results in the output have a fixed numeric 229 * True if the results in each output bin fall within a fixed
234 * range (minimum and maximum values). Undefined if 230 * numeric range (minimum and maximum values). Undefined if
235 * valueCount is zero. 231 * binCount is zero.
236 */ 232 */
237 bool hasKnownExtents; 233 bool hasKnownExtents;
238 234
239 /** 235 /**
240 * Minimum value of the results in the output. Undefined if 236 * Minimum value of the results in the output. Undefined if
241 * hasKnownExtents is false or valueCount is zero. 237 * hasKnownExtents is false or binCount is zero.
242 */ 238 */
243 float minValue; 239 float minValue;
244 240
245 /** 241 /**
246 * Maximum value of the results in the output. Undefined if 242 * Maximum value of the results in the output. Undefined if
247 * hasKnownExtents is false or valueCount is zero. 243 * hasKnownExtents is false or binCount is zero.
248 */ 244 */
249 float maxValue; 245 float maxValue;
250 246
251 /** 247 /**
252 * True if the output values are quantized to a particular 248 * True if the output values are quantized to a particular
253 * resolution. Undefined if valueCount is zero. 249 * resolution. Undefined if binCount is zero.
254 */ 250 */
255 bool isQuantized; 251 bool isQuantized;
256 252
257 /** 253 /**
258 * Quantization resolution of the output values (e.g. 1.0 if 254 * Quantization resolution of the output values (e.g. 1.0 if
259 * they are all integers). Undefined if isQuantized is false 255 * they are all integers). Undefined if isQuantized is false
260 * or valueCount is zero. 256 * or binCount is zero.
261 */ 257 */
262 float quantizeStep; 258 float quantizeStep;
263 259
264 enum SampleType { 260 enum SampleType {
265 261
282 * Sample rate of the output results. Undefined if sampleType 278 * Sample rate of the output results. Undefined if sampleType
283 * is OneSamplePerStep. 279 * is OneSamplePerStep.
284 * 280 *
285 * If sampleType is VariableSampleRate and this value is 281 * If sampleType is VariableSampleRate and this value is
286 * non-zero, then it may be used to calculate a resolution for 282 * non-zero, then it may be used to calculate a resolution for
287 * the output (i.e. the "duration" of each value, in time). 283 * the output (i.e. the "duration" of each sample, in time).
288 * It's recommended to set this to zero if that behaviour is 284 * It's recommended to set this to zero if that behaviour is
289 * not desired. 285 * not desired.
290 */ 286 */
291 float sampleRate; 287 float sampleRate;
292 }; 288 };
316 */ 312 */
317 RealTime timestamp; 313 RealTime timestamp;
318 314
319 /** 315 /**
320 * Results for a single sample of this feature. If the output 316 * Results for a single sample of this feature. If the output
321 * hasFixedValueCount, there must be the same number of values 317 * hasFixedBinCount, there must be the same number of values
322 * as the output's valueCount count. 318 * as the output's binCount count.
323 */ 319 */
324 std::vector<float> values; 320 std::vector<float> values;
325 321
326 /** 322 /**
327 * Label for the sample of this feature. 323 * Label for the sample of this feature.
336 * Process a single block of input data. 332 * Process a single block of input data.
337 * 333 *
338 * If the plugin's inputDomain is TimeDomain, inputBuffers will 334 * If the plugin's inputDomain is TimeDomain, inputBuffers will
339 * point to one array of floats per input channel, and each of 335 * point to one array of floats per input channel, and each of
340 * these arrays will contain blockSize consecutive audio samples 336 * these arrays will contain blockSize consecutive audio samples
341 * (the host will zero-pad as necessary). 337 * (the host will zero-pad as necessary). The timestamp will be
338 * the real time in seconds of the start of the supplied block of
339 * samples.
342 * 340 *
343 * If the plugin's inputDomain is FrequencyDomain, inputBuffers 341 * If the plugin's inputDomain is FrequencyDomain, inputBuffers
344 * will point to one array of floats per input channel, and each 342 * will point to one array of floats per input channel, and each
345 * of these arrays will contain blockSize/2 consecutive pairs of 343 * of these arrays will contain blockSize/2 consecutive pairs of
346 * real and imaginary component floats corresponding to bins 344 * real and imaginary component floats corresponding to bins
347 * 0..(blockSize/2-1) of the FFT output. 345 * 0..(blockSize/2-1) of the FFT output. The timestamp will be
348 * 346 * the real time in seconds of the centre of the FFT input window
349 * The timestamp is the real time in seconds of the start of the 347 * (i.e. the very first block passed to process might contain the
350 * supplied block of samples. 348 * FFT of half a block of zero samples and the first half-block of
349 * the actual data, with a timestamp of zero).
351 * 350 *
352 * Return any features that have become available after this 351 * Return any features that have become available after this
353 * process call. (These do not necessarily have to fall within 352 * process call. (These do not necessarily have to fall within
354 * the process block, except for OneSamplePerStep outputs.) 353 * the process block, except for OneSamplePerStep outputs.)
355 */ 354 */