[SCM] calf/master: + Filterclavier: make non-experimental
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:39:06 UTC 2013
The following commit has been merged in the master branch:
commit aa9ce224bfdf32621c9ce8570a6d032b15bcd86c
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Sat Jan 24 11:45:55 2009 +0000
+ Filterclavier: make non-experimental
diff --git a/src/calf/modulelist.h b/src/calf/modulelist.h
index ec30f43..ef3e3be 100644
--- a/src/calf/modulelist.h
+++ b/src/calf/modulelist.h
@@ -1,8 +1,6 @@
#ifdef PER_MODULE_ITEM
PER_MODULE_ITEM(filter, false, "filter")
-#ifdef ENABLE_EXPERIMENTAL
PER_MODULE_ITEM(filterclavier, false, "filterclavier")
-#endif
PER_MODULE_ITEM(flanger, false, "flanger")
PER_MODULE_ITEM(reverb, false, "reverb")
PER_MODULE_ITEM(monosynth, true, "monosynth")
diff --git a/src/calf/modules.h b/src/calf/modules.h
index d093b77..c08c1a7 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -823,6 +823,117 @@ public:
virtual bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);
};
+/// Filterclavier --- MIDI controlled filter by Hans Baier
+class filterclavier_audio_module:
+ public audio_module<filterclavier_metadata>,
+ public filter_module_with_inertia<biquad_filter_module, filterclavier_metadata>,
+ public line_graph_iface
+{
+ const float min_gain;
+ const float max_gain;
+
+ int last_note;
+ int last_velocity;
+
+public:
+ filterclavier_audio_module()
+ :
+ min_gain(1.0),
+ max_gain(32.0),
+ last_note(-1),
+ last_velocity(-1) {}
+
+ void params_changed()
+ {
+ inertia_filter_module::inertia_cutoff.set_inertia(
+ note_to_hz(last_note + *params[par_transpose], *params[par_detune]));
+
+ float min_resonance = param_props[par_max_resonance].min;
+ inertia_filter_module::inertia_resonance.set_inertia(
+ (float(last_velocity) / 127.0)
+ // 0.001: see below
+ * (*params[par_max_resonance] - min_resonance + 0.001)
+ + min_resonance);
+
+ adjust_gain_according_to_filter_mode(last_velocity);
+
+ inertia_filter_module::calculate_filter();
+ }
+
+ void activate()
+ {
+ inertia_filter_module::activate();
+ }
+
+ void set_sample_rate(uint32_t sr)
+ {
+ inertia_filter_module::set_sample_rate(sr);
+ }
+
+
+ void deactivate()
+ {
+ inertia_filter_module::deactivate();
+ }
+
+ /// MIDI control
+ virtual void note_on(int note, int vel)
+ {
+ last_note = note;
+ last_velocity = vel;
+ inertia_filter_module::inertia_cutoff.set_inertia(
+ note_to_hz(note + *params[par_transpose], *params[par_detune]));
+
+ float min_resonance = param_props[par_max_resonance].min;
+ inertia_filter_module::inertia_resonance.set_inertia(
+ (float(vel) / 127.0)
+ // 0.001: if the difference is equal to zero (which happens
+ // when the max_resonance knom is at minimum position
+ // then the filter gain doesnt seem to snap to zero on most note offs
+ * (*params[par_max_resonance] - min_resonance + 0.001)
+ + min_resonance);
+
+ adjust_gain_according_to_filter_mode(vel);
+
+ inertia_filter_module::calculate_filter();
+ }
+
+ virtual void note_off(int note, int vel)
+ {
+ if (note == last_note) {
+ inertia_filter_module::inertia_resonance.set_inertia(param_props[par_max_resonance].min);
+ inertia_filter_module::inertia_gain.set_inertia(min_gain);
+ inertia_filter_module::calculate_filter();
+ last_velocity = 0;
+ }
+ }
+
+ bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
+ bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);
+
+private:
+ void adjust_gain_according_to_filter_mode(int velocity) {
+ int mode = dsp::fastf2i_drm(*params[par_mode]);
+
+ // for bandpasses: boost gain for velocities > 0
+ if ( (mode_6db_bp <= mode) && (mode <= mode_18db_bp) ) {
+ // gain for velocity 0: 1.0
+ // gain for velocity 127: 32.0
+ float mode_max_gain = max_gain;
+ // max_gain is right for mode_6db_bp
+ if (mode == mode_12db_bp)
+ mode_max_gain /= 6.0;
+ if (mode == mode_18db_bp)
+ mode_max_gain /= 10.5;
+
+ inertia_filter_module::inertia_gain.set_now(
+ (float(velocity) / 127.0) * (mode_max_gain - min_gain) + min_gain);
+ } else {
+ inertia_filter_module::inertia_gain.set_now(min_gain);
+ }
+ }
+};
+
extern std::string get_builtin_modules_rdf();
};
diff --git a/src/calf/modules_dev.h b/src/calf/modules_dev.h
index 1df2dcd..6ea8a1c 100644
--- a/src/calf/modules_dev.h
+++ b/src/calf/modules_dev.h
@@ -28,117 +28,6 @@ namespace calf_plugins {
#if ENABLE_EXPERIMENTAL
-/// Filterclavier --- MIDI controlled filter
-class filterclavier_audio_module:
- public audio_module<filterclavier_metadata>,
- public filter_module_with_inertia<biquad_filter_module, filterclavier_metadata>,
- public line_graph_iface
- {
- const float min_gain;
- const float max_gain;
-
- int last_note;
- int last_velocity;
-
- public:
- filterclavier_audio_module()
- :
- min_gain(1.0),
- max_gain(32.0),
- last_note(-1),
- last_velocity(-1) {}
-
- void params_changed()
- {
- inertia_filter_module::inertia_cutoff.set_inertia(
- note_to_hz(last_note + *params[par_transpose], *params[par_detune]));
-
- float min_resonance = param_props[par_max_resonance].min;
- inertia_filter_module::inertia_resonance.set_inertia(
- (float(last_velocity) / 127.0)
- // 0.001: see below
- * (*params[par_max_resonance] - min_resonance + 0.001)
- + min_resonance);
-
- adjust_gain_according_to_filter_mode(last_velocity);
-
- inertia_filter_module::calculate_filter();
- }
-
- void activate()
- {
- inertia_filter_module::activate();
- }
-
- void set_sample_rate(uint32_t sr)
- {
- inertia_filter_module::set_sample_rate(sr);
- }
-
-
- void deactivate()
- {
- inertia_filter_module::deactivate();
- }
-
- /// MIDI control
- virtual void note_on(int note, int vel)
- {
- last_note = note;
- last_velocity = vel;
- inertia_filter_module::inertia_cutoff.set_inertia(
- note_to_hz(note + *params[par_transpose], *params[par_detune]));
-
- float min_resonance = param_props[par_max_resonance].min;
- inertia_filter_module::inertia_resonance.set_inertia(
- (float(vel) / 127.0)
- // 0.001: if the difference is equal to zero (which happens
- // when the max_resonance knom is at minimum position
- // then the filter gain doesnt seem to snap to zero on most note offs
- * (*params[par_max_resonance] - min_resonance + 0.001)
- + min_resonance);
-
- adjust_gain_according_to_filter_mode(vel);
-
- inertia_filter_module::calculate_filter();
- }
-
- virtual void note_off(int note, int vel)
- {
- if (note == last_note) {
- inertia_filter_module::inertia_resonance.set_inertia(param_props[par_max_resonance].min);
- inertia_filter_module::inertia_gain.set_inertia(min_gain);
- inertia_filter_module::calculate_filter();
- last_velocity = 0;
- }
- }
-
- bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context);
- bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context);
-
- private:
- void adjust_gain_according_to_filter_mode(int velocity) {
- int mode = dsp::fastf2i_drm(*params[par_mode]);
-
- // for bandpasses: boost gain for velocities > 0
- if ( (mode_6db_bp <= mode) && (mode <= mode_18db_bp) ) {
- // gain for velocity 0: 1.0
- // gain for velocity 127: 32.0
- float mode_max_gain = max_gain;
- // max_gain is right for mode_6db_bp
- if (mode == mode_12db_bp)
- mode_max_gain /= 6.0;
- if (mode == mode_18db_bp)
- mode_max_gain /= 10.5;
-
- inertia_filter_module::inertia_gain.set_now(
- (float(velocity) / 127.0) * (mode_max_gain - min_gain) + min_gain);
- } else {
- inertia_filter_module::inertia_gain.set_now(min_gain);
- }
- }
- };
-
#endif
};
diff --git a/src/jackhost.cpp b/src/jackhost.cpp
index bd970ce..c9603db 100644
--- a/src/jackhost.cpp
+++ b/src/jackhost.cpp
@@ -264,9 +264,6 @@ void host_session::add_plugin(string name, string preset, string instance_name)
instance_name = get_next_instance_name(name);
jack_host_base *jh = create_jack_host(name.c_str(), instance_name, this);
if (!jh) {
-#ifdef ENABLE_EXPERIMENTAL
-#else
-#endif
string s =
#define PER_MODULE_ITEM(name, isSynth, jackname) jackname ", "
#include <calf/modulelist.h>
diff --git a/src/modules.cpp b/src/modules.cpp
index 6000a57..fa68e98 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -121,7 +121,6 @@ CALF_PLUGIN_INFO(filter) = { 0x847f, "Filter", "Calf Filter", "Krzysztof Foltman
////////////////////////////////////////////////////////////////////////////
-#if ENABLE_EXPERIMENTAL
CALF_PORT_NAMES(filterclavier) = {"In L", "In R", "Out L", "Out R"};
CALF_PORT_PROPS(filterclavier) = {
@@ -136,7 +135,7 @@ CALF_PORT_PROPS(filterclavier) = {
};
CALF_PLUGIN_INFO(filterclavier) = { 0x849f, "Filterclavier", "Calf Filterclavier", "Krzysztof Foltman / Hans Baier", calf_plugins::calf_copyright_info, "FilterclavierPlugin" };
-#endif
+
////////////////////////////////////////////////////////////////////////////
CALF_PORT_NAMES(vintage_delay) = {"In L", "In R", "Out L", "Out R"};
diff --git a/src/modules_dsp.cpp b/src/modules_dsp.cpp
index 18a95dd..8e1269a 100644
--- a/src/modules_dsp.cpp
+++ b/src/modules_dsp.cpp
@@ -239,8 +239,6 @@ bool filter_audio_module::get_gridline(int index, int subindex, float &pos, bool
///////////////////////////////////////////////////////////////////////////////////////////////
-#if ENABLE_EXPERIMENTAL
-
bool filterclavier_audio_module::get_graph(int index, int subindex, float *data, int points, cairo_iface *context)
{
if (!is_active || index != par_mode) {
@@ -258,8 +256,6 @@ bool filterclavier_audio_module::get_gridline(int index, int subindex, float &po
return get_freq_gridline(subindex, pos, vertical, legend, context);
}
-#endif
-
///////////////////////////////////////////////////////////////////////////////////////////////
rotary_speaker_audio_module::rotary_speaker_audio_module()
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list