fazekasgy@0
|
1
|
cannam@7
|
2 * VamPy is a Vamp plugin wrapper for Python Scripts.
|
fazekasgy@0
|
3
|
fazekasgy@0
|
4 WHAT IS IT FOR?
|
fazekasgy@0
|
5
|
cannam@7
|
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
|
cannam@7
|
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).
|
cannam@7
|
29 (3) Copy the library in your Vamp plugin directory like any other Vamp plugins:
|
cannam@7
|
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.
|
cannam@7
|
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@1
|
49
|
fazekasgy@0
|
50 (1) include Python.h wherever it is on your machine
|
fazekasgy@0
|
51 (2) this plugin needs to be linked against the Python binary:
|
fazekasgy@0
|
52
|
fazekasgy@0
|
53 example on on MacOSX:
|
fazekasgy@0
|
54 g++ -O2 -Wall -I. -fPIC -c -o pyvamp-main.o pyvamp-main.cpp
|
fazekasgy@0
|
55 g++ -dynamiclib -o vamp-pyvamp-plugin.dylib ./PyPlugScanner.o ./PyPlugin.o ./pyvamp-main.o sdk/vamp-sdk/libvamp-sdk.a
|
fazekasgy@0
|
56 -u _PyMac_Error /Library/Frameworks/Python.framework/Versions/2.5/Python
|
fazekasgy@0
|
57
|
cannam@7
|
58 (3) There is a modified Makefile from the Vamp SDK that compiles this plugin by default.
|
fazekasgy@0
|
59
|
fazekasgy@0
|
60
|
fazekasgy@0
|
61 TODO: needs more complete error checking
|
fazekasgy@0
|
62 needs correct implementation of Python threading
|
fazekasgy@0
|
63 more efficient data conversion using the buffering interface or ctypes
|
cannam@7
|
64 Vamp 'programs' not implemented
|
fazekasgy@0
|
65 support multiple classes per script in scanner
|
fazekasgy@0
|
66 ensure proper cleanup, (host do a good job though)
|
fazekasgy@0
|
67
|
fazekasgy@0
|
68
|