void audioCB(AudioIOData& io){ while(io()){ if(tmr()){ switch(feedType){ case 0: printf("Low-pass feedforward\n"); comb.feeds( 1,0); break; case 1: printf("High-pass feedforward\n"); comb.feeds(-1,0); break; case 2: printf("Low-pass feedback\n"); comb.feeds(0,0.7); break; case 3: printf("High-pass feedback\n"); comb.feeds(0,-0.7); break; case 4: printf("Low-pass dual-feed\n"); comb.feeds(0.7,0.7); break; case 5: printf("High-pass dual-feed\n"); comb.feeds(-0.7,-0.7); break; case 6: printf("All-pass 1\n"); comb.feeds(0.9,-0.9); break; case 7: printf("All-pass 2\n"); comb.feeds(-0.9,0.9); break; } (++feedType) %= 8; } float s = src()*0.4; comb.ipolType(ipl::ROUND); comb.delay(mod.triU() * 1./400 + 1./10000); s = comb(s); io.out(0) = io.out(1) = s; } }
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; } }