Tree-Axis ``` Processing  


Back  
Class   AudioChannel
   
Name  

panTo()

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;

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

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

  // load "cell.aif" into a new AudioChannel
  myChannel=new AudioChannel("cell.aif");

  // pan left
  myChannel.pan(Ess.LEFT);
  
  // play
  myChannel.play();
  
  // pan right over the duration of the sound
  myChannel.panTo(Ess.RIGHT,myChannel.duration);
  print("Starting pan");
  
  // slow the framerate
  framerate(1);
}

void draw() {
  // are we panning?
  if (myChannel.panning) print(".");
}

void audioOutputPan(AudioOutput ch) {
  print("done!");
}

// we are done, clean up Ess

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


Description   Adjusts an AudioChannel's pan in the stereo field over a period of milliseconds. Runs in its own thread so other code may be executed simultaneously. If a sound is playing and the AudioChannel's smoothPan field is set to true, pan adjustment is deferred until the playback head is at a zero crossing, resulting in less noise
   
Syntax  
channel.panTo(pan, ms)
channel.panTo(pan, ms, type)
   
Parameters  
channel   any instance of AudioChannel

pan   float: the target pan (between -1 and 1). -1 (Ess.LEFT) is far left, 1 (Ess.RIGHT) is far right

ms   int: the number of milliseconds over which to adjust the pan

type   the type of pan: Ess.LINEAR (the default), Ess.SLOW, or Ess.FAST

   
Returns   nothing
   
Usage   Web & Application
   
 
 






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


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