// 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");
// tempo shift the first 1.8 seconds
myTempoShift=new TempoShift(.33);
myTempoShift.filter(myChannel,0,myChannel.frames(1800));
// figure out where to start a second tempo shift
int nextShift=myTempoShift.getOutputSize(myChannel.frames(1800));
// second tempo shift
myTempoShift.percent=1.25;
myTempoShift.filter(myChannel,nextShift,myChannel.frames(1800));
// play
myChannel.play();
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|