コード例 #1
0
ファイル: CsoundObj.c プロジェクト: amitkumar3968/csound
int CsoundObj_process(CsoundObj *self,
		int inNumberFrames,
		double *inputBuffer,
		double *outputBuffer)
{
	int result = csoundPerformKsmps(self->csound);

	if (result == 0) {

		int outputChannelCount = csoundGetNchnls(self->csound);
		int inputChannelCount = csoundGetNchnlsInput(self->csound);

		self->csoundOut = csoundGetSpout(self->csound);
		self->csoundIn = csoundGetSpin(self->csound);

		if (self->useAudioInput == 1) {

			memcpy(self->csoundIn, inputBuffer, sizeof(double) * inNumberFrames);
		}

		memcpy(outputBuffer, self->csoundOut, sizeof(double) * inNumberFrames * outputChannelCount);
//		printf("csoundOut =%f outputBuffer = %f\n", self->csoundOut[0], outputBuffer[0]);
	}

	return result;
}
コード例 #2
0
ファイル: CsoundObj.c プロジェクト: ryutaroikeda/csound
int CsoundObj_getInputChannelCount(CsoundObj *self)
{
    return csoundGetNchnlsInput(self->csound);
}
コード例 #3
0
ファイル: CsoundObj.c プロジェクト: amitkumar3968/csound
uint32_t CsoundObj_getNchnlsInput(CsoundObj *self)
{
	return csoundGetNchnlsInput(self->csound);
}