// Example by Krister Olsson
import krister.Ess.*;
AudioChannel myChannel;
TempoShift myTempoShift;
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 tempo shifts!
myTempoShift=new TempoShift(.5);
for (int i=0;i<10;i++) {
myTempoShift.filter(myChannel,(int)random(0,myChannel.size),
myChannel.frames((int)(random(10)*100)));
// always speed up
myTempoShift.percent=(int)(1/random(2,24));
// every other shift leave shift residue behind
myTempoShift.zeroOutputBuffer=!myTempoShift.zeroOutputBuffer;
}
// play
myChannel.play();
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|