• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TTAudioSignalArrayPtr类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中TTAudioSignalArrayPtr的典型用法代码示例。如果您正苦于以下问题:C++ TTAudioSignalArrayPtr类的具体用法?C++ TTAudioSignalArrayPtr怎么用?C++ TTAudioSignalArrayPtr使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了TTAudioSignalArrayPtr类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1:

TTErr Slinky3D::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&		out = outputs->getSignal(0);
	TTUInt16			numOutputChannels = out.getNumChannelsAsInt();
	
	if (numOutputChannels != 3) {
		TTValue v = 3;		
		out.setMaxNumChannels(v);
		out.setNumChannels(v);		
	}
	
	TTAudioSignal&		in0 = inputs->getSignal(0);
	TTUInt16			 vs = in0.getVectorSizeAsInt();
	
	TTSampleValuePtr	inSampleX			= in0.mSampleVectors[0];
	TTSampleValuePtr	outSampleX    		= out.mSampleVectors[0];
	TTSampleValuePtr	outSampleY			= out.mSampleVectors[1];
    TTSampleValuePtr	outSampleZ			= out.mSampleVectors[2];
    
	TTFloat64 phi, temp;
	
	for (int i=0; i<vs; i++) {	
						
		phi = inSampleX[i] * kTTTwoPi - kTTTwoPi; // -2Pi .. 2Pi
		temp = mB + mA*cos(phi);
		outSampleX[i] = temp*cos(phi);
		outSampleY[i] = temp*sin(phi);
		outSampleZ[i] = mC*(inSampleX[i]-1.0) + mA*sin(phi);

	}
return kTTErrNone;
}
开发者ID:ChristianFrisson,项目名称:JamomaCore,代码行数:32,代码来源:Slinky3D.cpp


示例2: processAudio

// TODO: this unit requires 1 input and 2 outputs -- it does not yet configure itself for other arrangements!
TTErr TTZerocross::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&	in = inputs->getSignal(0);
	TTAudioSignal&	out = outputs->getSignal(0);
	TTUInt16		vs = in.getVectorSizeAsInt();
	TTSampleValue*	inSample;
	TTSampleValue*	out1Sample;
	TTSampleValue*	out2Sample;
	TTBoolean		thisSampleIsOverZero;
	TTBoolean		zeroxOccured;

	inSample = in.mSampleVectors[0];
	out1Sample = out.mSampleVectors[0];
	out2Sample = out.mSampleVectors[1];

	while (vs--) {
		thisSampleIsOverZero = (0 < (*inSample++));
		zeroxOccured = lastSampleWasOverZero != thisSampleIsOverZero;
		lastSampleWasOverZero = thisSampleIsOverZero;
		
		counter += zeroxOccured;
		analysisLocation++;
		
		if (analysisLocation >= mSize) {
			finalCount = ((sr * counter) * rSize) * srInv;
			analysisLocation = 0;
			counter = 0;
		}
		
		*out1Sample++ = finalCount;
		*out2Sample++ = zeroxOccured;
	}
		
	return kTTErrNone;
}
开发者ID:alexarje,项目名称:JamomaDSP,代码行数:36,代码来源:TTZerocross.cpp


示例3: pow

TTErr Bean2D::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&		out = outputs->getSignal(0);
	TTChannelCount		numOutputChannels = out.getNumChannelsAsInt();
	
	if (numOutputChannels != 2) {
		TTValue v = 2;		
		out.setMaxNumChannels(v);
		out.setNumChannels(v);		
	}
	
	TTAudioSignal&		in0 = inputs->getSignal(0);
	TTUInt16			vs  = in0.getVectorSizeAsInt();
	
	TTSampleValuePtr	inSampleX			= in0.mSampleVectors[0];
	TTSampleValuePtr	outSampleX    		= out.mSampleVectors[0];
	TTSampleValuePtr	outSampleY			= out.mSampleVectors[1];
    TTFloat64 phi, r;
	
	for (int i=0; i<vs; i++) {	
		
		phi = inSampleX[i] * kTTPi; // 0 .. 2Pi
		r = pow(sin(phi),3.0) + pow(cos(phi), 3.0);
		
		outSampleX[i] = sin(phi) * r;
		outSampleY[i] = cos(phi) * r;

	}
