SCで炎の音を作る。ってかcodetterがSuperColliderに対応しないかなぁ。

http://en.wikibooks.org/wiki/Designing_Sound_in_SuperCollider/Fire より。

http://en.wikibooks.org/wiki/Designing_Sound_in_SuperCollider/Fire より。

  • タグ:
  • タグはありません
(
~firegen = {
        var trigs, durscale, resfreq;
        var noise, hissing, crackles, lapping;
        // A common noise source
        noise = WhiteNoise.ar;
        // Hissing
        hissing = HPF.ar(noise, 1000) * LFNoise2.kr(1).squared.squared;
        // Crackle
        trigs = Dust.kr(1);
        durscale = TRand.kr(1, 1.5, trigs); // vary duration between default 20ms and 30ms
        resfreq = TExpRand.kr(100, 1000, trigs); // different resonant frequency for each one
        crackles = noise * EnvGen.ar(Env.perc(0, 0.02, curve: 0), trigs, timeScale: durscale);
        crackles = crackles + BPF.ar(crackles, resfreq, 20);
        // Flame
        lapping = LeakDC.ar(LeakDC.ar(BPF.ar(noise, 30, 0.2) * 50).clip2(0.9)) * 0.5;
        // Combine them:
        ([crackles, hissing, lapping] * [0.1, 0.3, 0.6]).sum * 3
};
~firegen.play
)