示例#1
0
	MyApp(){
		seed = 1;
		tmr.period(2);
		tmr.finish();

		// Specify a reverb preset
		//reverb.resize(gam::JCREVERB); // Chowning (4-comb, 3-allpass)
		reverb.resize(gam::FREEVERB); // Jezar (8-comb, 4-allpass)

		// Or invent your own...
		//reverb.resize({1289, 2951, 2013}, {499, 951}); // pretty smooth
		//reverb.resize({3229, 3281, 4833}, {4487, 4097}); // crunchy
		//reverb.resize({3387, 3255, 3121}, {583, 491}); // colored
		//reverb.resize({3431, 4403, 5813}, {1645, 1299});

		//reverb.resize({1323, 1807, 1945, 2045}, {1559, 797, 297}); // pretty smooth
		//reverb.resize({1305, 1503, 1581, 1837}, {709, 535, 237}); // also smooth
		//reverb.resize({3013, 3799, 3479, 1799}, {335, 689, 907}); // less diffuse

		// Set decay length, in seconds
		reverb.decay(8);

		// Set high-frequency damping factor in [0, 1]
		reverb.damping(0.2);
	}
示例#2
0
	MyApp(){
		feedType=0;
		tmr.phaseMax();
		tmr.period(4);
		mod.period(4);
		src.freq(100);
		comb.maxDelay(1./100);
	}
void audioCB(AudioIOData& io){

	while(io()){
	
		float s = 0;
	
		if(tmr()){
			tmr.period(rnd::pick(0.4, 0.2));
			s = 0.2;
		}
		
		io.out(0) = io.out(1) = s;
	}
}
示例#4
0
	MyApp(){
		// Allocate 200 ms in the delay line
		delay.maxDelay(0.2);

		tmr.period(4);
		tmr.phaseMax();

		// Configure a short cosine grain
		src.set(1000, 0.8, 0.04, 0.25);

		// Set up low-pass filter
		lpf.type(gam::LOW_PASS);
		lpf.freq(2000);
	}
示例#5
0
	MyApp()
	:	stft(4096, 4096/4, 0, HANN, COMPLEX),
		chrA1(0.31, 0.002, 0.20111, -0.7, 0.9),
		chrA2(0.22, 0.002, 0.10151, -0.7, 0.9),
		chrA3(0.13, 0.002, 0.05131, -0.7, 0.9),
		chrB1(0.31, 0.002, 0.20141, -0.7, 0.9),
		chrB2(0.22, 0.002, 0.10171, -0.7, 0.9),
		chrB3(0.13, 0.002, 0.05111, -0.7, 0.9)
	{
		tmr.period(10);
		osc1.freq(40);
		osc2.freq(40.003);
		oscA.freq(62);
		oscB.freq(62.003);
		mix.period(60);
		modfs1.period(101);
		modfs2.period(102);
	}
示例#6
0
int main() 
{
	tmr.period(3);	// Reset the envelope every 3 seconds 
	env.attack(0.01);	// Attack time
	env.decay(0.05);	// Decay time


	// Delays, lowpass, and allpass filters setup code goes here 
	//
	lpf.type(LOW_PASS);
	lpf.freq(2600);
	lpf.res(sqrt(2.0)/2.0);

	AudioIO audioIO(frameCount, samplingRate, audioCallBack, NULL, channelsOut, channelsIn);
	Sync::master().spu(audioIO.framesPerSecond()); 
	audioIO.start();
	printf("Press 'enter' to quit...\n"); 
	getchar();
	return 0; 
}
示例#7
0
	void onAudio(AudioIOData& io){

		// Set period of timer, in seconds
		tmr.period(1);

		while(io()){

			// Retrigger damped sine periodically
			if(tmr()){
				osc.set(
					rnd::uni(10, 1)*50,	// frequency, in Hz
					0.2,				// amplitude
					rnd::lin(2., 0.1)	// decay length, in seconds
				);
			}
			
			float s = osc();

			io.out(0) = io.out(1) = s;
		}
	}
示例#8
0
	void onAudio(AudioIOData& io){

		tmr.period(0.25);

		// Set time taken to reach new frequency value
		freq.lag(0.1);

		while(io()){

			if(tmr()){
				// Set new target frequency of one-pole
				freq = pow(2, rnd::uniS(1.))*440;
			}

			// Use smoothed output of one-pole for oscillator frequency
			src.freq(freq());
			
			float s = src();
				
			io.out(0) = io.out(1) = s * 0.2f;
		}
	}
示例#9
0
void audioCB(AudioIOData& io){

	while(io()){
		using namespace gam::rnd;

		if(tmr()){
			env0 = uni(0.4, 0.39);
			if(prob(0.8)){
				float r = uni(1.);
				tmr.period(r * 4);
				env0.period(r * 4);
			}
			
			int a = pick(8,6, 0.7);
			if(prob(0.2)) osc0.freq(quanOct(a, 440.));
			if(prob(0.1)) osc1.freq(quanOct(a, 220.));
			if(prob(0.1)) osc2.freq(quanOct(a, 110.));
			if(prob(0.1)) osc3.freq(quanOct(a,  55.));
			if(prob(0.2)) frq0 = lin(8000, 400);
			if(prob(0.2)) frq1 = lin(8000, 400);//printf("d");
		}
		
		float e = lag(env0());
		del0.delay(e);
		del1.delay(e * 0.9);
		
		float s = (osc0.up() * mod0() + osc1.up() * mod1() + osc2.up() * mod2() + osc3.up() * mod3()) * 0.05;
		res0.freq(frq0()); res1.freq(frq1());
		s = res0(s) + res1(s);

		float sl = ech0(del0(s), ap0(ech0()));
		float sr = ech1(del1(s), ap1(ech1()));

		io.out(0) = sl;
		io.out(1) = sr;
	}
	
}
示例#10
0
	MyApp(){
		tmr.period(2);
		mod.period(2);
		osc.freq(220);
		waveform=0;
	}
示例#11
0
	MyApp(){
		tmr.period(2);
		type=0;
	}