Tree-Axis ``` Processing  


Back  
Class   AudioChannel
   
Name  

snapOutToZero()

   
Examples  
// Example by Krister Olsson

import krister.Ess.*;

AudioChannel myChannel;

void setup() {
  // start up Ess
  Ess.start(this);

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

  // randomly move the in and out loop points
  myChannel.in((int)(random(myChannel.size/3)));
  myChannel.out(myChannel.size-1-(int)(random(myChannel.size/3)));

  // snap the in loop point to the nearest zero crossing
  myChannel.snapInToZero();

  // snap the out loop point to the nearest zero crossing
  myChannel.snapOutToZero();

  // cue to our in loop point
  myChannel.cue(myChannel.in);

  // start the sound looping forever
  myChannel.play(Ess.FOREVER);
}

void draw() {
}

// we are done, clean up Ess

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


Description   Snaps out to the nearest zero crossing (a sample of value 0). Used when creating loops to avoid clicks at the point of loop
   
Syntax  
channel.snapOutToZero()
channel.snapOutToZero(frames)
   
Parameters  
channel   any instance of AudioChannel

frames   int: the furthest distance from out over which to look for a zero crossing. The default is the entire buffer

   
Returns   nothing
   
Usage   Web & Application
   
 
 






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


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