 |
 |
 |
 |
| Name |
|
SineWave
|
 |
|
|
| Examples |
|
// Example by Krister Olsson
import krister.Ess.*;
AudioChannel myChannel;
SineWave myWave;
void setup() {
size(256,200);
// start up Ess
Ess.start(this);
// create a new AudioChannel
myChannel=new AudioChannel();
// set the channel size to 5 seconds
myChannel.initChannel(myChannel.frames(5000));
// generate 3 seconds of a soft sine wave
myWave=new SineWave(480,.1);
myWave.generate(myChannel,0,myChannel.frames(3000));
// play
myChannel.play();
}
void draw() {
}
// we are done, clean up Ess
public void stop() {
Ess.stop();
super.stop();
}
|
|
|
| Description |
|
The SineWave class is used to generate a sine wave |
 |
|
|
 |
|
|
| Constructors |
|
SineWave(frequency, volume)
SineWave(frequency, volume, phase) |
 |
|
|
| Parameters |
|
| frequency |
|
float: the frequency of the sine wave in Hz
|
| volume |
|
float: the volume of the sine wave (between 0 and 1)
|
| phase |
|
float: the phase of the sine wave (between 0 and the sample rate of the target AudioChannel, AudioStream, or floating point array)
| |
 |
|
|
| Usage |
|
Web & Application |
 |
|
|
|
|