Tree-Axis ``` Processing  


Back  
Class   TriangleWave
   
Name  

phase

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel1;
AudioChannel myChannel2;

TriangleWave myWave;

void setup() {
  size(256,200);

  // start up Ess
  Ess.start(this);

  // create new AudioChannels
  myChannel1=new AudioChannel();
  myChannel2=new AudioChannel();

  // set channel sizes to 3 seconds
  myChannel1.initChannel(myChannel1.frames(3000));
  myChannel2.initChannel(myChannel2.frames(3000));

  // generate two triangle waves out of phase
  myWave=new TriangleWave(480,1);
  myWave.generate(myChannel1);
  
  myWave.phase=myChannel1.sampleRate/33;
  myWave.generate(myChannel2);

  // play
  myChannel1.play();
  myChannel2.play();
}

void draw() {
}

// we are done, clean up Ess

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


Description   The phase of the triangle wave (between 0 and the sample rate of the target AudioChannel, AudioStream, or floating point array)
   
Syntax  
triangle.phase
   
Parameters  
triangle   any instance of TriangleWave

   
Usage   Web & Application
   
 
 






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


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