View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

conventional multi-sample playback in sc2

(
var filenames, signals, n;
n = 6;
filenames = [":Sounds:floating_1", ":Sounds:cucu"];
signals = filenames.collect({ arg path, i;
                var sound;
                sound = SoundFile.new;
                if (sound.read(path), {
                        sound.data;
                }, {  
                        (path ++ " not found.\n").post; 
                        nil 
                });
});


Synth.play({    
        XFadeTexture.ar({
                var sig;
                sig = signals.choose;
                Mix.arFill(n, { arg i;
                        Pan2.ar(
                                PlayBuf.ar(sig.at(0), Synth.sampleRate, 1.0 + (0.013 * i), 0, 0, sig.at(0).size-2),
                                2.0/(1-n) * i + 1
                        );
                }) / n;
         }, 4,4,2)
});
)

jrh

Link to this Page