On Monday 07 April 2008 14:53, Balan Clockfactory wrote: > in python the call to csound.GetOutputBuffer() returns a PySwigObject > wrapping a double*. how is this supposed to be used? or rather, how can a > get an array out of GetOutputBuffer()? > > x = csound.GetOutputBuffer() # what do i do with x? > > Also, using PerformBuffer() or PerformKsmps() in a matlab Mex file causes > a (very bad) segmentation fault in matlab. you use it to create a floatArray or doubleArray object: x=csnd.csoundGetOutputBuffer(self.cs) fa=csnd.floatArray.frompointer(x) but warning this is really pathetically slow to use. and its of unbounded length. i.e. you can't say "for f in fa:", because fa has no limit, it will just segfault when you run off the end of the buffer it would be much better if it returned a python array.array ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Register now and save $200. Hurry, offer ends at 11:59 p.m., Monday, April 7! Use priority code J8TLD2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net