damskaggep / WaveNetVA

WaveNet for virtual analog modeling, implemented as a real-time audio plugin using JUCE.
Apache License 2.0
244 stars 25 forks source link

Compilation fails for Convolution.cpp #1

Closed objectiveinteraction closed 4 years ago

objectiveinteraction commented 5 years ago

I'm using linux, and have generated the projucer linux buildfile. But, this appears during compilation. I'm using eigen3.3.7-1 from the repository.

../../Source/Convolution.cpp: In member function ‘void Convolution::processSingleSample(float*, int, int)’: ../../Source/Convolution.cpp:82:66: error: conversion from ‘__normal_iterator<[...],vector<[...],Eigen::alig ned_allocator<Eigen::Matrix<float, 1, -1> >>>’ to non-scalar type ‘__normal_iterator<[...],vector<[...],std: :allocator<Eigen::Matrix<float, 1, -1> >>>’ requested std::vector<Eigen::RowVectorXf>::iterator fifo = memory.begin();

From what i can tell, the code is trying to get a row vector from the matrix, but cannot get a row vector matrix from a matrix

GuitarML commented 4 years ago

I'm getting the same error, tried compiling using "make" and code::blocks on Ubuntu with the same result.

GuitarML commented 4 years ago

I got it to build by making the following edits starting at line 82 of Convolution.cpp (changed line 82 and 88):

// std::vector<Eigen::RowVectorXf>::iterator fifo = memory.begin();
auto fifo = memory.begin(); //My Edit
for (int ch = 0; ch < inputChannels; ++ch)
    (*(fifo+pos))[ch] = data[idx(ch, i, numSamples)];
outVec.setZero();
std::vector<Eigen::MatrixXf>::iterator it;
int j = 0;
// for (it = kernel.begin(); it != kernel.end(); it++)
for (auto it = kernel.begin(); it != kernel.end(); it++) // My Edit

Basically just changed the type declarations to "auto", see this stackoverflow for details: https://stackoverflow.com/questions/50710023/how-can-i-fix-this-error-conversion-from-const-iterator-to-non-scalar-type

ljuvela commented 4 years ago

Sounds useful! Please make a pull request once you're happy with your code version.

ljuvela commented 4 years ago

Merged @keyth72‘s PR after struggling with MacOS Catalina & JUCE 5. Tested to work on Mac now as well.