return kTTErrNone;
}
开发者ID:Cplaton,项目名称:JamomaCore,代码行数:30,代码来源:Bean2D.cpp


示例4: cos

TTErr Hypocycloid2D::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&		out = outputs->getSignal(0);
	TTChannelCount		numOutputChannels = out.getNumChannelsAsInt();
	
	if (numOutputChannels != 2) {
		TTValue v = 2;		
		out.setMaxNumChannels(v);
		out.setNumChannels(v);		
	}
	
	TTAudioSignal&		in0 = inputs->getSignal(0);
	TTUInt16			 vs = in0.getVectorSizeAsInt();
	
	TTSampleValuePtr	inSampleX			= in0.mSampleVectors[0];
	TTSampleValuePtr	outSampleX    		= out.mSampleVectors[0];
	TTSampleValuePtr	outSampleY			= out.mSampleVectors[1];
    TTFloat64 phi;
	
	for (int i=0; i<vs; i++) {	

		phi = inSampleX[i] * kTTPi; // 0 .. 2Pi
		
		outSampleX[i] = aMinusOne * cos(phi) + cos(aMinusOne * phi);
		outSampleY[i] = aMinusOne * sin(phi) + sin(aMinusOne * phi);

	}
return kTTErrNone;
}
开发者ID:Cplaton,项目名称:JamomaCore,代码行数:29,代码来源:Hypocycloid2D.cpp


示例5: sin

TTErr CircularHelix3D::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&		out = outputs->getSignal(0);
	TTChannelCount		numOutputChannels = out.getNumChannelsAsInt();
	
	if (numOutputChannels != 3) {
		TTValue v = 3;		
		out.setMaxNumChannels(v);
		out.setNumChannels(v);		
	}
	
	TTAudioSignal&		in0 = inputs->getSignal(0);
	TTUInt16			 vs = in0.getVectorSizeAsInt();
	
	TTSampleValuePtr	inSampleX			= in0.mSampleVectors[0];
	TTSampleValuePtr	outSampleX    		= out.mSampleVectors[0];
	TTSampleValuePtr	outSampleY			= out.mSampleVectors[1];
    TTSampleValuePtr	outSampleZ			= out.mSampleVectors[2];
    
	TTFloat64 phi;
	
	for (int i=0; i<vs; i++) {	
						
		phi = inSampleX[i] * kTTPi; // 0 .. 2Pi
		outSampleX[i] = sin(phi);
		outSampleY[i] = cos(phi);
		outSampleZ[i] = mA * (inSampleX[i]-1.0); //scaling 0 ..2 to -1.. 1

	}
return kTTErrNone;
}
开发者ID:Cplaton,项目名称:JamomaCore,代码行数:31,代码来源:CircularHelix3D.cpp


示例6: processAudio

TTErr TTDegrade::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&	in = inputs->getSignal(0);
	TTAudioSignal&	out = outputs->getSignal(0);
	TTUInt16		vs;
	TTSampleValue	*inSample,
					*outSample;
	TTUInt16		numchannels = TTAudioSignal::getMinChannelCount(in, out);
	TTUInt16		channel;
	long			l;

	for (channel=0; channel<numchannels; channel++) {
		inSample = in.mSampleVectors[channel];
		outSample = out.mSampleVectors[channel];
		vs = in.getVectorSizeAsInt();
		
		while (vs--) {
			// SampeRate Reduction
			mAccumulator[channel] += mSrRatio;
			if (mAccumulator[channel] >= 1.0) {
				mOutput[channel] = *inSample++;
				mAccumulator[channel] -= 1.0;
			}
		
			// BitDepth Reduction
			l = (long)(mOutput[channel] * BIG_INT);			// change float to long int
			l >>= mBitShift;									// shift away the least-significant bits
			l <<= mBitShift;									// shift back to the correct registers
			*outSample++ = (float) l * ONE_OVER_BIG_INT;	// back to float
		}
	}
	return kTTErrNone;
}
开发者ID:RWelsh,项目名称:JamomaDSP,代码行数:33,代码来源:TTDegrade.cpp


示例7:

