summaryrefslogtreecommitdiff
path: root/muse2/synti/simpledrums2
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2012-05-28 14:15:52 +0000
committerFlorian Jung <flo@windfisch.org>2012-05-28 14:15:52 +0000
commitd2a88cfaad5ac385fc3c6212c09ad7fbc38e9454 (patch)
tree387da0b38255003e1a971629ea0de32273ac3d3c /muse2/synti/simpledrums2
parent716f5a5b56a3b7ff59004ef0a1af5f98cb2a691c (diff)
merged with release_2_0
Diffstat (limited to 'muse2/synti/simpledrums2')
-rw-r--r--muse2/synti/simpledrums2/CMakeLists.txt10
-rw-r--r--muse2/synti/simpledrums2/simpledrums.cpp2
-rw-r--r--muse2/synti/simpledrums2/ssplugin.cpp29
3 files changed, 33 insertions, 8 deletions
diff --git a/muse2/synti/simpledrums2/CMakeLists.txt b/muse2/synti/simpledrums2/CMakeLists.txt
index 172ce616..744023ea 100644
--- a/muse2/synti/simpledrums2/CMakeLists.txt
+++ b/muse2/synti/simpledrums2/CMakeLists.txt
@@ -75,13 +75,15 @@ set (FILES_TO_TRANSLATE
# - use precompiled header files
#
-if ( x${CMAKE_BUILD_TYPE} STREQUAL xrelease )
- SET(SIMPLEDRUMS_OPTFLAGS "-O6")
-endif ( x${CMAKE_BUILD_TYPE} STREQUAL xrelease )
+# Don't override the default optimization. Can be reconsidered
+# according to Mathias' feedback. - Orcan 2012-05-20
+#if ( x${CMAKE_BUILD_TYPE} STREQUAL xrelease )
+# SET(SIMPLEDRUMS_OPTFLAGS "-O6")
+#endif ( x${CMAKE_BUILD_TYPE} STREQUAL xrelease )
set_target_properties ( simpledrums
PROPERTIES PREFIX ""
- COMPILE_FLAGS "${SIMPLEDRUMS_OPTFLAGS} -fvisibility=hidden -include ${PROJECT_BINARY_DIR}/all-pic.h"
+ COMPILE_FLAGS "-fvisibility=hidden -include ${PROJECT_BINARY_DIR}/all-pic.h"
)
##
diff --git a/muse2/synti/simpledrums2/simpledrums.cpp b/muse2/synti/simpledrums2/simpledrums.cpp
index 945abbb0..12e4fd18 100644
--- a/muse2/synti/simpledrums2/simpledrums.cpp
+++ b/muse2/synti/simpledrums2/simpledrums.cpp
@@ -1768,8 +1768,8 @@ bool SimpleSynth::initSendEffect(int id, QString lib, QString name)
QString errorString = "Error loading plugin \"" + plugin->label() + "\"";
guiSendError(errorString.toLatin1().constData());
}
- return success;
SS_TRACE_OUT
+ return success;
}
diff --git a/muse2/synti/simpledrums2/ssplugin.cpp b/muse2/synti/simpledrums2/ssplugin.cpp
index cebf97c7..881594d7 100644
--- a/muse2/synti/simpledrums2/ssplugin.cpp
+++ b/muse2/synti/simpledrums2/ssplugin.cpp
@@ -324,9 +324,11 @@ float LadspaPlugin::defaultValue(int k) const
double val = 1.0;
if (LADSPA_IS_HINT_DEFAULT_MINIMUM(rh))
val = range.LowerBound;
+ else if (LADSPA_IS_HINT_DEFAULT_MAXIMUM(rh))
+ val = range.UpperBound;
else if (LADSPA_IS_HINT_DEFAULT_LOW(rh))
if (LADSPA_IS_HINT_LOGARITHMIC(range.HintDescriptor))
- val = exp(fast_log10(range.LowerBound) * .75 +
+ val = exp(log(range.LowerBound) * .75 +
log(range.UpperBound) * .25);
else
val = range.LowerBound*.75 + range.UpperBound*.25;
@@ -342,8 +344,6 @@ float LadspaPlugin::defaultValue(int k) const
log(range.UpperBound) * .75);
else
val = range.LowerBound*.25 + range.UpperBound*.75;
- else if (LADSPA_IS_HINT_DEFAULT_MAXIMUM(rh))
- val = range.UpperBound;
else if (LADSPA_IS_HINT_DEFAULT_0(rh))
val = 0.0;
else if (LADSPA_IS_HINT_DEFAULT_1(rh))
@@ -352,6 +352,29 @@ float LadspaPlugin::defaultValue(int k) const
val = 100.0;
else if (LADSPA_IS_HINT_DEFAULT_440(rh))
val = 440.0;
+ // No default found. Make one up...
+ else if (LADSPA_IS_HINT_BOUNDED_BELOW(rh) && LADSPA_IS_HINT_BOUNDED_ABOVE(rh))
+ {
+ if (LADSPA_IS_HINT_LOGARITHMIC(rh))
+ val = exp(log(range.LowerBound) * .5 +
+ log(range.UpperBound) * .5);
+ else
+ val = range.LowerBound*.5 + range.UpperBound*.5;
+ }
+ else if (LADSPA_IS_HINT_BOUNDED_BELOW(rh))
+ val = range.LowerBound;
+ else if (LADSPA_IS_HINT_BOUNDED_ABOVE(rh))
+ {
+ // Hm. What to do here... Just try 0.0 or the upper bound if less than zero.
+ //if(range.UpperBound > 0.0)
+ // val = 0.0;
+ //else
+ // val = range.UpperBound;
+ // Instead try this: Adopt an 'attenuator-like' policy, where upper is the default.
+ val = range.UpperBound;
+ return true;
+ }
+
SS_TRACE_OUT
return val;
}