# HG changeset patch # User Chris Cannam # Date 1416233220 0 # Node ID 6c755f3e11730f9c99e9ce492e0f67b6777fb4c6 # Parent f5b8646494d2d8089badcdbaf31c5ea779ca7428 More fixes diff -r f5b8646494d2 -r 6c755f3e1173 Example VamPy plugins/PySpectralCentroid.py --- a/Example VamPy plugins/PySpectralCentroid.py Mon Nov 17 12:53:51 2014 +0000 +++ b/Example VamPy plugins/PySpectralCentroid.py Mon Nov 17 14:07:00 2014 +0000 @@ -35,7 +35,6 @@ class PySpectralCentroid: def __init__(self,inputSampleRate): - self.m_imputSampleRate = 0.0 self.m_stepSize = 0 self.m_blockSize = 0 self.m_channels = 0 diff -r f5b8646494d2 -r 6c755f3e1173 Makefile.osx --- a/Makefile.osx Mon Nov 17 12:53:51 2014 +0000 +++ b/Makefile.osx Mon Nov 17 14:07:00 2014 +0000 @@ -1,7 +1,7 @@ -CXXFLAGS := -D_DEBUG -DHAVE_NUMPY -I../vamp-plugin-sdk -O2 -Wall -I/usr/include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/numpy/core/include/ +CXXFLAGS := -DHAVE_NUMPY -mmacosx-version-min=10.6 -I../vamp-plugin-sdk -O2 -Wall -I/usr/include/python2.7 -I/usr/local/lib/python2.7/site-packages/numpy/core/include -LDFLAGS := -install_name vampy.dylib -exported_symbols_list vamp-plugin.list ../vamp-plugin-sdk/libvamp-sdk.a -dynamiclib -lpython2.5 -lpthread +LDFLAGS := -install_name vampy.dylib -exported_symbols_list vamp-plugin.list -mmacosx-version-min=10.6 ../vamp-plugin-sdk/libvamp-sdk.a -dynamiclib -lpython2.7 -lpthread default: vampy.dylib all: vampy.dylib vampymod.so diff -r f5b8646494d2 -r 6c755f3e1173 PyPlugScanner.cpp --- a/PyPlugScanner.cpp Mon Nov 17 12:53:51 2014 +0000 +++ b/PyPlugScanner.cpp Mon Nov 17 14:07:00 2014 +0000 @@ -153,7 +153,7 @@ //Import it as a module into the py interpreter PyObject *pyModule = PyImport_Import(pySource); PyObject* pyError = PyErr_Occurred(); - if (! pyError == 0) { + if (pyError) { cerr << "ERROR: error importing source: " << classname << endl; PyErr_Print(); Py_DECREF(pySource); diff -r f5b8646494d2 -r 6c755f3e1173 PyTypeInterface.cpp --- a/PyTypeInterface.cpp Mon Nov 17 12:53:51 2014 +0000 +++ b/PyTypeInterface.cpp Mon Nov 17 14:07:00 2014 +0000 @@ -182,11 +182,16 @@ setValueError("Error while converting integer object.",m_strict); return 0; } + // this test is nonsense -- neither part can occur + // owing to range of data types -- size_t is at least + // as big as long, and unsigned is always non-negative +/* if ((unsigned long)rValue > SIZE_T_MAX || (unsigned long)rValue < 0) { setValueError("Overflow error. Object can not be converted to size_t.",m_strict); return 0; } +*/ return (size_t) rValue; } @@ -717,7 +722,7 @@ std::string msg = "NumPy array must be a one dimensional vector."; setValueError(msg,m_strict); #ifdef _DEBUG - cerr << "PyTypeInterface::PyArray_To_FloatVector failed. Error: " << msg << " Dims: " << (int) pyArray->nd << endl; + cerr << "PyTypeInterface::PyArray_To_FloatVector failed. Error: " << msg << " Dims: " << (int) PyArray_NDIM(pyArray) << endl; #endif return Output; } diff -r f5b8646494d2 -r 6c755f3e1173 README --- a/README Mon Nov 17 12:53:51 2014 +0000 +++ b/README Mon Nov 17 14:07:00 2014 +0000 @@ -1,5 +1,5 @@ - * Vampy is a wrapper for the Vamp audio analysis plugin API. +* Vampy is a wrapper for the Vamp audio analysis plugin API. (http://www.vamp-plugins.org/) It allows for writing Vamp plugins in Python. diff -r f5b8646494d2 -r 6c755f3e1173 vampy-main.cpp --- a/vampy-main.cpp Mon Nov 17 12:53:51 2014 +0000 +++ b/vampy-main.cpp Mon Nov 17 14:07:00 2014 +0000 @@ -31,7 +31,7 @@ // Vampy will not attempt to load a lower version than specified #ifdef HAVE_NUMPY #ifndef NUMPY_SHORTVERSION -#define NUMPY_SHORTVERSION 1.1 +#define NUMPY_SHORTVERSION 1.9 #endif #endif