当前位置: 首页>>代码示例>>C++>>正文


C++ Accum::period方法代码示例

本文整理汇总了C++中Accum::period方法的典型用法代码示例。如果您正苦于以下问题:C++ Accum::period方法的具体用法?C++ Accum::period怎么用?C++ Accum::period使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Accum的用法示例。


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

示例1: Jezar

	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);
	}
开发者ID:LancePutnam,项目名称:Gamma,代码行数:25,代码来源:reverb.cpp

示例2:

	MyApp(){
		feedType=0;
		tmr.phaseMax();
		tmr.period(4);
		mod.period(4);
		src.freq(100);
		comb.maxDelay(1./100);
	}
开发者ID:LancePutnam,项目名称:Gamma,代码行数:8,代码来源:comb.cpp

示例3: audioCB

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;
	}
}
开发者ID:AlloSphere-Research-Group,项目名称:Gamma,代码行数:14,代码来源:oscAccum.cpp

示例4:

	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);
	}
开发者ID:LancePutnam,项目名称:Gamma,代码行数:14,代码来源:echo.cpp

示例5:

	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);
	}
开发者ID:LancePutnam,项目名称:Gamma,代码行数:18,代码来源:luster.cpp

示例6: main

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; 
}
开发者ID:akshay1992,项目名称:240D,代码行数:20,代码来源:Reverb_L.cpp

示例7: onAudio

	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;
		}
	}
开发者ID:LancePutnam,项目名称:Gamma,代码行数:21,代码来源:sineDamped.cpp

示例8: onAudio

	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;
		}
	}
开发者ID:PeterZhouSZ,项目名称:Gamma,代码行数:22,代码来源:portamento.cpp

示例9: audioCB

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;
	}
	
}
开发者ID:michaeldonovan,项目名称:wdl-md,代码行数:38,代码来源:sawCluster.cpp

示例10:

	MyApp(){
		tmr.period(2);
		mod.period(2);
		osc.freq(220);
		waveform=0;
	}
开发者ID:LancePutnam,项目名称:Gamma,代码行数:6,代码来源:lfoAudio.cpp

示例11:

	MyApp(){
		tmr.period(2);
		type=0;
	}
开发者ID:PeterZhouSZ,项目名称:Gamma,代码行数:4,代码来源:noise.cpp


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