Mercurial > hg > vamp-plugin-sdk
comparison examples/AmplitudeFollower.cpp @ 510:8742125177ae
Merge from branch vamp-kiss-naming
author | Chris Cannam |
---|---|
date | Thu, 08 Feb 2018 15:40:33 +0000 |
parents | 90571dcc371a |
children |
comparison
equal
deleted
inserted
replaced
502:d129bf797f24 | 510:8742125177ae |
---|---|
104 | 104 |
105 bool | 105 bool |
106 AmplitudeFollower::initialise(size_t channels, size_t stepSize, size_t blockSize) | 106 AmplitudeFollower::initialise(size_t channels, size_t stepSize, size_t blockSize) |
107 { | 107 { |
108 if (channels < getMinChannelCount() || | 108 if (channels < getMinChannelCount() || |
109 channels > getMaxChannelCount()) return false; | 109 channels > getMaxChannelCount()) { |
110 cerr << "ERROR: AmplitudeFollower::initialise: " | |
111 << "channel count " << channels << " out of supported range" | |
112 << endl; | |
113 return false; | |
114 } | |
110 | 115 |
111 m_stepSize = std::min(stepSize, blockSize); | 116 m_stepSize = std::min(stepSize, blockSize); |
112 | 117 |
113 // Translate the coefficients | 118 // Translate the coefficients |
114 // from their "convenient" 60dB convergence-time values | 119 // from their "convenient" 60dB convergence-time values |
115 // to real coefficients | 120 // to real coefficients |
116 m_clampcoef = m_clampcoef==0.0 ? 0.0 : exp(log(0.1)/(m_clampcoef * m_inputSampleRate)); | 121 m_clampcoef = m_clampcoef==0.0 ? 0.0 : exp(log(0.1)/(m_clampcoef * m_inputSampleRate)); |
117 m_relaxcoef = m_relaxcoef==0.0 ? 0.0 : exp(log(0.1)/(m_relaxcoef * m_inputSampleRate)); | 122 m_relaxcoef = m_relaxcoef==0.0 ? 0.0 : exp(log(0.1)/(m_relaxcoef * m_inputSampleRate)); |