[Csnd] Getting output buffer from Csound API
Date | 2012-12-07 17:14 |
From | Roger Kelly |
Subject | [Csnd] Getting output buffer from Csound API |
How would I go about getting the audio output buffer using CSoundAPI? I want to grab the audio as it is running the csd.
|
Date | 2012-12-07 17:59 |
From | Michael Gogins |
Subject | Re: [Csnd] Getting output buffer from Csound API |
You can grab the low level buffer (ksmps sample frames) or the higher level buffer. Where is the audio going? What language are you using? Regards, Mike On Fri, Dec 7, 2012 at 12:14 PM, Roger Kelly |
Date | 2012-12-07 18:28 |
From | Roger Kelly |
Subject | Re: [Csnd] Getting output buffer from Csound API |
It is Python. I have looked at many of the functions GetInputBuffer, etc, but can't piece together the sequence of calls needed. Could you tell me what sequence of calls need to be done? On Fri, Dec 7, 2012 at 11:59 AM, Michael Gogins <michael.gogins@gmail.com> wrote: You can grab the low level buffer (ksmps sample frames) or the higher |
Date | 2012-12-08 03:34 |
From | Roger Kelly |
Subject | Re: [Csnd] Getting output buffer from Csound API |
I am wanting to bring the audio frame back into the python application. On Fri, Dec 7, 2012 at 12:28 PM, Roger Kelly <loraxman+csound@gmail.com> wrote: It is Python. I have looked at many of the functions GetInputBuffer, etc, but can't piece together the sequence of calls needed. |
Date | 2012-12-08 04:20 |
From | Roger Kelly |
Subject | Re: [Csnd] Getting output buffer from Csound API |
Figured it out from oscilloscope example: cs = csnd.Csound() cs.Compile("cb.csd") chn = csnd.floatArray(cs.GetKsmps()) print chn f = open("test3.wav","wb")
# define callback def callback(csound): a = csound.GetChannel("freq") sig = array.array('f') cs.ChanOAGet(chn.cast(), 1) for i in range(0,cs.GetKsmps()):
sig.append(chn[i]/32768.0) On Fri, Dec 7, 2012 at 9:34 PM, Roger Kelly <loraxman+csound@gmail.com> wrote: I am wanting to bring the audio frame back into the python application. |