本文整理汇总了C++中AD::attack方法的典型用法代码示例。如果您正苦于以下问题:C++ AD::attack方法的具体用法?C++ AD::attack怎么用?C++ AD::attack使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AD
的用法示例。
在下文中一共展示了AD::attack方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: short
MyApp(){
lpf.type(LOW_PASS); // Set filter to low-pass response
lpf.res(4); // Set resonance amount to emphasize filter
env.attack(0.01); // Set short (10 ms) attack
env.decay(0.4); // Set longer (400 ms) decay
tmr.freq(120./60.*4.); // Set timer frequency to 120 BPM
tmr.phaseMax(); // Ensures timer triggers on first sample
modCutoff.period(30); // Set period of cutoff modulation
modCutoff.phase(0.5); // Start half-way through cycle
freq.lag(0.1); // Lag time of portamento effect
step=0;
}
示例2: 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;
}