本文整理汇总了C++中Accum类的典型用法代码示例。如果您正苦于以下问题:C++ Accum类的具体用法?C++ Accum怎么用?C++ Accum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Accum类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: deleteEqAccum
void ObjectManager::deleteEqAccum( const void* key )
{
AccumHash::iterator i = _impl->accums.find( key );
if( i == _impl->accums.end( ))
return;
Accum* accum = i->second;
_impl->accums.erase( i );
accum->exit();
delete accum;
}
示例2: 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);
}
示例3:
MyApp(){
feedType=0;
tmr.phaseMax();
tmr.period(4);
mod.period(4);
src.freq(100);
comb.maxDelay(1./100);
}
示例4: 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;
}
示例5:
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);
}
示例6: 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;
}
}
示例7:
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);
}
示例8: 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;
}
示例9: 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;
}
}
示例10: 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;
}
}
示例11: 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;
}
}
示例12:
MyApp(){
tmr.period(2);
mod.period(2);
osc.freq(220);
waveform=0;
}
示例13: 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);
//.........这里部分代码省略.........