Mercurial > hg > tipic
changeset 7:9262806af1cd
Add papers, skeleton plugin code
author | Chris Cannam |
---|---|
date | Fri, 14 Aug 2015 12:02:57 +0100 |
parents | e62530cdc1c3 |
children | f51f26334f78 |
files | Makefile.inc Makefile.osx papers/2009_MuellerEwertKreuzer_ChromaFeaturesRobust_ICASSP.pdf papers/2010_MuellerEwert_MFCC-Chroma_IEEE-TASLP_postprint.pdf papers/2011_MuellerEwert_ChromaToolbox_ISMIR.pdf src/TipicVampPlugin.cpp src/TipicVampPlugin.h |
diffstat | 7 files changed, 244 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile.inc Wed Aug 12 12:29:51 2015 +0100 +++ b/Makefile.inc Fri Aug 14 12:02:57 2015 +0100 @@ -14,7 +14,7 @@ RANLIB ?= ranlib CFLAGS := $(CFLAGS) -CXXFLAGS := $(CFLAGS) -I. -I$(VAMPSDK_DIR) -I$(CQ_DIR) -I$(BQVEC_DIR) -I$(BQVEC_DIR) -I$(CQ_DIR)/src/dsp $(CXXFLAGS) +CXXFLAGS := $(CFLAGS) -I. -I$(VAMPSDK_DIR) -I$(CQ_DIR) -I$(BQVEC_DIR) -I$(BQVEC_DIR)/bqvec -I$(CQ_DIR)/src/dsp $(CXXFLAGS) LDFLAGS := $(LDFLAGS) PLUGIN_LDFLAGS := $(LDFLAGS) $(PLUGIN_LDFLAGS) @@ -29,8 +29,8 @@ LIB_OBJECTS := $(LIB_SOURCES:.cpp=.o) LIB_OBJECTS := $(LIB_OBJECTS:.c=.o) -PLUGIN_HEADERS := -PLUGIN_SOURCES := +PLUGIN_HEADERS := $(SRC_DIR)/TipicVampPlugin.h +PLUGIN_SOURCES := $(SRC_DIR)/TipicVampPlugin.cpp BQVEC_HEADERS := $(BQVEC_DIR)/Allocators.h $(BQVEC_DIR)/Restrict.h $(BQVEC_DIR)/VectorOps.h BQVEC_SOURCES := $(BQVEC_DIR)/src/Allocators.cpp @@ -48,7 +48,7 @@ constant-q-cpp: $(MAKE) -C $@ -f Makefile$(MAKEFILE_EXT) libcq.a -$(PLUGIN): $(PLUGIN_OBJECTS) $(LIBS) +$(PLUGIN): $(OBJECTS) $(LIBS) $(CXX) -o $@ $^ $(LIBS) $(PLUGIN_LDFLAGS) $(LIBRARY): $(LIB_OBJECTS)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile.osx Fri Aug 14 12:02:57 2015 +0100 @@ -0,0 +1,16 @@ + +ARCHFLAGS ?= -mmacosx-version-min=10.7 -stdlib=libc++ -arch x86_64 -arch i386 + +CXXFLAGS += $(ARCHFLAGS) -DMALLOC_IS_ALIGNED -O3 -ftree-vectorize -I../vamp-plugin-sdk -std=c++11 + +LDFLAGS += $(ARCHFLAGS) + +PLUGIN_LDFLAGS += $(ARCHFLAGS) -dynamiclib ../vamp-plugin-sdk/libvamp-sdk.a -exported_symbols_list vamp-plugin.list -install_name tipic.dylib + +PLUGIN_EXT := .dylib + +MAKEFILE_EXT := .osx + +include Makefile.inc + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/TipicVampPlugin.cpp Fri Aug 14 12:02:57 2015 +0100 @@ -0,0 +1,173 @@ + +#include "TipicVampPlugin.h" + +Tipic::Tipic(float inputSampleRate) : + Plugin(inputSampleRate) +{ +} + +Tipic::~Tipic() +{ +} + +string +Tipic::getIdentifier() const +{ + return "tipic"; +} + +string +Tipic::getName() const +{ + return "Timbre-Invariant Pitch Chroma"; +} + +string +Tipic::getDescription() const +{ + // Return something helpful here! + return ""; +} + +string +Tipic::getMaker() const +{ + // Your name here + return ""; +} + +int +Tipic::getPluginVersion() const +{ + // Increment this each time you release a version that behaves + // differently from the previous one + return 1; +} + +string +Tipic::getCopyright() const +{ + // This function is not ideally named. It does not necessarily + // need to say who made the plugin -- getMaker does that -- but it + // should indicate the terms under which it is distributed. For + // example, "Copyright (year). All Rights Reserved", or "GPL" + return ""; +} + +Tipic::InputDomain +Tipic::getInputDomain() const +{ + return TimeDomain; +} + +size_t +Tipic::getPreferredBlockSize() const +{ + return 0; // 0 means "I can handle any block size" +} + +size_t +Tipic::getPreferredStepSize() const +{ + return 0; // 0 means "anything sensible"; in practice this + // means the same as the block size for TimeDomain + // plugins, or half of it for FrequencyDomain plugins +} + +size_t +Tipic::getMinChannelCount() const +{ + return 1; +} + +size_t +Tipic::getMaxChannelCount() const +{ + return 1; +} + +Tipic::ParameterList +Tipic::getParameterDescriptors() const +{ + ParameterList list; + return list; +} + +float +Tipic::getParameter(string identifier) const +{ + return 0; +} + +void +Tipic::setParameter(string identifier, float value) +{ +} + +Tipic::ProgramList +Tipic::getPrograms() const +{ + ProgramList list; + return list; +} + +string +Tipic::getCurrentProgram() const +{ + return ""; // no programs +} + +void +Tipic::selectProgram(string name) +{ +} + +Tipic::OutputList +Tipic::getOutputDescriptors() const +{ + OutputList list; + + OutputDescriptor d; + d.identifier = "pitch"; + d.name = "Pitch Features"; + d.description = ""; + d.unit = ""; + d.hasFixedBinCount = true; + d.binCount = 88; + d.hasKnownExtents = false; + d.isQuantized = false; + d.sampleType = OutputDescriptor::FixedSampleRate; + d.sampleRate = 4410.0 / m_inputSampleRate; + d.hasDuration = false; + list.push_back(d); + + return list; +} + +bool +Tipic::initialise(size_t channels, size_t stepSize, size_t blockSize) +{ + if (channels < getMinChannelCount() || + channels > getMaxChannelCount()) return false; + + return true; +} + +void +Tipic::reset() +{ + // Clear buffers, reset stored values, etc +} + +Tipic::FeatureSet +Tipic::process(const float *const *inputBuffers, Vamp::RealTime timestamp) +{ + return FeatureSet(); +} + +Tipic::FeatureSet +Tipic::getRemainingFeatures() +{ + return FeatureSet(); +} +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/TipicVampPlugin.h Fri Aug 14 12:02:57 2015 +0100 @@ -0,0 +1,51 @@ +#ifndef TIPIC_VAMP_PLUGIN_H +#define TIPIC_VAMP_PLUGIN_H + +#include <vamp-sdk/Plugin.h> + +using std::string; + +class Tipic : public Vamp::Plugin +{ +public: + Tipic(float inputSampleRate); + virtual ~Tipic(); + + string getIdentifier() const; + string getName() const; + string getDescription() const; + string getMaker() const; + int getPluginVersion() const; + string getCopyright() const; + + InputDomain getInputDomain() const; + size_t getPreferredBlockSize() const; + size_t getPreferredStepSize() const; + size_t getMinChannelCount() const; + size_t getMaxChannelCount() const; + + ParameterList getParameterDescriptors() const; + float getParameter(string identifier) const; + void setParameter(string identifier, float value); + + ProgramList getPrograms() const; + string getCurrentProgram() const; + void selectProgram(string name); + + OutputList getOutputDescriptors() const; + + bool initialise(size_t channels, size_t stepSize, size_t blockSize); + void reset(); + + FeatureSet process(const float *const *inputBuffers, + Vamp::RealTime timestamp); + + FeatureSet getRemainingFeatures(); + +protected: + +}; + + + +#endif