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