diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 0323ee1..84c0afc 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -116,6 +116,8 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id) String infotext = String(processor.getPreBufferingPercent(), 1) + "% buffered " + String(processor.getStretchSource()->m_param_change_count)+" param changes "+m_last_err+" FFT size "+ String(processor.getStretchSource()->getFFTSize()); + if (processor.m_abnormal_output_samples > 0) + infotext += " " + String(processor.m_abnormal_output_samples) + " invalid sample values"; m_info_label.setText(infotext, dontSendNotification); } if (id == 2) diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 7b2b977..caa7dfe 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -416,6 +416,15 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M AudioSourceChannelInfo aif(buffer); m_buffering_source->getNextAudioBlock(aif); + for (int i = 0; i < buffer.getNumChannels(); ++i) + { + for (int j = 0; j < buffer.getNumSamples(); ++j) + { + float sample = buffer.getSample(i,j); + if (std::isnan(sample) || std::isinf(sample)) + ++m_abnormal_output_samples; + } + } } //============================================================================== diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index b5bbedb..91144ac 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -110,6 +110,7 @@ public: double getPreBufferingPercent(); void timerCallback(int id) override; double getSampleRateChecked(); + int m_abnormal_output_samples = 0; private: