How you stored a sample in array of floats in header? Show code (don’t need to show full sample only short part of it).
I asume that you fill static array of floats in header without function, this load it in to memory automatically. You have to create something like that:
// header.h
void loadSample_Piano(std::vector<float> & wave)
{
// fill the wave with piano sample stored in this header.h file in this function
}
I am not sure if that help, but if not, try split it in to declaration and definition (*.h and *.cpp) file.