#include "common.h"
#include "sig_test.h"

sig_test::sig_test()
{
	sine.setFrequency(440.0);
}

StkFloat sig_test::tick(void)
{
#if 0
	// debug pcm
	short *debugPcm = new short[nBufferFrames];
	StkFloat *debugFloat = (StkFloat *) outputBuffer;
	for( unsigned int i = 0; i <nBufferFrames; i++) {
		debugPcm[i] = (short)(SHRT_MAX * debugFloat[i]);
	}
	delete debugPcm;
#endif
	
	//lastSample = sine.tick();
	lastSample = (sine.tick() + noise.tick()) * 0.5;

	short lastSampleS = (short)(lastSample * SHRT_MAX);
	
	DebugPcmOut("debug.pcm", lastSampleS);
	
	return lastSample;
}
