changeset 112:19e47ffed525

Rearrange and rename VamPipe -> Piper as appropriate
author Chris Cannam <c.cannam@qmul.ac.uk>
date Mon, 10 Oct 2016 17:05:37 +0100
parents 02b69e2dc51f
children 00221fb5b9d2
files .hgignore Makefile.inc.em Makefile.qm-vamp-plugins.em Makefile.silvet.em Makefile.testplugin.em PiperAdapter.h PiperPluginLibrary.cpp PiperPluginLibrary.h VamPipeAdapter.h VamPipePluginLibrary.cpp VamPipePluginLibrary.h example.cpp perf-test-node.js perf-test.js qm-vamp-plugins.cpp quick-test.html quick-test.js silvet.cpp vamp-test-plugin.cpp
diffstat 19 files changed, 661 insertions(+), 657 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Mon Oct 10 17:05:37 2016 +0100
@@ -0,0 +1,2 @@
+syntax: glob
+*.o
--- a/Makefile.inc.em	Fri Oct 07 16:43:18 2016 +0100
+++ b/Makefile.inc.em	Mon Oct 10 17:05:37 2016 +0100
@@ -1,8 +1,9 @@
 
-ADAPTER_HEADERS	:= VamPipeAdapter.h VamPipePluginLibrary.h 
-ADAPTER_SOURCES	:= VamPipePluginLibrary.cpp
+ADAPTER_HEADERS	:= PiperAdapter.h PiperPluginLibrary.h 
+ADAPTER_SOURCES	:= PiperPluginLibrary.cpp
 
 SDK_DIR		:= ../vamp-plugin-sdk
+PIPERCPP_DIR    := ../piper-cpp
 
 SDK_SOURCES	:= \
         	$(SDK_DIR)/src/vamp-hostsdk/PluginBufferingAdapter.cpp \
@@ -19,7 +20,7 @@
 		$(SDK_DIR)/src/vamp-sdk/FFT.cpp
 
 OTHER_SOURCES	:= \
-		../json/json11/json11.cpp
+		$(PIPERCPP_DIR)/json11/json11.cpp
 
 MODULE_EXT	:= .js
 MODULE		:= $(MODULE_NAME)$(MODULE_EXT)
@@ -31,7 +32,7 @@
 		-s NO_FILESYSTEM=1 \
 		-s ERROR_ON_UNDEFINED_SYMBOLS=1 \
 	    	-s EXPORT_NAME="'$(MODULE_SYMBOL)'" \
-	    	-s EXPORTED_FUNCTIONS="['_vampipeRequestJson','_vampipeProcessRaw','_vampipeFreeJson']" \
+	    	-s EXPORTED_FUNCTIONS="['_piperRequestJson','_piperProcessRaw','_piperFreeJson']" \
 		$(EMFLAGS)
 
 CXX_SOURCES	:= $(MODULE_SOURCE) $(ADAPTER_SOURCES) $(PLUGIN_SOURCES) $(SDK_SOURCES) $(OTHER_SOURCES)
@@ -45,7 +46,7 @@
 
 DEFINES		:= $(DEFINES)
 
-INCPATH		:= -I$(SDK_DIR) -I.. -I../json $(INCPATH)
+INCPATH		:= -I$(SDK_DIR) -I$(PIPERCPP_DIR) $(INCPATH)
 
 CXXFLAGS	:= -std=c++11 -fPIC -Wall -Wextra $(DEFINES) $(OPTFLAGS) $(EMFLAGS) $(INCPATH)
 CFLAGS		:= -fPIC -Wall -Wextra $(DEFINES) $(OPTFLAGS) $(EMFLAGS) $(INCPATH)
--- a/Makefile.qm-vamp-plugins.em	Fri Oct 07 16:43:18 2016 +0100
+++ b/Makefile.qm-vamp-plugins.em	Mon Oct 10 17:05:37 2016 +0100
@@ -1,7 +1,7 @@
 
 MODULE_NAME	:= QMVampPlugins
 
-QMV	:= ../../qm-vamp-plugins
+QMV	:= ../qm-vamp-plugins
 DSP	:= $(QMV)/qm-dsp
 EXT	:= $(DSP)/ext
 
--- a/Makefile.silvet.em	Fri Oct 07 16:43:18 2016 +0100
+++ b/Makefile.silvet.em	Mon Oct 10 17:05:37 2016 +0100
@@ -1,7 +1,7 @@
 
 MODULE_NAME	:= Silvet
 
-SILVET_DIR	:= ../../silvet
+SILVET_DIR	:= ../silvet
 
 SRC_DIR		:= $(SILVET_DIR)/src
 CQ_DIR	     	:= $(SILVET_DIR)/constant-q-cpp
--- a/Makefile.testplugin.em	Fri Oct 07 16:43:18 2016 +0100
+++ b/Makefile.testplugin.em	Mon Oct 10 17:05:37 2016 +0100
@@ -1,7 +1,7 @@
 
 MODULE_NAME	:= VampTestPlugin
 
-TESTPLUGIN_DIR	:= ../../vamp-test-plugin
+TESTPLUGIN_DIR	:= ../vamp-test-plugin
 
 INCPATH		:= -I$(TESTPLUGIN_DIR)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PiperAdapter.h	Mon Oct 10 17:05:37 2016 +0100