TTErr Linear3D::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&		out = outputs->getSignal(0);
	TTChannelCount		numOutputChannels = out.getNumChannelsAsInt();
	
	if (numOutputChannels != 3) {
		TTValue v = 3;		
		out.setMaxNumChannels(v);
		out.setNumChannels(v);		
	}
	
	TTAudioSignal&		in0 = inputs->getSignal(0);

	
	TTUInt16			vs = in0.getVectorSizeAsInt();
	
	TTSampleValuePtr	inSampleX			= in0.mSampleVectors[0];
	TTSampleValuePtr	outSampleX    		= out.mSampleVectors[0];
	TTSampleValuePtr	outSampleY			= out.mSampleVectors[1];
	TTSampleValuePtr	outSampleZ			= out.mSampleVectors[2];

	for (int i=0; i<vs; i++) {	
		outSampleX[i] = inSampleX[i]-1.0;
		outSampleY[i] = mA * outSampleX[i];			
		outSampleZ[i] = mB * outSampleX[i];
	}
	return kTTErrNone;
}
开发者ID:Cplaton,项目名称:JamomaCore,代码行数:28,代码来源:Linear3D.cpp


示例8: processUpsample

TTErr TTStaircase::processUpsample(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
    TTAudioSignal&	in = inputs->getSignal(0);
    TTAudioSignal&	out = outputs->getSignal(0);
    TTSampleValue*	inSample;
    TTSampleValue*	outSample;
    TTUInt16		numchannels = TTAudioSignal::getMinChannelCount(in, out);
    TTPtrSizedInt	channel;
    TTUInt16		targetVectorSize = in.getVectorSizeAsInt() * 2;
    TTErr			err;

    err = out.changeVectorSize(targetVectorSize);
    if (!err) {
        out.setSampleRate(in.getSampleRate() * 2);
        for (channel=0; channel<numchannels; channel++) {
            TTUInt16		n = in.getVectorSizeAsInt();
            TTSampleValue	x;

            inSample = in.mSampleVectors[channel];
            outSample = out.mSampleVectors[channel];

            while (n--) {
                x = *inSample++;
                *outSample++ = x;
                *outSample++ = x;
            }
        }
    }
    return kTTErrNone;
}
开发者ID:ChristianFrisson,项目名称:JamomaCore,代码行数:30,代码来源:TTStaircase.cpp


示例9: sin

TTErr Butterfly2D::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
    TTAudioSignal&		out = outputs->getSignal(0);
    TTUInt16			numOutputChannels = out.getNumChannelsAsInt();

    if (numOutputChannels != 2) {
        TTValue v = 2;
        out.setMaxNumChannels(v);
        out.setNumChannels(v);
    }

    TTAudioSignal&		in0 = inputs->getSignal(0);
    TTUInt16			 vs = in0.getVectorSizeAsInt();

    TTSampleValuePtr	inSampleX			= in0.mSampleVectors[0];
    TTSampleValuePtr	outSampleX    		= out.mSampleVectors[0];
    TTSampleValuePtr	outSampleY			= out.mSampleVectors[1];
    TTFloat64 phi, r, temp;

    for (int i=0; i<vs; i++) {

        phi = inSampleX[i] * kTTPi; // 0 .. 2Pi
        temp = sin(1/24*(2*phi-kTTPi));
        r = exp(sin(phi)) - 2*cos(4*phi)+pow(temp,5);

        outSampleX[i] = sin(phi) * r;
        outSampleY[i] = cos(phi) * r;

    }
    return kTTErrNone;
}
开发者ID:ChristianFrisson,项目名称:JamomaCore,代码行数:31,代码来源:Butterfly2D.cpp


示例10: sin

TTErr Lissajous2D::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&		out = outputs->getSignal(0);
	TTChannelCount		numOutputChannels = out.getNumChannelsAsInt();
	
	if (numOutputChannels != 2) {
		TTValue v = 2;		
		out.setMaxNumChannels(v);
		out.setNumChannels(v);		
	}
	
	TTAudioSignal&		in0 = inputs->getSignal(0);
	TTUInt16			 vs = in0.getVectorSizeAsInt();
	
	TTSampleValuePtr	inSampleX			= in0.mSampleVectors[0];
	TTSampleValuePtr	outSampleX    		= out.mSampleVectors[0];
	TTSampleValuePtr	outSampleY			= out.mSampleVectors[1];
	TTFloat64 omega;
	
	for (int i=0; i<vs; i++) {	
		omega = inSampleX[i] * kTTPi;
		
		outSampleX[i] = sin(omega * mAa + mDeltaX);
		outSampleY[i] = sin(omega * mAb);
		}
