Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial

# stk::TapDelay Class Reference

STK non-interpolating tapped delay line class. More...

`#include <TapDelay.h>`

Inheritance diagram for stk::TapDelay:

List of all members.

## Public Member Functions
| TapDelay (std::vector< unsigned long > taps=std::vector< unsigned long >(1, 0), unsigned long maxDelay=4095)
| The default constructor creates a delay-line with maximum length of 4095 samples and a single tap at delay = 0.
| ~TapDelay ()
| Class destructor.
void | setMaximumDelay (unsigned long delay)
| Set the maximum delay-line length.
void | setTapDelays (std::vector< unsigned long > taps)
| Set the delay-line tap lengths.
std::vector< unsigned long > | getTapDelays (void) const
| Return the current delay-line length.
StkFloat | lastOut (unsigned int tap=0) const
| Return the specified tap value of the last computed frame.
StkFrames & | tick (StkFloat input, StkFrames &outputs)
| Input one sample to the delayline and return outputs at all tap positions.
StkFrames & | tick (StkFrames &frames, unsigned int channel=0)
| Take a channel of the StkFrames object as inputs to the filter and write outputs back to the same object.
StkFrames & | tick (StkFrames &iFrames, StkFrames &oFrames, unsigned int iChannel=0)
| Take a channel of the `iFrames` object as inputs to the filter and write outputs to the `oFrames` object.

## Detailed Description

STK non-interpolating tapped delay line class.

This class implements a non-interpolating digital delay-line with an arbitrary number of output "taps". If the maximum length and tap delays are not specified during instantiation, a fixed maximum length of 4095 and a single tap delay of zero is set.

A non-interpolating delay line is typically used in fixed delay-length applications, such as for reverberation.

by Perry R. Cook and Gary P. Scavone, 1995 - 2010.

## Constructor & Destructor Documentation

stk::TapDelay::TapDelay | ( | std::vector< unsigned long > | taps = `std::vector< unsigned long >(1, 0)`,
|  | unsigned long | maxDelay = `4095` |
| ) |  |  |

The default constructor creates a delay-line with maximum length of 4095 samples and a single tap at delay = 0.

An StkError will be thrown if any tap delay parameter is less than zero, the maximum delay parameter is less than one, or any tap delay parameter is greater than the maxDelay value.

## Member Function Documentation

void stk::TapDelay::setMaximumDelay | ( | unsigned long | delay | ) |

Set the maximum delay-line length.

This method should generally only be used during initial setup of the delay line. If it is used between calls to the tick() function, without a call to clear(), a signal discontinuity will likely occur. If the current maximum length is greater than the new length, no change will be made.

void stk::TapDelay::setTapDelays | ( | std::vector< unsigned long > | taps | ) |

Set the delay-line tap lengths.

The valid range for each tap length is from 0 to the maximum delay-line length.

StkFloat stk::TapDelay::lastOut | ( | unsigned int | tap = `0` | ) | const`[inline]`

Return the specified tap value of the last computed frame.

Use the lastFrame() function to get all tap values from the last computed frame. The `tap` argument must be less than the number of delayline taps (the first tap is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an StkError exception.

StkFrames & stk::TapDelay::tick | ( | StkFloat | input,
|  | StkFrames & | outputs |
| ) |  |  | `[inline]`

Input one sample to the delayline and return outputs at all tap positions.

The StkFrames argument reference is returned. The output values are ordered according to the tap positions set using the setTapDelays() function (no sorting is performed). The StkFrames argument must contain at least as many channels as the number of taps. However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an StkError exception.

StkFrames & stk::TapDelay::tick | ( | StkFrames & | frames,
|  | unsigned int | channel = `0` |
| ) |  |  | `[inline, virtual]`

Take a channel of the StkFrames object as inputs to the filter and write outputs back to the same object.

The StkFrames argument reference is returned. The output values are ordered according to the tap positions set using the setTapDelays() function (no sorting is performed). The StkFrames argument must contain at least as many channels as the number of taps. However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an StkError exception.

Implements stk::Filter.

StkFrames & stk::TapDelay::tick | ( | StkFrames & | iFrames,
|  | StkFrames & | oFrames,
|  | unsigned int | iChannel = `0` |
| ) |  |  | `[inline]`

Take a channel of the `iFrames` object as inputs to the filter and write outputs to the `oFrames` object.

The `iFrames` object reference is returned. The output values are ordered according to the tap positions set using the setTapDelays() function (no sorting is performed). The `iChannel` argument must be less than the number of channels in the `iFrames` argument (the first channel is specified by 0). The `oFrames` argument must contain at least as many channels as the number of taps. However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an StkError exception.

The documentation for this class was generated from the following file:

- TapDelay.h

The Synthesis ToolKit in C++ (STK)
©1995-2010 Perry R. Cook and Gary P. Scavone. All Rights Reserved.