Interesting idea, but the idea of having csound ship the data out-of-process and then importing it back in order to write it to disk seems a bit longwinded (and slow) But thank you for the idea, I may yet proceed along similar lines. On Thursday 03 April 2008 17:17, DavidW wrote: > hi Lilith, > Have you looked at using PyAudio? > > http://people.csail.mit.edu/hubert/pyaudio/docs/ > > D. > > On 03/04/2008, at 2:10 PM, Lilith Bryant wrote: > > I wonder if I could tap the list here for some advice. > > > > I'm writing a score writer front-end in python using the csound API. > > > > The big idea with this project, is to be able to quickly change the > > score and > > re-render with having csound reload the whole orchestra/csd file for > > every > > simple score change. So i'm simply calling the csoundCompile and > > all the > > prequisites once at the beginning of my application (or whenever the > > user > > asks to reload the orchestra/csd) > > > > Then for each renderering, I call csoundScoreRewind and then > > csoundScoreEvent > > for each note. > > > > Which works as expected, except the output wav file simply grows > > with easy > > pass. i.e. it csoundScoreRewind doesn't clear it, like would be > > useful for > > this case. > > > > Now I can alternatively not use wav file output at all, and use > > csoundSetHostImplementedAudioIO and manually fish out the samples, > > and write > > them to a wav file myself. But this is python and that hideously > > slow. > > > > So the questions are: > > 1) Is there a way to restart the wav file output without reloading the > > orchestra/csd? > > > > OR > > > > 2) Is there a quick way to fish out the output buffer samples into a > > python > > string or array, for writing out to file using the python wav module? > > > > The best i have so far is something like: > > > > ob=csnd.csoundGetOutputBuffer(self.cs) > > fa=csnd.floatArray.frompointer(ob) > > sa=array.Array('h',[0]*buffersize*2) > > for n in range(buffersize*2): > > sa[n]=fa[n]*32767 > > wavdata=sa.tostring() > > > > which really SUCKS performance-wise (not surprisingly). > > > > I don't want to write a C/SWIG function to do just this, since i > > want to be > > able to give this to people who aren't up to running compilers. > > Send bugs reports to this list. > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe > csound"