Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
// additional range-checkings) should be compiled

#ifdef LMMS_DEBUG
#define LADSPA_DEBUG TRUE
#include <assert.h>
#else
#define LADSPA_DEBUG FALSE
#define assert(x) ((void)(x))
#endif
#include <cstdio>
Expand Down
11 changes: 11 additions & 0 deletions plugins/LadspaEffect/LadspaEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
*/


#include <QDebug>
#include <QMessageBox>

#include "debug.h"
#include "LadspaEffect.h"
#include "DataFile.h"
#include "AudioDevice.h"
Expand Down Expand Up @@ -241,6 +243,15 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf,
for( fpp_t frame = 0;
frame < frames; ++frame )
{
if ( LADSPA_DEBUG &&
( isnan( pp->buffer[frame] ) ||
isinf( pp->buffer[frame] ) ) )
{
qDebug() << "name: " << m_descriptor->Label;
assert( ! isnan( pp->buffer[frame] ) );
assert( ! isinf( pp->buffer[frame] ) );
}

_buf[frame][channel] = d * _buf[frame][channel] + w * pp->buffer[frame];
out_sum += _buf[frame][channel] * _buf[frame][channel];
}
Expand Down
3 changes: 2 additions & 1 deletion plugins/LadspaEffect/swh/dyson_compress_1403.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define __USE_ISOC9X 1

#include <math.h>
#include <float.h>

#include "ladspa.h"

Expand Down Expand Up @@ -836,7 +837,7 @@ static void __attribute__((constructor)) swh_init() {
D_("Release time (s)");
port_range_hints[DYSONCOMPRESS_RELEASE_TIME].HintDescriptor =
LADSPA_HINT_BOUNDED_BELOW | LADSPA_HINT_BOUNDED_ABOVE | LADSPA_HINT_DEFAULT_LOW;
port_range_hints[DYSONCOMPRESS_RELEASE_TIME].LowerBound = 0;
port_range_hints[DYSONCOMPRESS_RELEASE_TIME].LowerBound = FLT_MIN;
port_range_hints[DYSONCOMPRESS_RELEASE_TIME].UpperBound = 1;

/* Parameters for Fast compression ratio */
Expand Down
8 changes: 4 additions & 4 deletions plugins/LadspaEffect/swh/shaper_1187.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ static void runShaper(LADSPA_Handle instance, unsigned long sample_count) {

if (shapep < 1.0f && shapep > -1.0f) {
shape = 1.0f;
} else if (shape < 0) {
shape = -1.0f / shape;
} else if (shapep < 0) {
shape = -1.0f / shapep;
} else {
shape = shapep;
}
Expand Down Expand Up @@ -160,8 +160,8 @@ static void runAddingShaper(LADSPA_Handle instance, unsigned long sample_count)

if (shapep < 1.0f && shapep > -1.0f) {
shape = 1.0f;
} else if (shape < 0) {
shape = -1.0f / shape;
} else if (shapep < 0) {
shape = -1.0f / shapep;
} else {
shape = shapep;
}
Expand Down