return kTTErrNone;
}
开发者ID:Cplaton,项目名称:JamomaCore,代码行数:27,代码来源:Lissajous2D.cpp


示例11: processAudio

TTErr TTBalance::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&	in = inputs->getSignal(0);
	TTAudioSignal&	out = outputs->getSignal(0);
	TTUInt16		vs;
	TTSampleValue	*inSampleA,
					*inSampleB,
					*outSample;
	TTFloat64		tempxA,
					absTempxA,
					tempxB,
					absTempxB,
					tempyA,
					tempyB;											
	TTUInt16		channel;
	TTUInt16		numChannels;

	// Twice as many input channels are expected as output channels
	numChannels = TTAudioSignal::getNumChannels(in) / 2;
	if (TTAudioSignal::getNumChannels(out) < numChannels)
		numChannels = TTAudioSignal::getNumChannels(out);

	// This outside loop works through each channel one at a time
	for (channel=0; channel<numChannels; channel++) {
		// We first expect all channels of inputSignalA, then all channels of inputSignalB
		inSampleA = in.mSampleVectors[channel];
		inSampleB = in.mSampleVectors[channel+numChannels];
		outSample = out.mSampleVectors[channel];
		vs = in.getVectorSizeAsInt();
		
		// This inner loop works through each sample within the channel one at a time
		while (vs--) {
			tempxA = *inSampleA++;
			absTempxA = fabs(tempxA);
			tempxB = *inSampleB++;
			absTempxB = fabs(tempxB);
			// Lopass filter left and right signals
			tempyA = a0*absTempxA + a1*xm1A[channel] + a2*xm2A[channel] - b1*ym1A[channel] - b2*ym2A[channel];
			TTZeroDenormal(tempyA);
			tempyB = a0*absTempxB + a1*xm1B[channel] + a2*xm2B[channel] - b1*ym1B[channel] - b2*ym2B[channel];		
			TTZeroDenormal(tempyB); 
			// Scale left input to produce output, avoid dividing by zero
			if (tempyA)
				*outSample++ = tempxA * (tempyB/tempyA);
			else
				*outSample++ = 0.;
			// Update filter values
			xm2A[channel] = xm1A[channel];
			xm1A[channel] = absTempxA;
			ym2A[channel] = ym1A[channel];
			ym1A[channel] = tempyA;
			xm2B[channel] = xm1B[channel];
			xm1B[channel] = absTempxB;
			ym2B[channel] = ym1B[channel];
			ym1B[channel] = tempyB;
		}
	}
	return kTTErrNone;
}
开发者ID:RWelsh,项目名称:JamomaDSP,代码行数:59,代码来源:TTBalance.cpp


示例12: processAudio

TTErr TTThru::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&	in = inputs->getSignal(0);
	TTAudioSignal&	out = outputs->getSignal(0);
	
	// We can't reliably simply reference in the case of jcom.unpack≈ because of crashes
	// not sure what is going wrong with that yet...
	
	//return TTAudioSignal::reference(in, out);
	return TTAudioSignal::copy(in, out);
}
开发者ID:ChristianFrisson,项目名称:JamomaCore,代码行数:11,代码来源:TTThru.cpp


示例13: processAudio

