annotate README @ 0:e20e214bdfb5

Added VAMP-Python binding project vampy
author fazekasgy
date Tue, 11 Mar 2008 19:47:34 +0000
parents
children dc88002ce687
rev   line source
fazekasgy@0 1
fazekasgy@0 2 * VamPy is a VAMP plugin wrapper for Python Scripts.
fazekasgy@0 3
fazekasgy@0 4 WHAT IS IT FOR?
fazekasgy@0 5
fazekasgy@0 6 you can write VAMP plugins in Python which can do the same as the native C++ plugins
fazekasgy@0 7 plus more if you're using advanced Python modules.
fazekasgy@0 8
fazekasgy@0 9 you might get into VAMP development more easily this way.
fazekasgy@0 10 you can use it for prototyping your plugin before writing in C++
fazekasgy@0 11
fazekasgy@0 12
fazekasgy@0 13 LIMITATIONS:
fazekasgy@0 14
fazekasgy@0 15 this is really just a proof of concept. The implementation is not the most efficient.
fazekasgy@0 16 only tested on MacOSX, but in theory should work on other platforms with small fixes
fazekasgy@0 17 The Python C/API is not fully thread safe and correct threading is not yet implemented.
fazekasgy@0 18 (This can cause problems resulting in nasty crashes.)
fazekasgy@0 19
fazekasgy@0 20 Error checking is incomplete.
fazekasgy@0 21 You better not make a mistake in your Python script, although in most cases you can see what
fazekasgy@0 22 the problem is if you start the host (Sonic Visualiser) from the command line.
fazekasgy@0 23
fazekasgy@0 24
fazekasgy@0 25 HOW DOES IT WORK:
fazekasgy@0 26
fazekasgy@0 27 (1) Make sure you have Python installed.
fazekasgy@0 28 (2) Compile the C++ source or ask me for a binary (MacOS).
fazekasgy@0 29 (3) Copy the library in your Vamp plugin directory like any other VAMP plugins:
fazekasgy@0 30 eg. /Library/Audio/Plug-Ins/VAMP
fazekasgy@0 31 (4) Write your python plugins and copy them to the same place.
fazekasgy@0 32 (5) Each plugin must contain a single class with the same name as your script file.
fazekasgy@0 33 e.g. PyZeroCrossing.py -> calss PyZeroCrossing
fazekasgy@0 34 -Scripts with syntax errors in them are ignored.
fazekasgy@0 35 -Scripts not having the same class as the filename are ignored.
fazekasgy@0 36 -Other unknown scripts are likely to cause a nasty crash.
fazekasgy@0 37 (Don't put other python scripts in your VAMP directory.)
fazekasgy@0 38
fazekasgy@0 39
fazekasgy@0 40 WHY PYTHON?
fazekasgy@0 41
fazekasgy@0 42 Python is a general purpose high level scripting language.
fazekasgy@0 43 It is interpreted, so you don't need to compile your plugins
fazekasgy@0 44 It has very high level libraries. e.g. you can stream audio from your VamPy plugin (it works for me...)
fazekasgy@0 45 Supports functional programming
fazekasgy@0 46
fazekasgy@0 47
fazekasgy@0 48 COMPILING AND LINKING:
fazekasgy@0 49 (1) include Python.h wherever it is on your machine
fazekasgy@0 50 (2) this plugin needs to be linked against the Python binary:
fazekasgy@0 51
fazekasgy@0 52 example on on MacOSX:
fazekasgy@0 53 g++ -O2 -Wall -I. -fPIC -c -o pyvamp-main.o pyvamp-main.cpp
fazekasgy@0 54 g++ -dynamiclib -o vamp-pyvamp-plugin.dylib ./PyPlugScanner.o ./PyPlugin.o ./pyvamp-main.o sdk/vamp-sdk/libvamp-sdk.a
fazekasgy@0 55 -u _PyMac_Error /Library/Frameworks/Python.framework/Versions/2.5/Python
fazekasgy@0 56
fazekasgy@0 57 OR:
fazekasgy@0 58
fazekasgy@0 59 (3) There is a modified Makefile from the VAMP-SDK that compiles this plugin by default.
fazekasgy@0 60
fazekasgy@0 61
fazekasgy@0 62 TODO: needs more complete error checking
fazekasgy@0 63 needs correct implementation of Python threading
fazekasgy@0 64 more efficient data conversion using the buffering interface or ctypes
fazekasgy@0 65 VAMP 'programs' not implemented
fazekasgy@0 66 support multiple classes per script in scanner
fazekasgy@0 67 ensure proper cleanup, (host do a good job though)
fazekasgy@0 68
fazekasgy@0 69