# Compile flags
#
-CXXFLAGS := $(CXXFLAGS) -fPIC -DNDEBUG -O2 -Wall -I.
+CXXFLAGS := -I/Users/cannam/code/inst/include $(CXXFLAGS) -fPIC -DNDEBUG -O2 -Wall -I.
# Libraries required for the plugins. Note that we can (and actively
# want to) statically link libstdc++, because our plugin exposes only
# a C API so there are no boundary compatibility problems.
#
-PLUGIN_LIBS = -Wl,-Bstatic -lvamp-sdk -laubio -lfftw3f -Wl,-Bdynamic
+PLUGIN_LIBS = -L/Users/cannam/code/inst/lib -lvamp-sdk -laubio
# Flags required to tell the compiler to make a dynamically loadable object
#
-PLUGIN_LDFLAGS = -shared -Wl,-Bsymbolic -static-libgcc -Wl,--version-script=vamp-plugin.map
# File extension for a dynamically loadable object
#
-PLUGIN_EXT = .so
## For OS/X with g++:
-#PLUGIN_LDFLAGS = -dynamiclib -exported_symbols_list=vamp-plugin.list
-#PLUGIN_EXT = .dylib
+PLUGIN_LDFLAGS = -dynamiclib -exported_symbols_list=vamp-plugin.list
+PLUGIN_EXT = .dylib
### End of user-serviceable parts
m_pv(0),
m_peakpick(0),
m_onsetdet(0),
- m_onsettype(aubio_onset_complex),
+ m_onsettype(OnsetComplex),
m_pitchdet(0),
- m_pitchtype(aubio_pitch_yinfft),
- m_pitchmode(aubio_pitchm_freq),
+ m_pitchtype(PitchYinFFT),
m_threshold(0.3),
m_silence(-90),
m_median(6),
Notes::~Notes()
{
- if (m_onsetdet) aubio_onsetdetection_free(m_onsetdet);
- if (m_pitchdet) del_aubio_pitchdetection(m_pitchdet);
+ if (m_onsetdet) del_aubio_onset(m_onsetdet);
+ if (m_pitchdet) del_aubio_pitch(m_pitchdet);
if (m_ibuf) del_fvec(m_ibuf);
if (m_onset) del_fvec(m_onset);
if (m_fftgrain) del_cvec(m_fftgrain);
m_blockSize = blockSize;
size_t processingBlockSize;
- if (m_onsettype == aubio_onset_energy ||
- m_onsettype == aubio_onset_hfc) {
+ if (m_onsettype == OnsetEnergy ||
+ m_onsettype == OnsetHFC) {
processingBlockSize = stepSize * 2;
} else {
processingBlockSize = stepSize * 4;
#include <deque>
+#include "Types.h"
+
class Notes : public Vamp::Plugin
{
public:
cvec_t *m_fftgrain;
fvec_t *m_onset;
aubio_pvoc_t *m_pv;
- aubio_pickpeak_t *m_peakpick;
- aubio_onsetdetection_t *m_onsetdet;
- aubio_onsetdetection_type m_onsettype;
- aubio_pitchdetection_t *m_pitchdet;
- aubio_pitchdetection_type m_pitchtype;
- aubio_pitchdetection_mode m_pitchmode;
+ aubio_peakpicker_t *m_peakpick;
+ aubio_onset_t *m_onsetdet;
+ OnsetType m_onsettype;
+ aubio_pitch_t *m_pitchdet;
+ PitchType m_pitchtype;
float m_threshold;
float m_silence;
size_t m_median;
#include <vamp-sdk/Plugin.h>
#include <aubio/aubio.h>
+#include "Types.h"
+
class Onset : public Vamp::Plugin
{
public:
cvec_t *m_fftgrain;
fvec_t *m_onset;
aubio_pvoc_t *m_pv;
- aubio_pickpeak_t *m_peakpick;
- aubio_onsetdetection_t *m_onsetdet;
- aubio_onsetdetection_type m_onsettype;
+ aubio_peakpicker_t *m_peakpick;
+ aubio_specdesc_t *m_onsetdet;
+ OnsetType m_onsettype;
float m_threshold;
float m_silence;
size_t m_stepSize;
protected:
fvec_t *m_ibuf;
- aubio_pitchdetection_t *m_pitchdet;
- aubio_pitchdetection_type m_pitchtype;
- aubio_pitchdetection_mode m_pitchmode;
+ aubio_pitch_t *m_pitchdet;
+ PitchType m_pitchtype;
float m_minfreq;
float m_maxfreq;
float m_silence;
#include <vamp-sdk/Plugin.h>
#include <aubio/aubio.h>
+#include "Types.h"
+
class Tempo : public Vamp::Plugin
{
public:
cvec_t *m_fftgrain;
fvec_t *m_onset;
aubio_pvoc_t *m_pv;
- aubio_pickpeak_t *m_peakpick;
- aubio_onsetdetection_t *m_onsetdet;
- aubio_onsetdetection_type m_onsettype;
- aubio_beattracking_t *m_beattracking;
+ aubio_peakpicker_t *m_peakpick;
+ aubio_onset_t *m_onsetdet;
+ OnsetType m_onsettype;
+ aubio_tempo_t *m_tempo;
fvec_t *m_dfframe;
fvec_t *m_btout;
uint_t m_winlen;
--- /dev/null
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
+
+/*
+ Vamp feature extraction plugins using Paul Brossier's Aubio library.
+
+ Centre for Digital Music, Queen Mary, University of London.
+ This file copyright 2012 Queen Mary, University of London.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. See the file
+ COPYING included with this distribution for more information.
+
+*/
+
+#include "Types.h"
+
+const char *getAubioNameForOnsetType(OnsetType t)
+{
+ switch (t) {
+ case OnsetEnergy: return "energy";
+ case OnsetSpecDiff: return "specdiff";
+ case OnsetHFC: return "hfc";
+ case OnsetComplex: return "complex";
+ case OnsetPhase: return "phase";
+ case OnsetMKL: return "mkl";
+ case OnsetKL: return "kl";
+ case OnsetSpecFlux: return "specflux";
+ }
+}
+
+const char *getAubioNameForPitchType(PitchType t)
+{
+ switch (t) {
+ case PitchMComb: return "mcomb";
+ case PitchYinFFT: return "yinfft";
+ case PitchYin: return "yin";
+ case PitchSchmitt: return "schmitt";
+ case PitchFComb: return "fcomb";
+ }
+}
+
--- /dev/null
+/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
+
+/*
+ Vamp feature extraction plugins using Paul Brossier's Aubio library.
+
+ Centre for Digital Music, Queen Mary, University of London.
+ This file copyright 2012 Queen Mary, University of London.
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version. See the file
+ COPYING included with this distribution for more information.
+
+*/
+
+#ifndef _ONSET_TYPE_H_
+#define _ONSET_TYPE_H_
+
+// Note: the enum values in this header are ordered to match the Vamp
+// plugin parameter values in earlier versions of this plugin set, to
+// avoid breaking stored parameter settings that use the parameter's
+// numerical value. Any additional values must be added after all
+// existing ones.
+
+enum OnsetType {
+ OnsetEnergy,
+ OnsetSpecDiff,
+ OnsetHFC,
+ OnsetComplex,
+ OnsetPhase,
+ OnsetKL,
+ OnsetMKL,
+ OnsetSpecFlux // new in 0.4!
+};
+
+extern const char *getAubioNameForOnsetType(OnsetType t);
+
+enum PitchType {
+ PitchYin,
+ PitchMComb,
+ PitchSchmitt,
+ PitchFComb,
+ PitchYinFFT
+};
+
+extern const char *getAubioNameForPitchType(PitchType t);
+
+
+#endif
+
+