// Example by Krister Olsson
import krister.Ess.*;
AudioChannel myChannel;
RateShift myRateShift;
void setup() {
size(256,200);
// start up Ess
Ess.start(this);
// load "cell.aif" into a new AudioChannel
myChannel=new AudioChannel("cell.aif");
// 10 random rate shifts!
myRateShift=new RateShift(Ess.calcShift(3));
for (int i=0;i<10;i++) {
myRateShift.filter(myChannel,(int)random(0,myChannel.size),
myChannel.frames((int)(random(10)*100)));
// always speed up
myRateShift.percent=Ess.calcShift((int)random(0,24));
// every other shift leave shift residue behind
myRateShift.zeroOutputBuffer=!myRateShift.zeroOutputBuffer;
}
// play
myChannel.play();
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|