raden wrote on May 30th, 2006, 3:42pm:I ther
i need to make samething like this:
a worg for ex: HELLO, to appear and whem i click in a letter of the word a midi sound need to play and i dont have no ideia how i make this! please sameone can help me this is for a work for the fac, if i dont make this i will not make this class
tks
In response to the question about creating sounds.
First off you need to download a sound library. For your situation Ess would be a good choice.
http://www.tree-axis.com/Ess/_distros/Ess_r1.zip
The Ess.jar file goes in a folder named "code" you sketch's folder (ideally should go in the libraries folder of your Processing executable folder though - but I'm trying not to confuse you here).
What follows is the bare minimum code to tap a key on your computer to get some noise out. The
wave() command sounds like what you're looking for.
I would detail things a bit more for you but it's best you sit and play with it for an hour or so, then you know what you're doing and can feel more confident.
Quote:
Channel myChannel;
void setup(){
// start up Ess
Ess.start(this);
// create a new Channel
myChannel=new Channel();
// set the buffer size to 5 seconds
myChannel.initBuffer(myChannel.frames(5000));
// generate 3 seconds of a soft triangle wave
myChannel.wave(Ess.TRIANGLE,480,.1,0,myChannel.frames(3000));
}
void draw(){
}
void keyPressed(){
myChannel.play();
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
If you want to learn more about sound generation on computer you could try experimenting with
Pure Data. The examples in the documentation were very informative to someone who knows little about sound like I do.