Back
Class   Sample
   
Name  

getPan()

   
Examples  
// prints the default Pan of the Sample object. 
// Notes: Make sure to include the specified audio file in your project's 'data' folder. 
 
Sample mySample; 
 
void setup() { 
  size(100,100); 
  Sonia.start(this); 
  mySample = new Sample("mySample.aiff"); 
  mySample.repeat(); 
  
  float pan = mySample.getPan(); 
  println("The Sample's pan is:" + pan);  // prints '1.0' 
} 
 
// safely stop the Sonia engine upon shutdown. 
public void stop(){ 
  Sonia.stop(); 
  super.stop(); 
} 

Description   Returns the sample's pan. If the sample is stereo, each channel can be read seperately. Values range from -1 to 1: -1 being the left, 0 being the center, and 1 being the right.
   
Syntax  
mySample.getPan()
mySample.getPan(channel)
   
Parameters  
channel   int: 0 or Sonia.LEFT for Left channel, 1 or Sonia.RIGHT for Right channel

   
Returns   float
   
Usage   Web & Application
   
Related   setPan()