cava test
This commit is contained in:
@@ -32,28 +32,28 @@ void CavaProcessor::process() {
|
||||
cava_execute(m_in, count, m_out, m_plan);
|
||||
|
||||
// Apply monstercat filter
|
||||
QVector<double> values(m_bars);
|
||||
|
||||
// Left to right pass
|
||||
const double inv = 1.0 / 1.5;
|
||||
double carry = 0.0;
|
||||
for (int i = 0; i < m_bars; ++i) {
|
||||
carry = std::max(m_out[i], carry * inv);
|
||||
values[i] = carry;
|
||||
}
|
||||
|
||||
// Right to left pass and combine
|
||||
carry = 0.0;
|
||||
for (int i = m_bars - 1; i >= 0; --i) {
|
||||
carry = std::max(m_out[i], carry * inv);
|
||||
values[i] = std::max(values[i], carry);
|
||||
}
|
||||
|
||||
// Update values
|
||||
if (values != m_values) {
|
||||
m_values = std::move(values);
|
||||
emit valuesChanged(m_values);
|
||||
}
|
||||
// QVector<double> values(m_bars);
|
||||
//
|
||||
// // Left to right pass
|
||||
// const double inv = 1.0 / 1.5;
|
||||
// double carry = 0.0;
|
||||
// for (int i = 0; i < m_bars; ++i) {
|
||||
// carry = std::max(m_out[i], carry * inv);
|
||||
// values[i] = carry;
|
||||
// }
|
||||
//
|
||||
// // Right to left pass and combine
|
||||
// carry = 0.0;
|
||||
// for (int i = m_bars - 1; i >= 0; --i) {
|
||||
// carry = std::max(m_out[i], carry * inv);
|
||||
// values[i] = std::max(values[i], carry);
|
||||
// }
|
||||
//
|
||||
// // Update values
|
||||
// if (values != m_values) {
|
||||
// m_values = std::move(values);
|
||||
// emit valuesChanged(m_values);
|
||||
// }
|
||||
}
|
||||
|
||||
void CavaProcessor::setBars(int bars) {
|
||||
|
||||
Reference in New Issue
Block a user