comparison README @ 0:e20e214bdfb5

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