Mercurial > hg > vampy-host
changeset 117:2370b942cd32
Docs, make collect() return a dict so it can be more easily tested for shape, and rationalise some function naming etc
author | Chris Cannam |
---|---|
date | Wed, 17 Jun 2015 15:31:16 +0100 |
parents | 899095c8760f |
children | b56c1052d111 |
files | COPYING README native/FloatConversion.h native/PyPluginObject.cpp native/PyPluginObject.h native/PyRealTime.cpp native/PyRealTime.h native/StringConversion.h native/VectorConversion.cpp native/VectorConversion.h native/vampyhost.cpp test/test_collect.py test/test_process.py vamp/__init__.py vamp/collect.py vamp/frames.py vamp/load.py vamp/process.py |
diffstat | 18 files changed, 336 insertions(+), 46 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/COPYING Wed Jun 17 15:31:16 2015 +0100 @@ -0,0 +1,28 @@ + + Python Vamp Host + Copyright (c) 2008-2015 Queen Mary, University of London + + Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, copy, + modify, merge, publish, distribute, sublicense, and/or sell copies + of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF + CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Except as contained in this notice, the names of the Centre for + Digital Music and Queen Mary, University of London shall not be + used in advertising or otherwise to promote the sale, use or other + dealings in this Software without prior written authorization. +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Wed Jun 17 15:31:16 2015 +0100 @@ -0,0 +1,105 @@ + +Python Vamp plugin host +======================= + +This module allows Python code to load and use Vamp plugins for audio +feature analysis. + +It consists of a native-code extension ("vampyhost") which provides a +low-level wrapper for the Vamp plugin SDK, along with a Python module +("vamp") that provides a higher-level abstraction. + +No code for loading audio files etc is included; you'll need to use +some other module for that. + + +High-level interface (vamp) +--------------------------- + +This module contains three sorts of function: + + * Lookup functions: list_plugins, get_outputs_of, get_category_of + + These retrieve the installed plugin identifiers and get basic + information about each plugin. For more detailed information, + load a plugin and inspect it (using the low-level interface). + + * Process functions: process_audio, process_frames, + process_audio_multiple_outputs, process_frames_multiple_outputs + + These accept audio input, and produce output in the form of a list + of feature sets structured similarly to those in the C++ Vamp + plugin SDK. The plugin to be used is specified by its identifier. + + The _audio versions take a single (presumably long) array of audio + samples as input, and chop it into frames according to the plugin's + preferred step and block sizes. The _frames versions instead accept + an enumerable sequence of audio frame arrays. + + * The process-and-collect function: collect + + This accepts a single array of audio samples as input, and returns + an output structure that reflects the underlying structure of the + feature output (depending on whether it is a curve, grid, etc). The + plugin to be used is specified by its identifier. + + It processes the whole input before returning anything; if you need + to supply a streamed input, or retrieve results as they are + calculated, then you must use one of the process functions (above) + or the low-level interface (below) instead. + + +Low-level interface (vampyhost) +------------------------------- + +This module contains functions that operate on Vamp plugins in a way +analogous to the existing C++ Vamp Host SDK: list_plugins, +get_plugin_path, get_category_of, get_library_for, get_outputs_of, +load_plugin, and a utility function frame_to_realtime. + +Calling load_plugin gets you a vampyhost.Plugin object, which then +exposes all of the methods found in the Vamp SDK Plugin class. + +(Note that methods wrapped directly from the Vamp SDK are named using +camelCase, so as to match the SDK. Elsewhere this module follows +Python PEP8 naming.) + + +See the individual module and function documentation for more details. + + +A simple example +---------------- + +Using librosa (http://bmcfee.github.io/librosa/) for audio file I/O, +and the NNLS Chroma Vamp plugin +(https://code.soundsoftware.ac.uk/projects/nnls-chroma/) + +$ python +>>> import vamp +>>> import librosa +>>> data, rate = librosa.load("example.wav") +>>> collected = vamp.collect(data, rate, "nnls-chroma:nnls-chroma") +>>> collected +{'matrix': ( 0.092879819, array([[ 61.0532608 , 60.27478409, 59.3938446 , ..., 182.13394165, + 42.40084457, 116.55457306], + [ 68.8901825 , 63.98115921, 60.77633667, ..., 245.88218689, + 68.51251984, 164.70120239], + [ 58.59794617, 50.3429184 , 45.44804764, ..., 258.02362061, + 83.95749664, 179.91200256], + ..., + [ 0. , 0. , 0. , ..., 0. , + 0. , 0. ], + [ 0. , 0. , 0. , ..., 0. , + 0. , 0. ], + [ 0. , 0. , 0. , ..., 0. , + 0. , 0. ]], dtype=float32))} +>>> stepsize, chromadata = collected["matrix"] +>>> import matplotlib.pyplot as plt +>>> plt.imshow(chromadata) +<matplotlib.image.AxesImage object at 0x7fe9e0043fd0> +>>> plt.show() + +And a pitch-chroma plot appears (though it's rotated 90 degrees +compared with its more usual orientation). +
--- a/native/FloatConversion.h Wed Jun 17 13:03:37 2015 +0100 +++ b/native/FloatConversion.h Wed Jun 17 15:31:16 2015 +0100 @@ -7,7 +7,7 @@ Gyorgy Fazekas and Chris Cannam Centre for Digital Music, Queen Mary, University of London - Copyright 2008-2014 Queen Mary, University of London + Copyright 2008-2015 Queen Mary, University of London Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
--- a/native/PyPluginObject.cpp Wed Jun 17 13:03:37 2015 +0100 +++ b/native/PyPluginObject.cpp Wed Jun 17 15:31:16 2015 +0100 @@ -7,7 +7,7 @@ Gyorgy Fazekas and Chris Cannam Centre for Digital Music, Queen Mary, University of London - Copyright 2008-2014 Queen Mary, University of London + Copyright 2008-2015 Queen Mary, University of London Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
--- a/native/PyPluginObject.h Wed Jun 17 13:03:37 2015 +0100 +++ b/native/PyPluginObject.h Wed Jun 17 15:31:16 2015 +0100 @@ -7,7 +7,7 @@ Gyorgy Fazekas and Chris Cannam Centre for Digital Music, Queen Mary, University of London - Copyright 2008-2014 Queen Mary, University of London + Copyright 2008-2015 Queen Mary, University of London Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
--- a/native/PyRealTime.cpp Wed Jun 17 13:03:37 2015 +0100 +++ b/native/PyRealTime.cpp Wed Jun 17 15:31:16 2015 +0100 @@ -7,7 +7,7 @@ Gyorgy Fazekas and Chris Cannam Centre for Digital Music, Queen Mary, University of London - Copyright 2008-2014 Queen Mary, University of London + Copyright 2008-2015 Queen Mary, University of London Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
--- a/native/PyRealTime.h Wed Jun 17 13:03:37 2015 +0100 +++ b/native/PyRealTime.h Wed Jun 17 15:31:16 2015 +0100 @@ -7,7 +7,7 @@ Gyorgy Fazekas and Chris Cannam Centre for Digital Music, Queen Mary, University of London - Copyright 2008-2014 Queen Mary, University of London + Copyright 2008-2015 Queen Mary, University of London Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
--- a/native/StringConversion.h Wed Jun 17 13:03:37 2015 +0100 +++ b/native/StringConversion.h Wed Jun 17 15:31:16 2015 +0100 @@ -7,7 +7,7 @@ Gyorgy Fazekas and Chris Cannam Centre for Digital Music, Queen Mary, University of London - Copyright 2008-2014 Queen Mary, University of London + Copyright 2008-2015 Queen Mary, University of London Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
--- a/native/VectorConversion.cpp Wed Jun 17 13:03:37 2015 +0100 +++ b/native/VectorConversion.cpp Wed Jun 17 15:31:16 2015 +0100 @@ -7,7 +7,7 @@ Gyorgy Fazekas and Chris Cannam Centre for Digital Music, Queen Mary, University of London - Copyright 2008-2014 Queen Mary, University of London + Copyright 2008-2015 Queen Mary, University of London Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
--- a/native/VectorConversion.h Wed Jun 17 13:03:37 2015 +0100 +++ b/native/VectorConversion.h Wed Jun 17 15:31:16 2015 +0100 @@ -7,7 +7,7 @@ Gyorgy Fazekas and Chris Cannam Centre for Digital Music, Queen Mary, University of London - Copyright 2008-2014 Queen Mary, University of London + Copyright 2008-2015 Queen Mary, University of London Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
--- a/native/vampyhost.cpp Wed Jun 17 13:03:37 2015 +0100 +++ b/native/vampyhost.cpp Wed Jun 17 15:31:16 2015 +0100 @@ -7,7 +7,7 @@ Gyorgy Fazekas and Chris Cannam Centre for Digital Music, Queen Mary, University of London - Copyright 2008-2014 Queen Mary, University of London + Copyright 2008-2015 Queen Mary, University of London Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
--- a/test/test_collect.py Wed Jun 17 13:03:37 2015 +0100 +++ b/test/test_collect.py Wed Jun 17 15:31:16 2015 +0100 @@ -23,14 +23,16 @@ def test_collect_runs_at_all(): buf = input_data(blocksize * 10) - step, results = vamp.collect(buf, rate, plugin_key, "input-timestamp") + rdict = vamp.collect(buf, rate, plugin_key, "input-timestamp") + step, results = rdict["vector"] assert results != [] ##!!! add test for default output def test_collect_one_sample_per_step(): buf = input_data(blocksize * 10) - step, results = vamp.collect(buf, rate, plugin_key, "input-timestamp") + rdict = vamp.collect(buf, rate, plugin_key, "input-timestamp") + step, results = rdict["vector"] assert abs(float(step) - (1024.0 / rate)) < eps assert len(results) == 10 for i in range(len(results)): @@ -42,7 +44,8 @@ def test_collect_fixed_sample_rate(): buf = input_data(blocksize * 10) - step, results = vamp.collect(buf, rate, plugin_key, "curve-fsr") + rdict = vamp.collect(buf, rate, plugin_key, "curve-fsr") + step, results = rdict["vector"] assert abs(float(step) - 0.4) < eps assert len(results) == 10 for i in range(len(results)): @@ -50,7 +53,8 @@ def test_collect_fixed_sample_rate_2(): buf = input_data(blocksize * 10) - step, results = vamp.collect(buf, rate, plugin_key, "curve-fsr-timed") + rdict = vamp.collect(buf, rate, plugin_key, "curve-fsr-timed") + step, results = rdict["vector"] assert abs(float(step) - 0.4) < eps assert len(results) == 10 for i in range(len(results)): @@ -58,7 +62,8 @@ def test_collect_variable_sample_rate(): buf = input_data(blocksize * 10) - results = vamp.collect(buf, rate, plugin_key, "curve-vsr") + rdict = vamp.collect(buf, rate, plugin_key, "curve-vsr") + results = rdict["list"] assert len(results) == 10 i = 0 for r in results: @@ -68,7 +73,8 @@ def test_collect_grid_one_sample_per_step(): buf = input_data(blocksize * 10) - step, results = vamp.collect(buf, rate, plugin_key, "grid-oss") + rdict = vamp.collect(buf, rate, plugin_key, "grid-oss") + step, results = rdict["matrix"] assert abs(float(step) - (1024.0 / rate)) < eps assert len(results) == 10 for i in range(len(results)):
--- a/test/test_process.py Wed Jun 17 13:03:37 2015 +0100 +++ b/test/test_process.py Wed Jun 17 15:31:16 2015 +0100 @@ -47,7 +47,7 @@ def test_process_multi_summary_param(): buf = input_data(blocksize * 10) - results = list(vamp.process_multiple_outputs(buf, rate, plugin_key, [ "input-summary" ], { "produce_output": 0 })) + results = list(vamp.process_audio_multiple_outputs(buf, rate, plugin_key, [ "input-summary" ], { "produce_output": 0 })) assert len(results) == 0 def test_process_summary_param_bool(): @@ -57,7 +57,7 @@ def test_process_multi_summary_param_bool(): buf = input_data(blocksize * 10) - results = list(vamp.process_multiple_outputs(buf, rate, plugin_key, [ "input-summary" ], { "produce_output": False })) + results = list(vamp.process_audio_multiple_outputs(buf, rate, plugin_key, [ "input-summary" ], { "produce_output": False })) assert len(results) == 0 def test_process_summary(): @@ -91,7 +91,7 @@ def test_process_multi_summary(): buf = input_data(blocksize * 10) - results = list(vamp.process_multiple_outputs(buf, rate, plugin_key, [ "input-summary" ], {})) + results = list(vamp.process_audio_multiple_outputs(buf, rate, plugin_key, [ "input-summary" ], {})) assert len(results) == 10 for i in range(len(results)): # @@ -158,7 +158,7 @@ def test_process_multi_freq_summary(): buf = input_data(blocksize * 10) - results = list(vamp.process_multiple_outputs(buf, rate, plugin_key_freq, [ "input-summary" ], {})) + results = list(vamp.process_audio_multiple_outputs(buf, rate, plugin_key_freq, [ "input-summary" ], {})) assert len(results) == 20 for i in range(len(results)): expected = i * (blocksize/2) + blocksize/2 + 1 # "first" elt @@ -182,7 +182,7 @@ def test_process_multi_timestamps(): buf = input_data(blocksize * 10) - results = list(vamp.process_multiple_outputs(buf, rate, plugin_key, [ "input-timestamp" ])) + results = list(vamp.process_audio_multiple_outputs(buf, rate, plugin_key, [ "input-timestamp" ])) assert len(results) == 10 for i in range(len(results)): # The timestamp should be the frame number of the first frame in the @@ -204,7 +204,7 @@ def test_process_multi_freq_timestamps(): buf = input_data(blocksize * 10) - results = list(vamp.process_multiple_outputs(buf, rate, plugin_key_freq, [ "input-timestamp" ], {})) + results = list(vamp.process_audio_multiple_outputs(buf, rate, plugin_key_freq, [ "input-timestamp" ], {})) assert len(results) == 20 for i in range(len(results)): # The timestamp should be the frame number of the frame just beyond @@ -215,7 +215,7 @@ def test_process_multiple_outputs(): buf = input_data(blocksize * 10) - results = list(vamp.process_multiple_outputs(buf, rate, plugin_key, [ "input-summary", "input-timestamp" ], {})) + results = list(vamp.process_audio_multiple_outputs(buf, rate, plugin_key, [ "input-summary", "input-timestamp" ], {})) assert len(results) == 20 si = 0 ti = 0
--- a/vamp/__init__.py Wed Jun 17 13:03:37 2015 +0100 +++ b/vamp/__init__.py Wed Jun 17 15:31:16 2015 +0100 @@ -1,8 +1,37 @@ +#!/usr/bin/env python + +# Python Vamp Host +# Copyright (c) 2008-2015 Queen Mary, University of London +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the names of the Centre for +# Digital Music and Queen Mary, University of London shall not be +# used in advertising or otherwise to promote the sale, use or other +# dealings in this Software without prior written authorization. + '''A high-level interface to the vampyhost extension module, for quickly and easily running Vamp audio analysis plugins on audio files and buffers.''' import vampyhost from vamp.load import list_plugins, get_outputs_of, get_category_of -from vamp.process import process_audio, process_frames, process_multiple_outputs, process_frames_multiple_outputs +from vamp.process import process_audio, process_frames, process_audio_multiple_outputs, process_frames_multiple_outputs from vamp.collect import collect
--- a/vamp/collect.py Wed Jun 17 13:03:37 2015 +0100 +++ b/vamp/collect.py Wed Jun 17 15:31:16 2015 +0100 @@ -1,3 +1,32 @@ +#!/usr/bin/env python + +# Python Vamp Host +# Copyright (c) 2008-2015 Queen Mary, University of London +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the names of the Centre for +# Digital Music and Queen Mary, University of London shall not be +# used in advertising or otherwise to promote the sale, use or other +# dealings in this Software without prior written authorization. + '''A high-level interface to the vampyhost extension module, for quickly and easily running Vamp audio analysis plugins on audio files and buffers.''' import vampyhost @@ -49,22 +78,21 @@ def deduce_shape(output_desc): if output_desc["hasDuration"]: - return "individual" + return "list" if output_desc["sampleType"] == vampyhost.VARIABLE_SAMPLE_RATE: - return "individual" + return "list" if not output_desc["hasFixedBinCount"]: - return "individual" + return "list" if output_desc["binCount"] == 0: - return "individual" + return "list" if output_desc["binCount"] == 1: return "vector" return "matrix" -def reshape(results, sample_rate, step_size, output_desc): +def reshape(results, sample_rate, step_size, output_desc, shape): output = output_desc["identifier"] - shape = deduce_shape(output_desc) out_step = get_feature_step_time(sample_rate, step_size, output_desc) if shape == "vector": @@ -97,31 +125,37 @@ by setting its parameters according to the (string) key and (float) value data found in the dict. - The structure in which the results are returned depends upon the - output descriptor for the requested plugin output, as follows: + The results are returned in a dictionary which will always contain + exactly one element, whose key is one of the strings "vector", + "matrix", or "list". Which one is used depends on the structure of + features set out in the output descriptor for the requested plugin + output: * If the plugin output emits single-valued features at a fixed - sample-rate, then this function will return a tuple of step time - (the time in seconds between consecutive feature values) and a - one-dimensional NumPy array of feature values. An example of - such a feature might be a loudness curve against time. + sample-rate, then the "vector" element will be used. It will + contain a tuple of step time (the time in seconds between + consecutive feature values) and a one-dimensional NumPy array of + feature values. An example of such a feature might be a loudness + curve against time. * If the plugin output emits multiple-valued features, with an equal number of bins per feature, at a fixed sample-rate, then - this function will return a tuple of step time (the time in - seconds between consecutive feature values) and a - two-dimensional NumPy array of feature values. An example of - such a feature might be a spectrogram. + the "matrix" element will be used. It will contain a tuple of + step time (the time in seconds between consecutive feature + values) and a two-dimensional NumPy array of feature values. An + example of such a feature might be a spectrogram. - * Otherwise this function will return a list of features, where - each feature is represented as a dictionary containing a - timestamp (always) and a duration (optionally), a label - (string), and a 1-dimensional array of float values. + * Otherwise, the "list" element will be used, and will contain a + list of features, where each feature is represented as a + dictionary containing a timestamp (always) and a duration + (optionally), a label (string), and a 1-dimensional array of + float values. If you would prefer to obtain features as they are calculated (where the plugin supports this) and with the format in which the plugin returns them, via an asynchronous generator function, use vamp.process() instead. + """ plugin, step_size, block_size = vamp.load.load_and_configure(data, sample_rate, key, parameters) @@ -136,8 +170,9 @@ results = vamp.process.process_with_initialised_plugin(ff, sample_rate, step_size, plugin, [output]) - rv = reshape(results, sample_rate, step_size, output_desc) + shape = deduce_shape(output_desc) + rv = reshape(results, sample_rate, step_size, output_desc, shape) plugin.unload() - return rv + return { shape : rv }
--- a/vamp/frames.py Wed Jun 17 13:03:37 2015 +0100 +++ b/vamp/frames.py Wed Jun 17 15:31:16 2015 +0100 @@ -1,3 +1,32 @@ +#!/usr/bin/env python + +# Python Vamp Host +# Copyright (c) 2008-2015 Queen Mary, University of London +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the names of the Centre for +# Digital Music and Queen Mary, University of London shall not be +# used in advertising or otherwise to promote the sale, use or other +# dealings in this Software without prior written authorization. + '''A high-level interface to the vampyhost extension module, for quickly and easily running Vamp audio analysis plugins on audio files and buffers.''' import numpy
--- a/vamp/load.py Wed Jun 17 13:03:37 2015 +0100 +++ b/vamp/load.py Wed Jun 17 15:31:16 2015 +0100 @@ -1,3 +1,32 @@ +#!/usr/bin/env python + +# Python Vamp Host +# Copyright (c) 2008-2015 Queen Mary, University of London +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the names of the Centre for +# Digital Music and Queen Mary, University of London shall not be +# used in advertising or otherwise to promote the sale, use or other +# dealings in this Software without prior written authorization. + '''A high-level interface to the vampyhost extension module, for quickly and easily running Vamp audio analysis plugins on audio files and buffers.''' import vampyhost
--- a/vamp/process.py Wed Jun 17 13:03:37 2015 +0100 +++ b/vamp/process.py Wed Jun 17 15:31:16 2015 +0100 @@ -1,3 +1,32 @@ +#!/usr/bin/env python + +# Python Vamp Host +# Copyright (c) 2008-2015 Queen Mary, University of London +# +# Permission is hereby granted, free of charge, to any person +# obtaining a copy of this software and associated documentation +# files (the "Software"), to deal in the Software without +# restriction, including without limitation the rights to use, copy, +# modify, merge, publish, distribute, sublicense, and/or sell copies +# of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be +# included in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF +# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the names of the Centre for +# Digital Music and Queen Mary, University of London shall not be +# used in advertising or otherwise to promote the sale, use or other +# dealings in this Software without prior written authorization. + '''A high-level interface to the vampyhost extension module, for quickly and easily running Vamp audio analysis plugins on audio files and buffers.''' import vampyhost @@ -140,7 +169,7 @@ plugin.unload() -def process_multiple_outputs(data, sample_rate, key, outputs, parameters = {}): +def process_audio_multiple_outputs(data, sample_rate, key, outputs, parameters = {}): """Process audio data with a Vamp plugin, and make the results from a set of plugin outputs available as a generator.