本文整理汇总了C++中Accum::freq方法的典型用法代码示例。如果您正苦于以下问题:C++ Accum::freq方法的具体用法?C++ Accum::freq怎么用?C++ Accum::freq使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Accum
的用法示例。
在下文中一共展示了Accum::freq方法的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: audioCB
void audioCB(AudioIOData& io){
position pos;
pos.x=-10;
pos.y=0;
pos.z=0;
while(io()){
float r;
r=rand()%7;
// cout<<bpmInput<<endl;
// cout<<tmr2.freq()<<endl;
float s = 0;
float tone = 0;
float bass = 0;
if (tmr()){
src3.reset();
envLPF.reset();
}
if(tmr3()){
env.reset();
env2.reset();
//src3.reset();
tmr3.freq(rnd::uni(beat,beat*2));
src2.reset();
}
if(tmr2()){
// src.reset();
tmr2.freq(rnd::uni(beat,beat*3));
src3.reset();
src2.reset();
}
if (tmr4()){
// src.reset();
pos.x+=1;
tmr4.freq(rnd::uni(beat,beat*2));
src3.reset();
envLPF.reset();
}
if (tmr5()){
// src.reset();
pos.x+=1;
tmr5.freq(rnd::uni(beat/2,beat*2));
src4.reset();
envLPF.reset();
}
if (tmr6()){
// src.reset();
pos.x+=1;
src5.reset();
envLPF.reset();
}
if (tmr7()){
// src.reset();
pos.x+=1;
src6.reset();
envLPF.reset();
}
if (tmrRand())
{
envswell.reset();
envpan.set(434200,-3);
// beat*=(float)r;
}
if(sweep()){
envwhite.reset();
}
float wet1, wet2;
s=src()*env()*.3;
hpfreq*=envLPF();
tone = src2()*.2;
bass = src3()*.3;
s+=src4()*.2+src5()*.2+src6()*.2;
tone+=bass;
s+=tone;
reverb(s,wet1, wet2);
//double xplane = pos.x/10;
//define my sound variables with pan
float batleft=swnoise()*envwhite()*envswell()*.15*envpan();
float batright= swnoise()*envwhite()*(envswell())*.15*(1-envpan());
float preout=LPF(s);
float out = preout+LPF(wet1*.2);
//.........这里部分代码省略.........