Logo Search packages:      
Sourcecode: vamp-plugin-sdk version File versions  Download package

bool AmplitudeFollower::initialise ( size_t  inputChannels,
size_t  stepSize,
size_t  blockSize 
) [virtual]

Initialise a plugin to prepare it for use with the given number of input channels, step size (window increment, in sample frames) and block size (window size, in sample frames).

The input sample rate should have been already specified at construction time.

Return true for successful initialisation, false if the number of input channels, step size and/or block size cannot be supported.

Implements Vamp::Plugin.

Definition at line 105 of file AmplitudeFollower.cpp.

References Vamp::Plugin::getMaxChannelCount(), and Vamp::Plugin::getMinChannelCount().

    if (channels < getMinChannelCount() ||
      channels > getMaxChannelCount()) return false;

    m_stepSize = std::min(stepSize, blockSize);
    // Translate the coefficients 
    // from their "convenient" 60dB convergence-time values
    // to real coefficients
    m_clampcoef = m_clampcoef==0.0 ? 0.0 : exp(log(0.1)/(m_clampcoef * m_inputSampleRate));
    m_relaxcoef = m_relaxcoef==0.0 ? 0.0 : exp(log(0.1)/(m_relaxcoef * m_inputSampleRate));

    return true;

Generated by  Doxygen 1.6.0   Back to index