changeset 1:dc88002ce687

some typos corrected
author fazekasgy
date Tue, 11 Mar 2008 20:24:58 +0000
parents e20e214bdfb5
children 211ebe55d521
files Example VamPy plugins/PyZeroCrossing.py README pyvamp-main.cpp
diffstat 3 files changed, 7 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/Example VamPy plugins/PyZeroCrossing.py	Tue Mar 11 19:47:34 2008 +0000
+++ b/Example VamPy plugins/PyZeroCrossing.py	Tue Mar 11 20:24:58 2008 +0000
@@ -1,4 +1,4 @@
-'''PyZeroCrossing.py - Example plugin designed to demonstrate''' 
+'''PyZeroCrossing.py - Example plugin demonstrates''' 
 '''how to call a python class using the VamPy VAMP plugin'''
 
 #from time import *
@@ -38,7 +38,7 @@
 			
 	def getOutputDescriptors(self):
 		
-		#python dictionary
+		#descriptors are python dictionary
 		output0={
 		'identifier':'vampy-counts',
 		'name':'Number of Zero Crossings',
@@ -119,7 +119,7 @@
 				if crossing == True : 
 					count = count + 1
 					feature1={
-					'hasTimestamp':True,		#bool
+					'hasTimestamp':True,	
 					#for now return sample position and convert to RealTime in C code
 					'timeStamp':x				
 					#'values':[count]			
@@ -135,7 +135,7 @@
 
 		feature0={
 		'hasTimestamp':False,		
-		'values':[count],			#strictly must be a list
+		'values':[count],		#strictly must be a list
 		'label':str(count)				
 		}
 		output0.append(feature0)
--- a/README	Tue Mar 11 19:47:34 2008 +0000
+++ b/README	Tue Mar 11 20:24:58 2008 +0000
@@ -46,6 +46,7 @@
 
 
 COMPILING AND LINKING:
+
 	(1) include Python.h wherever it is on your machine 
 	(2) this plugin needs to be linked against the Python binary:
 
@@ -53,8 +54,6 @@
 	g++  -O2 -Wall -I. -fPIC -c -o pyvamp-main.o pyvamp-main.cpp
 	g++  -dynamiclib   -o vamp-pyvamp-plugin.dylib ./PyPlugScanner.o ./PyPlugin.o ./pyvamp-main.o sdk/vamp-sdk/libvamp-sdk.a 
 	-u _PyMac_Error /Library/Frameworks/Python.framework/Versions/2.5/Python
-
-	OR:
 	
 	(3) There is a modified Makefile from the VAMP-SDK that compiles this plugin by default.
 
--- a/pyvamp-main.cpp	Tue Mar 11 19:47:34 2008 +0000
+++ b/pyvamp-main.cpp	Tue Mar 11 20:24:58 2008 +0000
@@ -38,22 +38,6 @@
  * This VAMP plugin is a wrapper for Python Scripts. (VamPy)
  * Centre for Digital Music, Queen Mary, University of London.
  * Copyright 2008, George Fazekas.
-
-TODO:	needs more complete error checking 
-	  	needs correct implementation of Python threading
-	  	more efficient data conversion using the buffering interface or ctypes
-	 	VAMP 'programs' not implemented
-		support multiple plugins per script in scanner
-		ensure proper cleanup, (host do a good job though)
-
-COMPILING AND LINKING:
-		(1) include Python.h wherever it is on your machine 
-		(2) this plugin needs to be linked against the Python binary:
-
-		example on on MacOSX:
-		g++  -O2 -Wall -I. -fPIC -c -o pyvamp-main.o pyvamp-main.cpp
-		g++  -dynamiclib   -o vamp-pyvamp-plugin.dylib ./PyPlugScanner.o ./PyPlugin.o ./pyvamp-main.o sdk/vamp-sdk/libvamp-sdk.a 
-		...	 -u _PyMac_Error /Library/Frameworks/Python.framework/Versions/2.5/Python
 */
 
 //#include "Python.h"
@@ -141,15 +125,14 @@
 			void *pylib = 0; 
 			
 			cerr << "Loading Python Interpreter at: " << pythonPath << endl;
-			//Preloading the binary allows the load of shared libs //dlopen("/Library/Frameworks/Python.framework/Versions/2.5/Python", RTLD_NOW|RTLD_GLOBAL);
-#ifdef _WIN32
+			//Preloading the binary allows the load of shared libs 
 			//TODO: check how to do RTLD_NOW on Windows
 			pylib = LoadLibrary(pythonPath.c_str());
 #else			
 			pylib = dlopen(pythonPath.c_str(), RTLD_NOW|RTLD_GLOBAL);
 #endif			
 			if (!pylib) cerr << "Warning: Could not preload Python." 
-						<< " Dynamic lodading in scripts will fail." << endl;
+						<< " Dynamic loading in scripts will fail." << endl;
 			Py_Initialize();
 	 		PyEval_InitThreads();			
 		} else {