net.beadsproject.beads.ugens
Class TapOut

java.lang.Object
  extended by net.beadsproject.beads.core.Bead
      extended by net.beadsproject.beads.core.UGen
          extended by net.beadsproject.beads.ugens.TapOut

public class TapOut
extends UGen

TapOut accesses a TapIn object to implement delays. It has three modes: NO_INTERP (no interpolation), LINEAR (linear interpolation), and ALLPASS (all-pass interpolation). Delay time is specified in milliseconds and can be set by either a static float value or a UGen.

Version:
0.9
Author:
ben, Benito Crawford

Nested Class Summary
static class TapOut.InterpolationType
           
 
Nested classes/interfaces inherited from class net.beadsproject.beads.core.UGen
UGen.OutputInitializationRegime, UGen.OutputPauseRegime
 
Field Summary
static TapOut.InterpolationType ALLPASS
          The delayed signal will be derived using all-pass interpolation
static TapOut.InterpolationType LINEAR
          The delayed signal will be derived using linear interpolation.
static TapOut.InterpolationType NO_INTERP
          The delayed signal will not be interpolated from the memory buffer.
 
Fields inherited from class net.beadsproject.beads.core.UGen
bufferSize, bufIn, bufOut, context, ins, outputInitializationRegime, outputPauseRegime, outs
 
Constructor Summary
protected TapOut(AudioContext ac, TapIn ti)
           
  TapOut(AudioContext ac, TapIn ti, float delay)
          Constructor for a given TapIn object with a static float delay.
  TapOut(AudioContext ac, TapIn ti, TapOut.InterpolationType mode, float delay)
          Constructor for a given TapIn object with a static float delay, using the specified delay mode.
  TapOut(AudioContext ac, TapIn ti, TapOut.InterpolationType mode, UGen delayUGen)
          Constructor for a given TapIn object with a delay time specified by a UGen, using the specified delay mode.
  TapOut(AudioContext ac, TapIn ti, UGen delayUGen)
          Constructor for a given TapIn object with a delay time specified by a UGen.
 
Method Summary
 void calculateBuffer()
          Called by the signal chain to update this UGen's ouput data.
 float getDelay()
          Gets the current delay time.
 UGen getDelayUGen()
          Gets the delay UGen, if there is one.
 TapOut.InterpolationType getMode()
          Gets the delay mode.
 TapOut setDelay(float delay)
          Sets the delay time to a static value.
 TapOut setDelay(UGen delayUGen)
          Sets a UGen to specify the delay time in milliseconds.
 TapOut setMode(TapOut.InterpolationType mode)
          Sets the delay mode.
 
Methods inherited from class net.beadsproject.beads.core.UGen
addDependent, addInput, addInput, clearDependents, clearInputConnections, containsInput, crossfadeInput, getConnectedInputs, getContext, getEnvelopes, getIns, getNumberOfConnectedUGens, getNumberOfDependents, getOutBuffer, getOuts, getTimeTakenLastUpdate, getValue, getValue, getValueDouble, getValueDouble, initializeOuts, isTimerMode, isUpdated, noInputs, pause, printInBuffers, printInputList, printOutBuffers, removeAllConnections, removeConnection, removeDependent, setOutsToPause, setTimerMode, setValue, update, zeroIns, zeroOuts
 
Methods inherited from class net.beadsproject.beads.core.Bead
getKillListener, getName, isDeleted, isPaused, kill, message, messageReceived, setKillListener, setName, start, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_INTERP

public static final TapOut.InterpolationType NO_INTERP
The delayed signal will not be interpolated from the memory buffer.


LINEAR

public static final TapOut.InterpolationType LINEAR
The delayed signal will be derived using linear interpolation.


ALLPASS

public static final TapOut.InterpolationType ALLPASS
The delayed signal will be derived using all-pass interpolation

Constructor Detail

TapOut

protected TapOut(AudioContext ac,
                 TapIn ti)

TapOut

public TapOut(AudioContext ac,
              TapIn ti,
              float delay)
Constructor for a given TapIn object with a static float delay. The mode is set to the default (no interpolation).

Parameters:
ac - The audio context.
ti - The TapIn from which to draw the delayed signal.
delay - The delay time in milliseconds.

TapOut

public TapOut(AudioContext ac,
              TapIn ti,
              UGen delayUGen)
Constructor for a given TapIn object with a delay time specified by a UGen. The mode is set to the default (no interpolation).

Parameters:
ac - The audio context.
ti - The TapIn from which to draw the delayed signal.
delayUGen - The UGen specifying the delay time in milliseconds.

TapOut

public TapOut(AudioContext ac,
              TapIn ti,
              TapOut.InterpolationType mode,
              float delay)
Constructor for a given TapIn object with a static float delay, using the specified delay mode.

Parameters:
ac - The audio context.
ti - The TapIn from which to draw the delayed signal.
mode - The delay mode; see setMode(InterpolationType).
delay - The delay time in milliseconds.

TapOut

public TapOut(AudioContext ac,
              TapIn ti,
              TapOut.InterpolationType mode,
              UGen delayUGen)
Constructor for a given TapIn object with a delay time specified by a UGen, using the specified delay mode.

Parameters:
ac - The audio context.
ti - The TapIn from which to draw the delayed signal.
mode - The delay mode; see setMode(InterpolationType).
delayUGen - The UGen specifying the delay time in milliseconds.
Method Detail

calculateBuffer

public void calculateBuffer()
Description copied from class: UGen
Called by the signal chain to update this UGen's ouput data. Subclassses of UGen should implement the UGen's DSP perform routine here. In general this involves grabbing data from UGen.bufIn and putting data into UGen.bufOut in some way. UGen.bufIn and UGen.bufOut are 2D arrays of floats of the form float[numChannels][bufferSize]. The length of the buffers is given by UGen.bufferSize, and the number of channels of the input and output buffers are given by UGen.ins and UGen.outs respectively.

Specified by:
calculateBuffer in class UGen

getDelay

public float getDelay()
Gets the current delay time.

Returns:
The delay time in milliseconds.

setDelay

public TapOut setDelay(float delay)
Sets the delay time to a static value.

Parameters:
delay - The delay time in milliseconds.
Returns:
This object instance.

setDelay

public TapOut setDelay(UGen delayUGen)
Sets a UGen to specify the delay time in milliseconds.

Parameters:
delayUGen - The delay UGen.
Returns:
This object instance.

getDelayUGen

public UGen getDelayUGen()
Gets the delay UGen, if there is one. Returns null if delay time is set to a static float.

Returns:
This object instance.

setMode

public TapOut setMode(TapOut.InterpolationType mode)
Sets the delay mode. Use the following values:

Parameters:
mode - The delay mode.
Returns:
This object instance.

getMode

public TapOut.InterpolationType getMode()
Gets the delay mode.

Returns:
The delay mode.