TTErr TTSpatBaseRenderer::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{	
	TTAudioSignal&		in = inputs->getSignal(0);
	TTAudioSignal&		out = outputs->getSignal(0);
	TTUInt16			vs = in.getVectorSizeAsInt();
	TTSampleValuePtr	inSample;
	TTSampleValuePtr	outSample;
	TTChannelCount		numInputChannels = in.getNumChannelsAsInt();
	TTChannelCount		numOutputChannels = out.getNumChannelsAsInt();
	TTChannelCount		outChannel;
	TTChannelCount		inChannel;
    TTSampleValue       gainValue;
	
	TTInt16				sourceCount = mMixerMatrixCoefficients->getRowCount();
	TTInt16				sinkCount	= mMixerMatrixCoefficients->getColumnCount();
	
	// If the input signal has more channels than we have sources, the additional channels are ignored.
	if (numInputChannels > sourceCount) {
		numInputChannels = sourceCount;
	}
	
	// Force the right number of sinks
	if ( numOutputChannels != sinkCount ) {
		TTValue v = sinkCount;
		
		out.setMaxNumChannels(v);
		out.setNumChannels(v);
		numOutputChannels = sinkCount;
	}
	// Setting all output signals to zero.
	out.clear();
	
	// TODO: Make sure that when we iterate over the matrix, this is done in an efficient way.
	
	for (outChannel=0; outChannel<numOutputChannels; outChannel++) {
		outSample = out.mSampleVectors[outChannel];
		for (inChannel=0; inChannel<numInputChannels; inChannel++) {
			
			mMixerMatrixCoefficients->get2d(inChannel, outChannel, gainValue);
			
			if (gainValue != 0.0){
				inSample = in.mSampleVectors[inChannel];
				for (int i=0; i<vs; i++) {
					outSample[i] += inSample[i] * gainValue;
				}
			}
		}
	}
	return kTTErrNone;
	
}
开发者ID:Cplaton,项目名称:JamomaCore,代码行数:51,代码来源:TTSpatBaseRenderer.cpp


示例14: bypassProcess

TTErr TTAudioObjectBase::bypassProcess(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	for (TTChannelCount i=0; i<outputs->numAudioSignals; i++) {
		TTAudioSignal& out = outputs->getSignal(i);

		if (i<inputs->numAudioSignals) {
			TTAudioSignal& in = inputs->getSignal(i);
			TTAudioSignal::copy(in, out);
		}
		else
			out.clear();
	}
	return kTTErrNone;
}
开发者ID:Cplaton,项目名称:JamomaCore,代码行数:14,代码来源:TTAudioObjectBase.cpp


示例15: processAudio

	TTErr processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
	{
		TTAudioSignal&	in = inputs->getSignal(0);
		TTUInt16		channelOffset = 0;
		
		for (TTUInt16 i=0; i < outputs->numAudioSignals; i++) {
			TTAudioSignal&	out = outputs->getSignal(i);
			TTUInt16		numChannels = mSplitChannels[i];
			
			// TODO: we don't really want to alloc this memory every time!
			out.setMaxNumChannels(numChannels);
			out.setNumChannels(numChannels);
			TTAudioSignal::copySubset(in, out, channelOffset, channelOffset+numChannels-1);
			channelOffset += numChannels;
		}
		return kTTErrNone;
	}
开发者ID:alexarje,项目名称:JamomaAudioGraph,代码行数:17,代码来源:jcom.split.cpp


示例16: processAudio

TTErr SpatThru::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&	src = inputs->getSignal(0);
	TTAudioSignal&	dst = outputs->getSignal(0);
	TTUInt16		vs = src.getVectorSizeAsInt();
	TTSampleValue*	srcSample;
	TTSampleValue*	dstSample;
	
	TTUInt16		channel;
	
	TTUInt16		srcChannelCount = src.getNumChannelsAsInt();
	TTUInt16		dstChannelCount = dst.getNumChannelsAsInt();
	
	if (srcChannelCount != mSourceCount) {
		setSourceCount(srcChannelCount);	// for now, adapting to the number of inputs 
	}
	
	if (dstChannelCount != mDestinationCount) {
		TTValue v = mDestinationCount;
		
		dst.setMaxNumChannels(v);
		dst.setNumChannelsWithInt(v);		
		dstChannelCount = mDestinationCount;
	}
	
	TTUInt16		numchannels = TTAudioSignal::getMinChannelCount(dst,src);	
	
	for (channel=0; channel<numchannels; channel++) {
		srcSample = src.mSampleVectors[channel];
		dstSample = dst.mSampleVectors[channel];
		memcpy(dstSample, srcSample, sizeof(TTSampleValue) * vs);	
	}
	
	if (dstChannelCount > srcChannelCount) {
		for (channel; channel<dstChannelCount; channel++) {
			dstSample = dst.mSampleVectors[channel];
			memset(dstSample, 0, sizeof(TTSampleValue) * vs);
		}
	}
	
	return kTTErrNone;
}
开发者ID:RWelsh,项目名称:JamomaDSP,代码行数:42,代码来源:SpatThru.cpp


