Hi, Michal Seta hat gesagt: // Michal Seta wrote:
Now, fiiwu~... I seem to have made some progress. I can instantiate it now without crashing. I can load a soundfont and it reports that the soundfont was loaded OK. However, sending it a note message makes pd hang and I have to kill it.
However, it also says (upon loading):
WARNING: Current samplerate 0 != 44100 WARNING: fiiwu~ might be out of tune!
which is strange because I always run pd @ 44100.
This is indeed strange. I added this check for the samplerate, because iiwu needs to know the samplerate as well. But the current samplerate reported should never be 0. The code responsible snippet is:
float sr=Samplerate(); if (sr != 44100.f) { post("WARNING: Current samplerate %.0f != 44100", sr); post("WARNING: fiiwu~ might be out of tune!"); }
And later iiwusynth is set to the detected samplerate:
pd_iiwu_settings.sample_rate = static_cast<int>(sr);
What happens to you is this: the detected samplerate is 0, for whatever reasons, and iiwu tries to run with this samplerate. This might disturb libiiwusynth and even if it didn't it wouldn't yield correct results.
A quickfix would be to check for a reasonable samplerate, i.e. make the second code part to:
if (sr != 0) { pd_iiwu_settings.sample_rate = static_cast<int>(sr); }
like in the attached file. I also update the CVS now to include this check.
ciao