@@ -0,0 +1,142 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+
+/*
+    Piper Vamp JSON Adapter
+
+    Centre for Digital Music, Queen Mary, University of London.
+    Copyright 2015-2016 QMUL.
+  
+    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 AUTHORS 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; Queen Mary, University of London; and Chris Cannam
+    shall not be used in advertising or otherwise to promote the sale,
+    use or other dealings in this Software without prior written
+    authorization.
+*/
+
+#ifndef PIPER_ADAPTER_H
+#define PIPER_ADAPTER_H
+
+#include <vamp-hostsdk/PluginStaticData.h>
+#include <vamp-hostsdk/PluginConfiguration.h>
+#include <vamp-hostsdk/RequestResponse.h>
+
+#include <vamp-hostsdk/PluginInputDomainAdapter.h>
+#include <vamp-hostsdk/PluginBufferingAdapter.h>
+#include <vamp-hostsdk/PluginChannelAdapter.h>
+
+namespace piper {
+
+class PiperAdapterInterface
+{
+public:
+    virtual Vamp::HostExt::PluginStaticData getStaticData() const = 0;
+    virtual Vamp::HostExt::LoadResponse loadPlugin(Vamp::HostExt::LoadRequest r) const = 0;
+    virtual Vamp::Plugin *createPlugin(float inputSampleRate) const = 0;
+};
+
+template <typename P>
+class PiperAdapterBase : public PiperAdapterInterface
+{
+    const int adaptInputDomain = 0x01;
+    const int adaptChannelCount = 0x02;
+    const int adaptBufferSize = 0x04;
+
+protected:
+    PiperAdapterBase(std::string libname) : m_soname(libname) { }
+    
+public:
+    virtual Vamp::Plugin *createPlugin(float inputSampleRate) const = 0;
+    
+    virtual Vamp::HostExt::PluginStaticData getStaticData() const {
+        Vamp::Plugin *p = createPlugin(44100.f);
+	auto data = Vamp::HostExt::PluginStaticData::fromPlugin
+	    (m_soname + ":" + p->getIdentifier(),
+	     {}, //!!! todo: category - tricky one that
+	     p);
+        delete p;
+        return data;
+    }
+
+    virtual Vamp::HostExt::LoadResponse loadPlugin(Vamp::HostExt::
+						   LoadRequest r) const {
+	
+	// We assume the caller has guaranteed that the request is for
+	// the correct plugin (so we don't have to check the plugin
+	// key field here)
+
+	Vamp::Plugin *p = createPlugin(r.inputSampleRate);
+	
+	if (r.adapterFlags & adaptInputDomain) {
+	    if (p->getInputDomain() == Vamp::Plugin::FrequencyDomain) {
+		p = new Vamp::HostExt::PluginInputDomainAdapter(p);
+	    }
+	}
+
+	if (r.adapterFlags & adaptBufferSize) {
+	    p = new Vamp::HostExt::PluginBufferingAdapter(p);
+	}
+
+	if (r.adapterFlags & adaptChannelCount) {
+	    p = new Vamp::HostExt::PluginChannelAdapter(p);
+	}
+
+	Vamp::HostExt::LoadResponse response;
+	response.plugin = p;
+
+	response.staticData = Vamp::HostExt::PluginStaticData::fromPlugin
+	    (m_soname + ":" + p->getIdentifier(),
+	     {}, //!!! todo: category - tricky one that
+	     p);
+
+	int defaultChannels = 0;
+	if (p->getMinChannelCount() == p->getMaxChannelCount()) {
+	    defaultChannels = p->getMinChannelCount();
+	}
+    
+	response.defaultConfiguration = Vamp::HostExt::PluginConfiguration::fromPlugin
+	    (p,
+	     defaultChannels,
+	     p->getPreferredStepSize(),
+	     p->getPreferredBlockSize());
+    
+	return response;
+    }
+    
+private:
+    std::string m_soname;
+};
+
+template <typename P>
+class PiperAdapter : public PiperAdapterBase<P>
+{
+public:
+    PiperAdapter(std::string libname) : PiperAdapterBase<P>(libname) { }
+    
+    virtual Vamp::Plugin *createPlugin(float inputSampleRate) const {
+        return new P(inputSampleRate);
+    }
+};
+
+}
+
+#endif
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PiperPluginLibrary.cpp	Mon Oct 10 17:05:37 2016 +0100
@@ -0,0 +1,322 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+
+/*
+    Piper Vamp JSON Adapter
+
+    Centre for Digital Music, Queen Mary, University of London.
+    Copyright 2015-2016 QMUL.
+  
+    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 AUTHORS 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; Queen Mary, University of London; and Chris Cannam
+    shall not be used in advertising or otherwise to promote the sale,
+    use or other dealings in this Software without prior written
+    authorization.
+*/
+
+#include "PiperPluginLibrary.h"
+#include "PiperAdapter.h"
+
+#include "vamp-json/VampJson.h"
+
+using namespace std;
+using namespace json11;
+
+namespace piper {
+
+//!!! too many explicit namespaces here
+
+//!!! dup with piper-convert
+Json
+convertRequestJson(string input, string &err)
+{
+    Json j = Json::parse(input, err);
+    if (err != "") {
+	err = "invalid json: " + err;
+	return {};
+    }
+    if (!j.is_object()) {
+	err = "object expected at top level";
+    }
+    return j;
+}
+
+PiperPluginLibrary::PiperPluginLibrary(vector<PiperAdapterInterface *> pp) :
+    m_useBase64(false)
+{
+    for (PiperAdapterInterface *p: pp) {
+	string key = p->getStaticData().pluginKey;
+	m_adapters[key] = p;
+    }
+}
+
+Vamp::HostExt::ListResponse
+PiperPluginLibrary::listPluginData() const
+{
+    Vamp::HostExt::ListResponse resp;
+    for (auto a: m_adapters) {
+	resp.available.push_back(a.second->getStaticData());
+    }
+    return resp;
+}
+
+Vamp::HostExt::LoadResponse
+PiperPluginLibrary::loadPlugin(Vamp::HostExt::LoadRequest req, string &err) const
+{
+    string key = req.pluginKey;
+    if (m_adapters.find(key) != m_adapters.end()) {
+        auto resp = m_adapters.at(key)->loadPlugin(req);
+        if (!resp.plugin) {
+            // This should not actually happen -- the load call here
+            // is just an object construction, not a dynamic load. But
+            // report it if it does...
+            err = "failed to construct plugin with key " + key;
+        }
+        return resp;
+    } else {
+	err = "no adapter for plugin key " + key;
+        return {};
+    }
+}
+
+Vamp::HostExt::ConfigurationResponse
+PiperPluginLibrary::configurePlugin(Vamp::HostExt::ConfigurationRequest req,
+                                      string &err) const
+{
+    for (Vamp::HostExt::PluginConfiguration::ParameterMap::const_iterator i =
+             req.configuration.parameterValues.begin();
+         i != req.configuration.parameterValues.end(); ++i) {
+        req.plugin->setParameter(i->first, i->second);
+    }
+
+    if (req.configuration.currentProgram != "") {
+        req.plugin->selectProgram(req.configuration.currentProgram);
+    }
+
+    Vamp::HostExt::ConfigurationResponse response;
+
+    response.plugin = req.plugin;
+
+    if (req.plugin->initialise(req.configuration.channelCount,
+                               req.configuration.stepSize,
+                               req.configuration.blockSize)) {
+        response.outputs = req.plugin->getOutputDescriptors();
+    } else {
+        err = "configuration failed (wrong channel count, step size, block size?)";
+    }
+
+    return response;
+}
+
+string
+PiperPluginLibrary::processRawImpl(int handle,
+                                     const float *const *inputBuffers,
+                                     int sec,
+                                     int nsec)
+{
+    Vamp::Plugin *plugin = m_mapper.handleToPlugin(handle);
+    if (!plugin) {
+        return VampJson::fromError("unknown plugin handle",
+                                   RRType::Process, Json())
+            .dump();
+    }
+    
+    if (!m_mapper.isConfigured(handle)) {
+        return VampJson::fromError("plugin has not been configured",
+                                   RRType::Process, Json())
+            .dump();
+    }
+
+    Vamp::RealTime timestamp(sec, nsec);
+
+    Vamp::HostExt::ProcessResponse resp;
+    resp.plugin = plugin;
+    resp.features = plugin->process(inputBuffers, timestamp);
+    
+    m_useBase64 = true;
+    
+    return VampJson::fromRpcResponse_Process
+        (resp, m_mapper,
+         VampJson::BufferSerialisation::Base64,
+         Json())
+        .dump();
+}
+
+string
+PiperPluginLibrary::requestJsonImpl(string req)
+{
+    string err;
+    
+    Json j = convertRequestJson(req, err);
+
+    // we don't care what this is, only that it is retained in the response:
+    auto id = j["id"];
+
+    Json rj;
+    if (err != "") {
+        return VampJson::fromError(err, RRType::NotValid, id).dump();
+    }
+    
+    RRType type = VampJson::getRequestResponseType(j, err);
+    if (err != "") {
+        return VampJson::fromError(err, RRType::NotValid, id).dump();
+    }
+
+    VampJson::BufferSerialisation serialisation =
+        (m_useBase64 ?
+         VampJson::BufferSerialisation::Base64 :
+         VampJson::BufferSerialisation::Array);
+    
+    switch (type) {
+
+    case RRType::List:
+        rj = VampJson::fromRpcResponse_List(listPluginData(), id);
+        break;
+
+    case RRType::Load:
+    {
+        auto req = VampJson::toRpcRequest_Load(j, err);
+        if (err != "") {
+            rj = VampJson::fromError(err, type, id);
+        } else {
+            auto resp = loadPlugin(req, err);
+            if (err != "") {
+                rj = VampJson::fromError(err, type, id);
+            } else {
+                m_mapper.addPlugin(resp.plugin);
+                rj = VampJson::fromRpcResponse_Load(resp, m_mapper, id);
+            }
+        }
+        break;
+    }
+
+    case RRType::Configure:
+    {
+        auto req = VampJson::toRpcRequest_Configure(j, m_mapper, err);
+        if (err != "") {
+            rj = VampJson::fromError(err, type, id);
+        } else {
+            auto h = m_mapper.pluginToHandle(req.plugin);
+            if (h == m_mapper.INVALID_HANDLE) {
+                rj = VampJson::fromError("unknown or invalid plugin handle", type, id);
+            } else if (m_mapper.isConfigured(h)) {
+                rj = VampJson::fromError("plugin has already been configured", type, id);
+            } else {
+                auto resp = configurePlugin(req, err);
+                if (err != "") {
+                    rj = VampJson::fromError(err, type, id);
+                } else {
+                    m_mapper.markConfigured(h,
+                                            req.configuration.channelCount,
+                                            req.configuration.blockSize);
+                    rj = VampJson::fromRpcResponse_Configure(resp, m_mapper, id);
+                }
+            }
+        }
+        break;
+    }
+
+    case RRType::Process:
+    {
+        VampJson::BufferSerialisation serialisation;
+            
+        auto req = VampJson::toRpcRequest_Process(j, m_mapper,
+                                                   serialisation, err);
+        if (err != "") {
+            rj = VampJson::fromError(err, type, id);
+        } else {
+            auto h = m_mapper.pluginToHandle(req.plugin);
+            int channels = int(req.inputBuffers.size());
+            if (h == m_mapper.INVALID_HANDLE) {
+                rj = VampJson::fromError("unknown or invalid plugin handle", type, id);
+            } else if (!m_mapper.isConfigured(h)) {
+                rj = VampJson::fromError("plugin has not been configured", type, id);
+            } else if (channels != m_mapper.getChannelCount(h)) {
+                rj = VampJson::fromError("wrong number of channels supplied", type, id);
+            } else {
+
+                if (serialisation == VampJson::BufferSerialisation::Base64) {
+                    m_useBase64 = true;
+                }
+
+                size_t blockSize = m_mapper.getBlockSize(h);
+                
+                const float **fbuffers = new const float *[channels];
+                for (int i = 0; i < channels; ++i) {
+                    if (req.inputBuffers[i].size() != blockSize) {
+                        delete[] fbuffers;
+                        fbuffers = 0;
+                        rj = VampJson::fromError("wrong block size supplied", type, id);
+                        break;
+                    }
+                    fbuffers[i] = req.inputBuffers[i].data();
+                }
+
+                if (fbuffers) {
+                    Vamp::HostExt::ProcessResponse resp;
+                    resp.plugin = req.plugin;
+                    resp.features = req.plugin->process(fbuffers, req.timestamp);
+                    delete[] fbuffers;
+                    rj = VampJson::fromRpcResponse_Process
+                        (resp, m_mapper, serialisation, id);
+                }
+            }
+        }
+        break;
+    }
+
+    case RRType::Finish:
+    {
+        auto req = VampJson::toRpcRequest_Finish(j, m_mapper, err);
+        if (err != "") {
+            rj = VampJson::fromError(err, type, id);
+        } else {
+            auto h = m_mapper.pluginToHandle(req.plugin);
+            if (h == m_mapper.INVALID_HANDLE) {
+                rj = VampJson::fromError("unknown or invalid plugin handle", type, id);
+            } else if (!m_mapper.isConfigured(h)) {
+                rj = VampJson::fromError("plugin has not been configured", type, id);
+            } else {
+
+                Vamp::HostExt::ProcessResponse resp;
+                resp.plugin = req.plugin;
+                resp.features = req.plugin->getRemainingFeatures();
+
+                rj = VampJson::fromRpcResponse_Finish
+                    (resp, m_mapper, serialisation, id);
+	
+                m_mapper.removePlugin(h);
+                delete req.plugin;
+            }
+        }
+        break;
+    }
+
+    case RRType::NotValid:
+        rj = VampJson::fromError("invalid request", type, id);
+        break;
+    }
+
+    return rj.dump();
+}
+
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PiperPluginLibrary.h	Mon Oct 10 17:05:37 2016 +0100
@@ -0,0 +1,89 @@
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
+
+/*
+    Piper Vamp JSON Adapter
+
+    Centre for Digital Music, Queen Mary, University of London.
+    Copyright 2015-2016 QMUL.
+  
+    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 AUTHORS 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; Queen Mary, University of London; and Chris Cannam
+    shall not be used in advertising or otherwise to promote the sale,
+    use or other dealings in this Software without prior written
+    authorization.
+*/
+
+#ifndef PIPER_PLUGIN_LIBRARY_H
+#define PIPER_PLUGIN_LIBRARY_H
+
+#include "vamp-support/CountingPluginHandleMapper.h"
+
+#include <vamp-hostsdk/PluginStaticData.h>
+#include <vamp-hostsdk/RequestResponse.h>
+
+#include <vector>
+#include <string>
+#include <cstring>
+
+namespace piper {
+
+class PiperAdapterInterface;
+
+class PiperPluginLibrary
+{
+public:
+    PiperPluginLibrary(std::vector<PiperAdapterInterface *> pp);
+    
+    const char *requestJson(const char *request) {
+	return strdup(requestJsonImpl(request).c_str());
+    }
+
+    const char *processRaw(int handle, const float *const *inputBuffers,
+                           int sec, int nsec) {
+        return strdup(processRawImpl(handle, inputBuffers, sec, nsec).c_str());
+    }
+    
+    void freeJson(const char *json) {
+	free(const_cast<char *>(json));
+    }
+    
+private:
+    std::string requestJsonImpl(std::string req);
+    std::string processRawImpl(int, const float *const *, int, int);
+
+    Vamp::HostExt::ListResponse listPluginData() const;
+    Vamp::HostExt::LoadResponse loadPlugin(Vamp::HostExt::LoadRequest r,
+                                           std::string &err) const;
+    Vamp::HostExt::ConfigurationResponse configurePlugin(Vamp::HostExt::
+							 ConfigurationRequest r,
+                                                         std::string &err)
+        const;
+
+    // map from pluginKey -> adapter
+    std::map<std::string, PiperAdapterInterface *> m_adapters;
+    CountingPluginHandleMapper m_mapper;
+    bool m_useBase64;
+};
+
+}
+
+#endif
--- a/VamPipeAdapter.h	Fri Oct 07 16:43:18 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
-
-/*
-    VamPipe
-
-    Centre for Digital Music, Queen Mary, University of London.
-    Copyright 2015-2016 QMUL.
-  
-    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 AUTHORS 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; Queen Mary, University of London; and Chris Cannam
-    shall not be used in advertising or otherwise to promote the sale,
-    use or other dealings in this Software without prior written
-    authorization.
-*/
-
-#ifndef VAMPIPE_ADAPTER_H
-#define VAMPIPE_ADAPTER_H
-
-#include <vamp-hostsdk/PluginStaticData.h>
-#include <vamp-hostsdk/PluginConfiguration.h>
-#include <vamp-hostsdk/RequestResponse.h>
-
-#include <vamp-hostsdk/PluginInputDomainAdapter.h>
-#include <vamp-hostsdk/PluginBufferingAdapter.h>
-#include <vamp-hostsdk/PluginChannelAdapter.h>
-
-namespace vampipe {
-
-class VamPipeAdapterInterface
-{
-public:
-    virtual Vamp::HostExt::PluginStaticData getStaticData() const = 0;
-    virtual Vamp::HostExt::LoadResponse loadPlugin(Vamp::HostExt::LoadRequest r) const = 0;
-    virtual Vamp::Plugin *createPlugin(float inputSampleRate) const = 0;
-};
-
-template <typename P>
-class VamPipeAdapterBase : public VamPipeAdapterInterface
-{
-    const int adaptInputDomain = 0x01;
-    const int adaptChannelCount = 0x02;
-    const int adaptBufferSize = 0x04;
-
-protected:
-    VamPipeAdapterBase(std::string libname) : m_soname(libname) { }
-    
-public:
-    virtual Vamp::Plugin *createPlugin(float inputSampleRate) const = 0;
-    
-    virtual Vamp::HostExt::PluginStaticData getStaticData() const {
-        Vamp::Plugin *p = createPlugin(44100.f);
-	auto data = Vamp::HostExt::PluginStaticData::fromPlugin
-	    (m_soname + ":" + p->getIdentifier(),
-	     {}, //!!! todo: category - tricky one that
-	     p);
-        delete p;
-        return data;
-    }
-
-    virtual Vamp::HostExt::LoadResponse loadPlugin(Vamp::HostExt::
-						   LoadRequest r) const {
-	
-	// We assume the caller has guaranteed that the request is for
-	// the correct plugin (so we don't have to check the plugin
-	// key field here)
-
-	Vamp::Plugin *p = createPlugin(r.inputSampleRate);
-	
-	if (r.adapterFlags & adaptInputDomain) {
-	    if (p->getInputDomain() == Vamp::Plugin::FrequencyDomain) {
-		p = new Vamp::HostExt::PluginInputDomainAdapter(p);
-	    }
-	}
-
-	if (r.adapterFlags & adaptBufferSize) {
-	    p = new Vamp::HostExt::PluginBufferingAdapter(p);
-	}
-
-	if (r.adapterFlags & adaptChannelCount) {
-	    p = new Vamp::HostExt::PluginChannelAdapter(p);
-	}
-
-	Vamp::HostExt::LoadResponse response;
-	response.plugin = p;
-
-	response.staticData = Vamp::HostExt::PluginStaticData::fromPlugin
-	    (m_soname + ":" + p->getIdentifier(),
-	     {}, //!!! todo: category - tricky one that
-	     p);
-
-	int defaultChannels = 0;
-	if (p->getMinChannelCount() == p->getMaxChannelCount()) {
-	    defaultChannels = p->getMinChannelCount();
-	}
-    
-	response.defaultConfiguration = Vamp::HostExt::PluginConfiguration::fromPlugin
-	    (p,
-	     defaultChannels,
-	     p->getPreferredStepSize(),
-	     p->getPreferredBlockSize());
-    
-	return response;
-    }
-    
-private:
-    std::string m_soname;
-};
-
-template <typename P>
-class VamPipeAdapter : public VamPipeAdapterBase<P>
-{
-public:
-    VamPipeAdapter(std::string libname) : VamPipeAdapterBase<P>(libname) { }
-    
-    virtual Vamp::Plugin *createPlugin(float inputSampleRate) const {
-        return new P(inputSampleRate);
-    }
-};
-
-}
-
-#endif
-
--- a/VamPipePluginLibrary.cpp	Fri Oct 07 16:43:18 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,321 +0,0 @@
-/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
-
-/*
-    VamPipe
-
-    Centre for Digital Music, Queen Mary, University of London.
-    Copyright 2015-2016 QMUL.
-  
-    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 AUTHORS 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; Queen Mary, University of London; and Chris Cannam
-    shall not be used in advertising or otherwise to promote the sale,
-    use or other dealings in this Software without prior written
-    authorization.
-*/
-
-#include "VamPipePluginLibrary.h"
-#include "VamPipeAdapter.h"
-#include "json/VampJson.h"
-
-using namespace std;
-using namespace json11;
-
-namespace vampipe {
-
-//!!! too many explicit namespaces here
-
-//!!! dup with vampipe-convert
-Json
-convertRequestJson(string input, string &err)
-{
-    Json j = Json::parse(input, err);
-    if (err != "") {
-	err = "invalid json: " + err;
-	return {};
-    }
-    if (!j.is_object()) {
-	err = "object expected at top level";
-    }
-    return j;
-}
-
-VamPipePluginLibrary::VamPipePluginLibrary(vector<VamPipeAdapterInterface *> pp) :
-    m_useBase64(false)
-{
-    for (VamPipeAdapterInterface *p: pp) {
-	string key = p->getStaticData().pluginKey;
-	m_adapters[key] = p;
-    }
-}
-
-Vamp::HostExt::ListResponse
-VamPipePluginLibrary::listPluginData() const
-{
-    Vamp::HostExt::ListResponse resp;
-    for (auto a: m_adapters) {
-	resp.plugins.push_back(a.second->getStaticData());
-    }
-    return resp;
-}
-
-Vamp::HostExt::LoadResponse
-VamPipePluginLibrary::loadPlugin(Vamp::HostExt::LoadRequest req, string &err) const
-{
-    string key = req.pluginKey;
-    if (m_adapters.find(key) != m_adapters.end()) {
-        auto resp = m_adapters.at(key)->loadPlugin(req);
-        if (!resp.plugin) {
-            // This should not actually happen -- the load call here
-            // is just an object construction, not a dynamic load. But
-            // report it if it does...
-            err = "failed to construct plugin with key " + key;
-        }
-        return resp;
-    } else {
-	err = "no adapter for plugin key " + key;
-        return {};
-    }
-}
-
-Vamp::HostExt::ConfigurationResponse
-VamPipePluginLibrary::configurePlugin(Vamp::HostExt::ConfigurationRequest req,
-                                      string &err) const
-{
-    for (Vamp::HostExt::PluginConfiguration::ParameterMap::const_iterator i =
-             req.configuration.parameterValues.begin();
-         i != req.configuration.parameterValues.end(); ++i) {
-        req.plugin->setParameter(i->first, i->second);
-    }
-
-    if (req.configuration.currentProgram != "") {
-        req.plugin->selectProgram(req.configuration.currentProgram);
-    }
-
-    Vamp::HostExt::ConfigurationResponse response;
-
-    response.plugin = req.plugin;
-
-    if (req.plugin->initialise(req.configuration.channelCount,
-                               req.configuration.stepSize,
-                               req.configuration.blockSize)) {
-        response.outputs = req.plugin->getOutputDescriptors();
-    } else {
-        err = "configuration failed (wrong channel count, step size, block size?)";
-    }
-
-    return response;
-}
-
-string
-VamPipePluginLibrary::processRawImpl(int handle,
-                                     const float *const *inputBuffers,
-                                     int sec,
-                                     int nsec)
-{
-    Vamp::Plugin *plugin = m_mapper.handleToPlugin(handle);
-    if (!plugin) {
-        return VampJson::fromError("unknown plugin handle",
-                                   RRType::Process, Json())
-            .dump();
-    }
-    
-    if (!m_mapper.isConfigured(handle)) {
-        return VampJson::fromError("plugin has not been configured",
-                                   RRType::Process, Json())
-            .dump();
-    }
-
-    Vamp::RealTime timestamp(sec, nsec);
-
-    Vamp::HostExt::ProcessResponse resp;
-    resp.plugin = plugin;
-    resp.features = plugin->process(inputBuffers, timestamp);
-    
-    m_useBase64 = true;
-    
-    return VampJson::fromRpcResponse_Process
-        (resp, m_mapper,
-         VampJson::BufferSerialisation::Base64,
-         Json())
-        .dump();
-}
-
-string
-VamPipePluginLibrary::requestJsonImpl(string req)
-{
-    string err;
-    
-    Json j = convertRequestJson(req, err);
-
-    // we don't care what this is, only that it is retained in the response:
-    auto id = j["id"];
-
-    Json rj;
-    if (err != "") {
-        return VampJson::fromError(err, RRType::NotValid, id).dump();
-    }
-    
-    RRType type = VampJson::getRequestResponseType(j, err);
-    if (err != "") {
-        return VampJson::fromError(err, RRType::NotValid, id).dump();
-    }
-
-    VampJson::BufferSerialisation serialisation =
-        (m_useBase64 ?
-         VampJson::BufferSerialisation::Base64 :
-         VampJson::BufferSerialisation::Array);
-    
-    switch (type) {
-
-    case RRType::List:
-        rj = VampJson::fromRpcResponse_List(listPluginData(), id);
-        break;
-
-    case RRType::Load:
-    {
-        auto req = VampJson::toRpcRequest_Load(j, err);
-        if (err != "") {
-            rj = VampJson::fromError(err, type, id);
-        } else {
-            auto resp = loadPlugin(req, err);
-            if (err != "") {
-                rj = VampJson::fromError(err, type, id);
-            } else {
-                m_mapper.addPlugin(resp.plugin);
-                rj = VampJson::fromRpcResponse_Load(resp, m_mapper, id);
-            }
-        }
-        break;
-    }
-
-    case RRType::Configure:
-    {
-        auto req = VampJson::toRpcRequest_Configure(j, m_mapper, err);
-        if (err != "") {
-            rj = VampJson::fromError(err, type, id);
-        } else {
-            auto h = m_mapper.pluginToHandle(req.plugin);
-            if (h == m_mapper.INVALID_HANDLE) {
-                rj = VampJson::fromError("unknown or invalid plugin handle", type, id);
-            } else if (m_mapper.isConfigured(h)) {
-                rj = VampJson::fromError("plugin has already been configured", type, id);
-            } else {
-                auto resp = configurePlugin(req, err);
-                if (err != "") {
-                    rj = VampJson::fromError(err, type, id);
-                } else {
-                    m_mapper.markConfigured(h,
-                                            req.configuration.channelCount,
-                                            req.configuration.blockSize);
-                    rj = VampJson::fromRpcResponse_Configure(resp, m_mapper, id);
-                }
-            }
-        }
-        break;
-    }
-
-    case RRType::Process:
-    {
-        VampJson::BufferSerialisation serialisation;
-            
-        auto req = VampJson::toRpcRequest_Process(j, m_mapper,
-                                                   serialisation, err);
-        if (err != "") {
-            rj = VampJson::fromError(err, type, id);
-        } else {
-            auto h = m_mapper.pluginToHandle(req.plugin);
-            int channels = int(req.inputBuffers.size());
-            if (h == m_mapper.INVALID_HANDLE) {
-                rj = VampJson::fromError("unknown or invalid plugin handle", type, id);
-            } else if (!m_mapper.isConfigured(h)) {
-                rj = VampJson::fromError("plugin has not been configured", type, id);
-            } else if (channels != m_mapper.getChannelCount(h)) {
-                rj = VampJson::fromError("wrong number of channels supplied", type, id);
-            } else {
-
-                if (serialisation == VampJson::BufferSerialisation::Base64) {
-                    m_useBase64 = true;
-                }
-
-                size_t blockSize = m_mapper.getBlockSize(h);
-                
-                const float **fbuffers = new const float *[channels];
-                for (int i = 0; i < channels; ++i) {
-                    if (req.inputBuffers[i].size() != blockSize) {
-                        delete[] fbuffers;
-                        fbuffers = 0;
-                        rj = VampJson::fromError("wrong block size supplied", type, id);
-                        break;
-                    }
-                    fbuffers[i] = req.inputBuffers[i].data();
-                }
-
-                if (fbuffers) {
-                    Vamp::HostExt::ProcessResponse resp;
-                    resp.plugin = req.plugin;
-                    resp.features = req.plugin->process(fbuffers, req.timestamp);
-                    delete[] fbuffers;
-                    rj = VampJson::fromRpcResponse_Process
-                        (resp, m_mapper, serialisation, id);
-                }
-            }
-        }
-        break;
-    }
-
-    case RRType::Finish:
-    {
-        auto req = VampJson::toRpcRequest_Finish(j, m_mapper, err);
-        if (err != "") {
-            rj = VampJson::fromError(err, type, id);
-        } else {
-            auto h = m_mapper.pluginToHandle(req.plugin);
-            if (h == m_mapper.INVALID_HANDLE) {
-                rj = VampJson::fromError("unknown or invalid plugin handle", type, id);
-            } else if (!m_mapper.isConfigured(h)) {
-                rj = VampJson::fromError("plugin has not been configured", type, id);
-            } else {
-
-                Vamp::HostExt::ProcessResponse resp;
-                resp.plugin = req.plugin;
-                resp.features = req.plugin->getRemainingFeatures();
-
-                rj = VampJson::fromRpcResponse_Finish
-                    (resp, m_mapper, serialisation, id);
-	
-                m_mapper.removePlugin(h);
-                delete req.plugin;
-            }
-        }
-        break;
-    }
-
-    case RRType::NotValid:
-        rj = VampJson::fromError("invalid request", type, id);
-        break;
-    }
-
-    return rj.dump();
-}
-
-}
-
--- a/VamPipePluginLibrary.h	Fri Oct 07 16:43:18 2016 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +0,0 @@
-/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
-
-/*
-    VamPipe
-
-    Centre for Digital Music, Queen Mary, University of London.
-    Copyright 2015-2016 QMUL.
-  
-    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 AUTHORS 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; Queen Mary, University of London; and Chris Cannam
-    shall not be used in advertising or otherwise to promote the sale,
-    use or other dealings in this Software without prior written
-    authorization.
-*/
-
-#ifndef VAMPIPE_PLUGIN_LIBRARY_H
-#define VAMPIPE_PLUGIN_LIBRARY_H
-
-#include "bits/CountingPluginHandleMapper.h"
-
-#include <vamp-hostsdk/PluginStaticData.h>
-#include <vamp-hostsdk/RequestResponse.h>
-
-#include <vector>
-#include <string>
-#include <cstring>
-
-namespace vampipe {
-
-class VamPipeAdapterInterface;
-
-class VamPipePluginLibrary
-{
-public:
-    VamPipePluginLibrary(std::vector<VamPipeAdapterInterface *> pp);
-    
-    const char *requestJson(const char *request) {
-	return strdup(requestJsonImpl(request).c_str());
-    }
-
-    const char *processRaw(int handle, const float *const *inputBuffers,
-                           int sec, int nsec) {
-        return strdup(processRawImpl(handle, inputBuffers, sec, nsec).c_str());
-    }
-    
-    void freeJson(const char *json) {
-	free(const_cast<char *>(json));
-    }
-    
-private:
-    std::string requestJsonImpl(std::string req);
-    std::string processRawImpl(int, const float *const *, int, int);
-
-    Vamp::HostExt::ListResponse listPluginData() const;
-    Vamp::HostExt::LoadResponse loadPlugin(Vamp::HostExt::LoadRequest r,
-                                           std::string &err) const;
-    Vamp::HostExt::ConfigurationResponse configurePlugin(Vamp::HostExt::
-							 ConfigurationRequest r,
-                                                         std::string &err)
-        const;
-
-    // map from pluginKey -> adapter
-    std::map<std::string, VamPipeAdapterInterface *> m_adapters;
-    CountingPluginHandleMapper m_mapper;
-    bool m_useBase64;
-};
-
-}
-
-#endif
--- a/example.cpp	Fri Oct 07 16:43:18 2016 +0100
+++ b/example.cpp	Mon Oct 10 17:05:37 2016 +0100
@@ -1,7 +1,7 @@
 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
 
 /*
-    VamPipe
+    Piper
 
     Centre for Digital Music, Queen Mary, University of London.
     Copyright 2015-2016 QMUL.
@@ -32,29 +32,29 @@
     authorization.
 */
 
-#include "VamPipeAdapter.h"
-#include "VamPipePluginLibrary.h"
+#include "PiperAdapter.h"
+#include "PiperPluginLibrary.h"
 
-#include "vamp-plugin-sdk/examples/ZeroCrossing.h"
-#include "vamp-plugin-sdk/examples/SpectralCentroid.h"
-#include "vamp-plugin-sdk/examples/PercussionOnsetDetector.h"
-#include "vamp-plugin-sdk/examples/FixedTempoEstimator.h"
-#include "vamp-plugin-sdk/examples/AmplitudeFollower.h"
-#include "vamp-plugin-sdk/examples/PowerSpectrum.h"
+#include "examples/ZeroCrossing.h"
+#include "examples/SpectralCentroid.h"
+#include "examples/PercussionOnsetDetector.h"
+#include "examples/FixedTempoEstimator.h"
+#include "examples/AmplitudeFollower.h"
+#include "examples/PowerSpectrum.h"
 
-using vampipe::VamPipeAdapter;
-using vampipe::VamPipePluginLibrary;
+using piper::PiperAdapter;
+using piper::PiperPluginLibrary;
 
 static std::string soname("vamp-example-plugins");
 
-static VamPipeAdapter<ZeroCrossing> zeroCrossingAdapter(soname);
-static VamPipeAdapter<SpectralCentroid> spectralCentroidAdapter(soname);
-static VamPipeAdapter<PercussionOnsetDetector> percussionOnsetAdapter(soname);
-static VamPipeAdapter<FixedTempoEstimator> fixedTempoAdapter(soname);
-static VamPipeAdapter<AmplitudeFollower> amplitudeAdapter(soname);
-static VamPipeAdapter<PowerSpectrum> powerSpectrumAdapter(soname);
+static PiperAdapter<ZeroCrossing> zeroCrossingAdapter(soname);
+static PiperAdapter<SpectralCentroid> spectralCentroidAdapter(soname);
+static PiperAdapter<PercussionOnsetDetector> percussionOnsetAdapter(soname);
+static PiperAdapter<FixedTempoEstimator> fixedTempoAdapter(soname);
+static PiperAdapter<AmplitudeFollower> amplitudeAdapter(soname);
+static PiperAdapter<PowerSpectrum> powerSpectrumAdapter(soname);
 
-static VamPipePluginLibrary library({
+static PiperPluginLibrary library({
     &zeroCrossingAdapter,
     &spectralCentroidAdapter,
     &percussionOnsetAdapter,
@@ -65,18 +65,18 @@
 
 extern "C" {
 
-const char *vampipeRequestJson(const char *request) {
+const char *piperRequestJson(const char *request) {
     return library.requestJson(request);
 }
 
-const char *vampipeProcessRaw(int handle,
+const char *piperProcessRaw(int handle,
                               const float *const *inputBuffers,
                               int sec,
                               int nsec) {
     return library.processRaw(handle, inputBuffers, sec, nsec);
 }
     
-void vampipeFreeJson(const char *json) {
+void piperFreeJson(const char *json) {
     return library.freeJson(json);
 }
 
--- a/perf-test-node.js	Fri Oct 07 16:43:18 2016 +0100
+++ b/perf-test-node.js	Mon Oct 10 17:05:37 2016 +0100
@@ -8,24 +8,24 @@
 // "string", in which case Emscripten will take care of
 // conversions. But it's not clear how one would manage memory for
 // newly-constructed returned C strings -- the returned pointer from
-// vampipeRequestJson would appear (?) to be thrown away by the
+// piperRequestJson would appear (?) to be thrown away by the
 // Emscripten string converter if we declare it as returning a string,
-// so we have no opportunity to pass it to vampipeFreeJson, which
+// so we have no opportunity to pass it to piperFreeJson, which
 // suggests this would leak memory if the string isn't static. Not
 // wholly sure though. Anyway, passing and returning pointers (as
 // numbers) means we can manage the Emscripten heap memory however we
 // want in our request wrapper function below.
 
-var vampipeRequestJson = exampleModule.cwrap(
-    'vampipeRequestJson', 'number', ['number']
+var piperRequestJson = exampleModule.cwrap(
+    'piperRequestJson', 'number', ['number']
 );
 
-var vampipeProcessRaw = exampleModule.cwrap(
-    "vampipeProcessRaw", "number", ["number", "number", "number", "number"]
+var piperProcessRaw = exampleModule.cwrap(
+    "piperProcessRaw", "number", ["number", "number", "number", "number"]
 );
 
-var vampipeFreeJson = exampleModule.cwrap(
-    'vampipeFreeJson', 'void', ['number']
+var piperFreeJson = exampleModule.cwrap(
+    'piperFreeJson', 'void', ['number']
 );
 
 function note(blah) {
@@ -53,7 +53,7 @@
         buffers[i] = framesPtr;
     }
     
-    const responseJson = vampipeProcessRaw(
+    const responseJson = piperProcessRaw(
         request.handle,
         buffersPtr,
         request.processInput.timestamp.s,
@@ -67,7 +67,7 @@
     const responseJstr = exampleModule.Pointer_stringify(responseJson);
     const response = JSON.parse(responseJstr);
     
-    vampipeFreeJson(responseJson);
+    piperFreeJson(responseJson);
     
     return response;
 }
@@ -96,10 +96,10 @@
     // don't mention this). Note the *Cstr values are Emscripten heap
     // pointers
     var inCstr = m.allocate(m.intArrayFromString(jsonStr), 'i8', m.ALLOC_NORMAL);
-    var outCstr = vampipeRequestJson(inCstr);
+    var outCstr = piperRequestJson(inCstr);
     m._free(inCstr);
     var result = m.Pointer_stringify(outCstr);
-    vampipeFreeJson(outCstr);
+    piperFreeJson(outCstr);
     note("Returned JSON = " + result);
     return result;
 }
--- a/perf-test.js	Fri Oct 07 16:43:18 2016 +0100
+++ b/perf-test.js	Mon Oct 10 17:05:37 2016 +0100
@@ -6,24 +6,24 @@
 // "string", in which case Emscripten will take care of
 // conversions. But it's not clear how one would manage memory for
 // newly-constructed returned C strings -- the returned pointer from
-// vampipeRequestJson would appear (?) to be thrown away by the
+// piperRequestJson would appear (?) to be thrown away by the
 // Emscripten string converter if we declare it as returning a string,
-// so we have no opportunity to pass it to vampipeFreeJson, which
+// so we have no opportunity to pass it to piperFreeJson, which
 // suggests this would leak memory if the string isn't static. Not
 // wholly sure though. Anyway, passing and returning pointers (as
 // numbers) means we can manage the Emscripten heap memory however we
 // want in our request wrapper function below.
 
-var vampipeRequestJson = exampleModule.cwrap(
-    'vampipeRequestJson', 'number', ['number']
+var piperRequestJson = exampleModule.cwrap(
+    'piperRequestJson', 'number', ['number']
 );
 
-var vampipeProcessRaw = exampleModule.cwrap(
-    "vampipeProcessRaw", "number", ["number", "number", "number", "number"]
+var piperProcessRaw = exampleModule.cwrap(
+    "piperProcessRaw", "number", ["number", "number", "number", "number"]
 );
 
-var vampipeFreeJson = exampleModule.cwrap(
-    'vampipeFreeJson', 'void', ['number']
+var piperFreeJson = exampleModule.cwrap(
+    'piperFreeJson', 'void', ['number']
 );
 
 function note(blah) {
@@ -51,7 +51,7 @@
         buffers[i] = framesPtr;
     }
     
-    const responseJson = vampipeProcessRaw(
+    const responseJson = piperProcessRaw(
         request.handle,
         buffersPtr,
         request.processInput.timestamp.s,
@@ -65,7 +65,7 @@
     const responseJstr = exampleModule.Pointer_stringify(responseJson);
     const response = JSON.parse(responseJstr);
     
-    vampipeFreeJson(responseJson);
+    piperFreeJson(responseJson);
     
     return response;
 }
@@ -94,10 +94,10 @@
     // don't mention this). Note the *Cstr values are Emscripten heap
     // pointers
     var inCstr = m.allocate(m.intArrayFromString(jsonStr), 'i8', m.ALLOC_NORMAL);
-    var outCstr = vampipeRequestJson(inCstr);
+    var outCstr = piperRequestJson(inCstr);
     m._free(inCstr);
     var result = m.Pointer_stringify(outCstr);
-    vampipeFreeJson(outCstr);
+    piperFreeJson(outCstr);
     note("Returned JSON = " + result);
     return result;
 }
--- a/qm-vamp-plugins.cpp	Fri Oct 07 16:43:18 2016 +0100
+++ b/qm-vamp-plugins.cpp	Mon Oct 10 17:05:37 2016 +0100
@@ -1,7 +1,7 @@
 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
 
 /*
-    VamPipe
+    Piper
 
     Centre for Digital Music, Queen Mary, University of London.
     Copyright 2015-2016 QMUL.
@@ -32,8 +32,8 @@
     authorization.
 */
 
-#include "VamPipeAdapter.h"
-#include "VamPipePluginLibrary.h"
+#include "PiperAdapter.h"
+#include "PiperPluginLibrary.h"
 
 #include "plugins/BeatTrack.h"
 #include "plugins/OnsetDetect.h"
@@ -49,26 +49,26 @@
 #include "plugins/DWT.h"
 #include "plugins/Transcription.h"
 
-using vampipe::VamPipeAdapter;
-using vampipe::VamPipePluginLibrary;
+using piper::PiperAdapter;
+using piper::PiperPluginLibrary;
 
 static std::string soname("qm-vamp-plugins");
 
-static VamPipeAdapter<BeatTracker> beatTrackerAdapter(soname);
-static VamPipeAdapter<OnsetDetector> onsetDetectorAdapter(soname);
-static VamPipeAdapter<ChromagramPlugin> chromagramPluginAdapter(soname);
-static VamPipeAdapter<ConstantQSpectrogram> constantQAdapter(soname);
-static VamPipeAdapter<TonalChangeDetect> tonalChangeDetectorAdapter(soname);
-static VamPipeAdapter<KeyDetector> keyDetectorAdapter(soname);
-static VamPipeAdapter<MFCCPlugin> mfccPluginAdapter(soname);
-static VamPipeAdapter<SegmenterPlugin> segmenterPluginAdapter(soname);
-static VamPipeAdapter<SimilarityPlugin> similarityPluginAdapter(soname);
-static VamPipeAdapter<BarBeatTracker> barBeatTrackPluginAdapter(soname);
-//!!!static VamPipeAdapter<AdaptiveSpectrogram> adaptiveSpectrogramAdapter(soname);
-static VamPipeAdapter<DWT> dwtAdapter(soname);
-static VamPipeAdapter<Transcription> transcriptionAdapter(soname);
+static PiperAdapter<BeatTracker> beatTrackerAdapter(soname);
+static PiperAdapter<OnsetDetector> onsetDetectorAdapter(soname);
+static PiperAdapter<ChromagramPlugin> chromagramPluginAdapter(soname);
+static PiperAdapter<ConstantQSpectrogram> constantQAdapter(soname);
+static PiperAdapter<TonalChangeDetect> tonalChangeDetectorAdapter(soname);
+static PiperAdapter<KeyDetector> keyDetectorAdapter(soname);
+static PiperAdapter<MFCCPlugin> mfccPluginAdapter(soname);
+static PiperAdapter<SegmenterPlugin> segmenterPluginAdapter(soname);
+static PiperAdapter<SimilarityPlugin> similarityPluginAdapter(soname);
+static PiperAdapter<BarBeatTracker> barBeatTrackPluginAdapter(soname);
+//!!!static PiperAdapter<AdaptiveSpectrogram> adaptiveSpectrogramAdapter(soname);
+static PiperAdapter<DWT> dwtAdapter(soname);
+static PiperAdapter<Transcription> transcriptionAdapter(soname);
 
-static VamPipePluginLibrary library({
+static PiperPluginLibrary library({
 	&beatTrackerAdapter,
 	    &onsetDetectorAdapter,
 	    &chromagramPluginAdapter,
@@ -86,18 +86,18 @@
 
 extern "C" {
 
-const char *vampipeRequestJson(const char *request) {
+const char *piperRequestJson(const char *request) {
     return library.requestJson(request);
 }
 
-const char *vampipeProcessRaw(int handle,
+const char *piperProcessRaw(int handle,
                               const float *const *inputBuffers,
                               int sec,
                               int nsec) {
     return library.processRaw(handle, inputBuffers, sec, nsec);
 }
     
-void vampipeFreeJson(const char *json) {
+void piperFreeJson(const char *json) {
     return library.freeJson(json);
 }
 
--- a/quick-test.html	Fri Oct 07 16:43:18 2016 +0100
+++ b/quick-test.html	Mon Oct 10 17:05:37 2016 +0100
@@ -1,7 +1,7 @@
 <html>
   <head>
     <meta charset="UTF-8">
-    <title>VamPipe Adapter Test</title>
+    <title>Piper Adapter Test</title>
 
     <style type="text/css">
       body { margin: 5%; }
@@ -13,7 +13,7 @@
     <script src="quick-test.js"></script>
   </head>
   <body>
-    <h3>VamPipe Adapter Test</h3>
+    <h3>Piper Adapter Test</h3>
 
     <p id="test-result"></p>
     
--- a/quick-test.js	Fri Oct 07 16:43:18 2016 +0100
+++ b/quick-test.js	Mon Oct 10 17:05:37 2016 +0100
@@ -6,20 +6,20 @@
 // "string", in which case Emscripten will take care of
 // conversions. But it's not clear how one would manage memory for
 // newly-constructed returned C strings -- the returned pointer from
-// vampipeRequestJson would appear (?) to be thrown away by the
+// piperRequestJson would appear (?) to be thrown away by the
 // Emscripten string converter if we declare it as returning a string,
-// so we have no opportunity to pass it to vampipeFreeJson, which
+// so we have no opportunity to pass it to piperFreeJson, which
 // suggests this would leak memory if the string isn't static. Not
 // wholly sure though. Anyway, passing and returning pointers (as
 // numbers) means we can manage the Emscripten heap memory however we
 // want in our request wrapper function below.
 
-var vampipeRequestJson = exampleModule.cwrap(
-    'vampipeRequestJson', 'number', ['number']
+var piperRequestJson = exampleModule.cwrap(
+    'piperRequestJson', 'number', ['number']
 );
 
-var vampipeFreeJson = exampleModule.cwrap(
-    'vampipeFreeJson', 'void', ['number']
+var piperFreeJson = exampleModule.cwrap(
+    'piperFreeJson', 'void', ['number']
 );
 
 function note(blah) {
@@ -38,10 +38,10 @@
     // don't mention this). Note the *Cstr values are Emscripten heap
     // pointers
     var inCstr = m.allocate(m.intArrayFromString(jsonStr), 'i8', m.ALLOC_NORMAL);
-    var outCstr = vampipeRequestJson(inCstr);
+    var outCstr = piperRequestJson(inCstr);
     m._free(inCstr);
     var result = m.Pointer_stringify(outCstr);
-    vampipeFreeJson(outCstr);
+    piperFreeJson(outCstr);
     note("Returned JSON = " + result);
     return result;
 }
--- a/silvet.cpp	Fri Oct 07 16:43:18 2016 +0100
+++ b/silvet.cpp	Mon Oct 10 17:05:37 2016 +0100
@@ -1,34 +1,34 @@
 
-#include "VamPipeAdapter.h"
-#include "VamPipePluginLibrary.h"
+#include "PiperAdapter.h"
+#include "PiperPluginLibrary.h"
 
 #include "Silvet.h"
 
-using vampipe::VamPipeAdapter;
-using vampipe::VamPipePluginLibrary;
+using piper::PiperAdapter;
+using piper::PiperPluginLibrary;
 
 static std::string soname("silvet");
 
-static VamPipeAdapter<Silvet> silvetAdapter(soname);
+static PiperAdapter<Silvet> silvetAdapter(soname);
 
-static VamPipePluginLibrary library({
+static PiperPluginLibrary library({
     &silvetAdapter
 });
 
 extern "C" {
 
-const char *vampipeRequestJson(const char *request) {
+const char *piperRequestJson(const char *request) {
     return library.requestJson(request);
 }
 
-const char *vampipeProcessRaw(int handle,
+const char *piperProcessRaw(int handle,
                               const float *const *inputBuffers,
                               int sec,
                               int nsec) {
     return library.processRaw(handle, inputBuffers, sec, nsec);
 }
     
-void vampipeFreeJson(const char *json) {
+void piperFreeJson(const char *json) {
     return library.freeJson(json);
 }
 
--- a/vamp-test-plugin.cpp	Fri Oct 07 16:43:18 2016 +0100
+++ b/vamp-test-plugin.cpp	Mon Oct 10 17:05:37 2016 +0100
@@ -28,22 +28,22 @@
     dealings in this Software without prior written authorization.
 */
 
-#include "VamPipeAdapter.h"
-#include "VamPipePluginLibrary.h"
+#include "PiperAdapter.h"
+#include "PiperPluginLibrary.h"
 
 #include "VampTestPlugin.h"
 
-using vampipe::VamPipeAdapter;
-using vampipe::VamPipeAdapterBase;
-using vampipe::VamPipePluginLibrary;
+using piper::PiperAdapter;
+using piper::PiperAdapterBase;
+using piper::PiperPluginLibrary;
 
 static std::string soname("vamp-test-plugin");
 
-class Adapter : public VamPipeAdapterBase<VampTestPlugin>
+class Adapter : public PiperAdapterBase<VampTestPlugin>
 {
 public:
     Adapter(bool freq) :
-        VamPipeAdapterBase<VampTestPlugin>(soname),
+        PiperAdapterBase<VampTestPlugin>(soname),
         m_freq(freq) { }
 
 protected:
@@ -57,25 +57,25 @@
 static Adapter timeAdapter(false);
 static Adapter freqAdapter(true);
 
-static VamPipePluginLibrary library({
+static PiperPluginLibrary library({
     &timeAdapter,
     &freqAdapter
 });
 
 extern "C" {
 
-const char *vampipeRequestJson(const char *request) {
+const char *piperRequestJson(const char *request) {
     return library.requestJson(request);
 }
 
-const char *vampipeProcessRaw(int handle,
+const char *piperProcessRaw(int handle,
                               const float *const *inputBuffers,
                               int sec,
                               int nsec) {
     return library.processRaw(handle, inputBuffers, sec, nsec);
 }
     
-void vampipeFreeJson(const char *json) {
+void piperFreeJson(const char *json) {
     return library.freeJson(json);
 }