示例17: processAudio

TTErr PlugtasticOutput::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&	in = inputs->getSignal(0);
	TTAudioSignal&	out = outputs->getSignal(0);
	TTUInt16		vs;
	TTSampleValue	*inSample,
	*outSample;
	TTUInt16		numchannels = TTAudioSignal::getMinChannelCount(in, out);
	TTUInt16		channel;
	
	for (channel=0; channel<numchannels; channel++) {
		inSample = in.mSampleVectors[channel];
		outSample = out.mSampleVectors[channel];
		vs = in.getVectorSizeAsInt();
		
		while (vs--)
			*outSample++ = (*inSample++) * mGain;
	}
	return kTTErrNone;
}
开发者ID:ChristianFrisson,项目名称:JamomaCore,代码行数:20,代码来源:PlugtasticOutput.cpp


示例18: processAudio

TTErr TTAudioGraphInput::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	if (outputs->numAudioSignals){
		TTAudioSignal&	out = outputs->getSignal(0);

		out = *mBuffer;
		return kTTErrNone;
	}
	else
		return kTTErrBadChannelConfig;
}
开发者ID:ChristianFrisson,项目名称:JamomaCore,代码行数:11,代码来源:TTAudioGraphInput.cpp


示例19: if

TTErr Catmullrom3D::processAudio(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&		out = outputs->getSignal(0);
	TTChannelCount		numOutputChannels = out.getNumChannelsAsInt();
	
	if (numOutputChannels != 3) {
		TTValue v = 3;		
		out.setMaxNumChannels(v);
		out.setNumChannels(v);		
	}
	
	TTAudioSignal&		in0 = inputs->getSignal(0);
	TTUInt16			 vs = in0.getVectorSizeAsInt();
	
	TTSampleValuePtr	inSampleX			= in0.mSampleVectors[0];
	TTSampleValuePtr	outSampleX    		= out.mSampleVectors[0];
	TTSampleValuePtr	outSampleY			= out.mSampleVectors[1];
	TTSampleValuePtr	outSampleZ			= out.mSampleVectors[2];
    TTFloat64 f;
	
	for (int i=0; i<vs; i++) {	
						
		f = inSampleX[i] * 0.5; //0... 1. 
		
		if ((f > 0) && (f < 1)){
			spline_eval(f);
			
			//calculatePoint();											// output intermediate point
			outSampleX[i] = b_op[0];
			outSampleY[i] = b_op[1];
			outSampleZ[i] = b_op[2];
		} else if (f <= 0.0){
					// output the first point
		} else if (f >= 1.0){
				// output the last point
		}
	}
return kTTErrNone;
}
开发者ID:Cplaton,项目名称:JamomaCore,代码行数:39,代码来源:Catmullrom3D.cpp


示例20: calculateProcess

// Note that we can implement this function here like this, but unforunately, due to the dynamic binding
// it can't inline the calculate method, and thus it we lose all of the benefits of block processing.
// Therefore, we have a version of this in macro form that can be used.
TTErr TTAudioObjectBase::calculateProcess(TTAudioSignalArrayPtr inputs, TTAudioSignalArrayPtr outputs)
{
	TTAudioSignal&	in = inputs->getSignal(0);
	TTAudioSignal&	out = outputs->getSignal(0);
	TTUInt16		vs;
	TTSampleValue*	inSample;
	TTSampleValue*	outSample;
	TTChannelCount	numchannels = TTAudioSignal::getMinChannelCount(in, out);
	TTPtrSizedInt	channel;
	
	for (channel=0; channel<numchannels; channel++) {
		inSample = in.mSampleVectors[channel];
		outSample = out.mSampleVectors[channel];
		vs = in.getVectorSizeAsInt();
		
		while (vs--) {
			calculate(*inSample, *outSample);
			outSample++;
			inSample++;
		}
	}
	return kTTErrNone;
}
开发者ID:Cplaton,项目名称:JamomaCore,代码行数:26,代码来源:TTAudioObjectBase.cpp



注:本文中的TTAudioSignalArrayPtr类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TTAudioSignalPtr类代码示例发布时间:2022-05-31
下一篇:
C++ TTAddress类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap