summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Suhr Christensen <jsc@umbraculum.org>2014-05-18 17:47:01 +0200
committerJonas Suhr Christensen <jsc@umbraculum.org>2014-05-18 17:47:01 +0200
commit125d9174e04e950921dd001ae182b0883bdbd519 (patch)
treecae6b37dc54955f2b8c0fc06e5e94b0eb8d6bb4d
parentd39f7c5c6f4ca8d4d23a20f9e1d11d4167a70bbe (diff)
parent488070f321b1fb24bb0a7022c321c574fd4b06ac (diff)
Merge branch 'master' of http://git.drumgizmo.org/drumgizmo
-rw-r--r--plugingui/Makefile.mingw323
-rw-r--r--src/powerlist.cc17
2 files changed, 17 insertions, 3 deletions
diff --git a/plugingui/Makefile.mingw32 b/plugingui/Makefile.mingw32
index d1cd3bc..3a9542a 100644
--- a/plugingui/Makefile.mingw32
+++ b/plugingui/Makefile.mingw32
@@ -3,7 +3,7 @@ include Makefile.am.plugingui
CFLAGS=-DSTANDALONE -DWIN32 -DUSE_THREAD ${PLUGIN_GUI_CFLAGS} \
-I$(top_srcdir)/src -I/local/include
-LDFLAGS=-mconsole -lgdi32 -lsetupapi -lws2_32 -L/local/lib -lpng -lz -pthread
+LDFLAGS=-mconsole -lgdi32 -lsetupapi -lws2_32 -L/local/lib -lz -pthread
C_SOURCES = \
$(top_srcdir)/hugin/hugin.c \
@@ -39,6 +39,7 @@ CXX_SOURCES = \
$(top_srcdir)/plugingui/progressbar.cc \
$(top_srcdir)/plugingui/resource.cc \
$(top_srcdir)/plugingui/resource_data.cc \
+ $(top_srcdir)/plugingui/lodepng/lodepng.cpp \
$(top_srcdir)/src/thread.cc \
$(top_srcdir)/src/semaphore.cc \
$(top_srcdir)/src/mutex.cc \
diff --git a/src/powerlist.cc b/src/powerlist.cc
index 1888733..6fc77ad 100644
--- a/src/powerlist.cc
+++ b/src/powerlist.cc
@@ -32,6 +32,14 @@
#include <hugin.hpp>
+/**
+ * Minimum sample set size.
+ * Smaller means wider 'velocity groups'.
+ * Limited by sample set size, ie. only kicks in if sample set size is smaller
+ * than this number.
+ */
+#define MIN_SAMPLE_SET_SIZE 26
+
// Enable to calculate power on old samples without power attribute
//#define AUTO_CALCULATE_POWER
@@ -213,8 +221,13 @@ Sample *PowerList::get(level_t level)
float power_span = power_max - power_min;
- // Spread out at most 1.5 samples away from center
- float stddev = power_span / samples.size() * 1.5;
+ // Width is limited to at least 10. Fioxes problem with instrument with a
+ // sample set smaller than MIN_SAMPLE_SET_SIZE.
+ float width = fmax(samples.size(), MIN_SAMPLE_SET_SIZE);
+
+ // Spread out at most ~2 samples away from center if all samples have a
+ // uniform distribution over the power spectrum (which they probably don't).
+ float stddev = power_span / width;
// Cut off mean value with stddev/2 in both ends in order to make room for
// downwards expansion on velocity 0 and upwards expansion on velocity 1.