Browse Source

Added detector for invalid sample values in plugin output

tags/v100_p5
xenakios 7 years ago
parent
commit
d900572506
3 changed files with 12 additions and 0 deletions
  1. +2
    -0
      Source/PluginEditor.cpp
  2. +9
    -0
      Source/PluginProcessor.cpp
  3. +1
    -0
      Source/PluginProcessor.h

+ 2
- 0
Source/PluginEditor.cpp View File

@@ -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)


+ 9
- 0
Source/PluginProcessor.cpp View File

@@ -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;
}
}
}

//==============================================================================


+ 1
- 0
Source/PluginProcessor.h View File

@@ -110,6 +110,7 @@ public:
double getPreBufferingPercent();
void timerCallback(int id) override;
double getSampleRateChecked();
int m_abnormal_output_samples = 0;
private:


Loading…
Cancel
Save