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


C++ LFO::imp方法代码示例

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


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

示例1: onAudio

	void onAudio(AudioIOData& io){

		while(io()){

			// Increment waveform type
			if(tmr()) (++waveform)%=13;

			// Modulate modifier parameter with raised cosine
			osc.mod(mod.cosU());
		
			float s = 0.f;
			
			switch(waveform){ 
					
				// non-modifiable generators ordered from dull to bright:
				case  0: s = osc.cos();		break;		// Cosine approximation: one harmonic
				case  1: s = osc.even3();	break;		// Even harmonic sine-like wave (3rd order)
				case  2: s = osc.even5();	break;		// Even harmonic sine-like wave (5th order)
				case  3: s = osc.tri();		break;		// Triangle wave: 1/f^2 odd harmonics
				case  4: s = osc.para();	break;		// Parabola train: 1/f^2 all harmonics
				case  5: s = osc.sqr()/4;	break;		// Square wave: 1/f odd harmonics
				case  6: s = osc.down()/4;	break;		// Downward saw wave: 1/f all harmonics
				case  7: s = osc.up()/4;	break;		// Upward saw wave: 1/f all harmonics
				case  8: s = osc.imp()/4;	break;		// Impulse train: flat spectrum all harmonics
				
				// modifiable generators ordered from dull to bright:
				case  9: s = osc.stair()/4;	break;		// Mix between a square and impulse
				case 10: s = osc.pulse()/4;	break;		// Mix between up and down
				case 11: s = osc.line2()/4;	break;		// Mix between a saw and a triangle
				case 12: s = osc.up2()/4;	break;		// Mix between two saws
			}
			
			io.out(0) = io.out(1) = s * 0.2f;
		}
	}
开发者ID:LancePutnam,项目名称:Gamma,代码行数:35,代码来源:lfoAudio.cpp


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