// Example by Krister Olsson
import krister.Ess.*;
AudioChannel myChannel;
PitchShift myPitchShift;
void setup() {
size(256,200);
// start up Ess
Ess.start(this);
// load "cell.aif" into a new AudioChannel
myChannel=new AudioChannel("cell.aif");
// shift pitch up by 3 semitones
myPitchShift=new PitchShift(Ess.calcShift(3));
myPitchShift.filter(myChannel);
// shift pitch back down 5 semitones
myPitchShift.percent=Ess.calcShift(-5);
myPitchShift.filter(myChannel);
// play
myChannel.play();
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|