Tree-Axis ``` Processing  


Back  
Class   SquareWave
   
Name  

volume

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;
SquareWave 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 square wave
  myWave=new SquareWave(480,.1);
  myWave.generate(myChannel,0,myChannel.frames(3000));

  // generate 2 seconds of a loud square wave
  myWave.volume=1;
  myWave.generate(myChannel,myChannel.frames(3000),myChannel.frames(2000));

  // play
  myChannel.play();
}

void draw() {
}

// we are done, clean up Ess

public void stop() {
  Ess.stop();
  super.stop();
}


Description   The volume of the square wave (between 0 and 1)
   
Syntax  
square.volume
   
Parameters  
square   any instance of SquareWave

   
Usage   Web & Application
   
 
 






   
 
Updated: Tue May 31 04:52:42 PDT 2006


 
  Questions, comments, corrections: e-mail Krister Olsson.