[SCM] calf/master: + Rotary Speaker: 0/90 deg shift thingy + Small modules: added LP12, HP12 and BP6 plugins (not supported in calfjackhost, not fully finished yet etc.)

js at users.alioth.debian.org js at users.alioth.debian.org
Tue May 7 15:37:34 UTC 2013


The following commit has been merged in the master branch:
commit 16860e703414646024b714a256c1d160d8ecb04c
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date:   Tue Sep 16 20:38:38 2008 +0000

    + Rotary Speaker: 0/90 deg shift thingy
    + Small modules: added LP12, HP12 and BP6 plugins (not supported in calfjackhost, not fully finished yet etc.)
    
    
    git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@285 78b06b96-2940-0410-b7fc-879d825d01d8

diff --git a/src/Makefile.am b/src/Makefile.am
index 7e03cfe..bcf602a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,7 +47,7 @@ calfbenchmark_CXXFLAGS = $(AM_CXXFLAGS) -DTEST_OSC
 calfbenchmark_LDADD += libcalfgui.la
 endif
 
-calf_la_SOURCES = modules.cpp giface.cpp monosynth.cpp organ.cpp osctl.cpp preset.cpp synth.cpp utils.cpp
+calf_la_SOURCES = modules.cpp modules_small.cpp giface.cpp monosynth.cpp organ.cpp osctl.cpp preset.cpp synth.cpp utils.cpp
 if USE_DEBUG
 calf_la_LDFLAGS = -rpath $(ladspadir) -avoid-version -module -lexpat 
 else
@@ -55,7 +55,7 @@ calf_la_LDFLAGS = -rpath $(ladspadir) -avoid-version -module -lexpat -export-sym
 endif
 
 if USE_LV2_GUI
-calflv2gui_la_SOURCES = gui.cpp ctl_curve.cpp ctl_keyboard.cpp custom_ctl.cpp modules.cpp giface.cpp monosynth.cpp organ.cpp preset.cpp synth.cpp lv2gui.cpp main_win.cpp
+calflv2gui_la_SOURCES = gui.cpp ctl_curve.cpp ctl_keyboard.cpp custom_ctl.cpp modules.cpp modules_small.cpp giface.cpp monosynth.cpp organ.cpp preset.cpp synth.cpp lv2gui.cpp main_win.cpp
 if USE_DEBUG
 calflv2gui_la_LDFLAGS = -rpath $(lv2dir) -avoid-version -module -lexpat $(GUI_DEPS_LIBS) 
 else
@@ -63,7 +63,7 @@ calflv2gui_la_LDFLAGS = -rpath $(lv2dir) -avoid-version -module -lexpat -export-
 endif
 endif
 
-libcalfstatic_la_SOURCES = modules.cpp giface.cpp monosynth.cpp organ.cpp osctl.cpp preset.cpp synth.cpp utils.cpp
+libcalfstatic_la_SOURCES = modules.cpp modules_small.cpp giface.cpp monosynth.cpp organ.cpp osctl.cpp preset.cpp synth.cpp utils.cpp
 libcalfstatic_la_LDFLAGS = -static -lexpat
 
 if USE_GUI
diff --git a/src/calf/Makefile.am b/src/calf/Makefile.am
index b150dc8..100cc8a 100644
--- a/src/calf/Makefile.am
+++ b/src/calf/Makefile.am
@@ -4,6 +4,6 @@ calf_HEADERS = audio_fx.h benchmark.h biquad.h buffer.h custom_ctl.h \
     ctl_curve.h ctl_keyboard.h \
     delay.h fft.h fixed_point.h giface.h gui.h inertia.h \
     jackhost.h lv2_event.h lv2_ui.h lv2_uri_map.h lv2-midiport.h lv2wrap.h \
-    main_win.h modules.h modules_dev.h modules_synths.h \
+    main_win.h modules.h modules_dev.h modules_small.h modules_synths.h \
     onepole.h organ.h osc.h osctl.h osctlnet.h preset.h preset_gui.h primitives.h \
     synth.h utils.h wave.h
diff --git a/src/calf/modules.h b/src/calf/modules.h
index 14a1723..097d3ea 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -27,6 +27,20 @@
 #include "audio_fx.h"
 #include "giface.h"
 
+#if USE_LADSPA
+#define LADSPA_WRAPPER(mod) static synth::ladspa_wrapper<mod##_audio_module> ladspa_##mod(mod##_info);
+#else
+#define LADSPA_WRAPPER(mod)
+#endif
+
+#if USE_LV2
+#define LV2_WRAPPER(mod) static synth::lv2_wrapper<mod##_audio_module> lv2_##mod(mod##_info);
+#else
+#define LV2_WRAPPER(mod)
+#endif
+
+#define ALL_WRAPPERS(mod) LADSPA_WRAPPER(mod) LV2_WRAPPER(mod)
+
 namespace synth {
 
 using namespace dsp;
@@ -714,7 +728,7 @@ public:
             float out_hi_r = in_mono + delay.get_interp_1616(shift + md * 65536 - md * yh) - mix2 * delay.get_interp_1616(shift + pdelta + md * xh) + mix3 * delay.get_interp_1616(shift + pdelta + pdelta + md * yh);
 
             float out_lo_l = in_mono + delay.get_interp_1616(shift + md * xl); // + delay.get_interp_1616(shift + md * 65536 + pdelta - md * yl);
-            float out_lo_r = in_mono + delay.get_interp_1616(shift + md * 65536 - md * xl); // - delay.get_interp_1616(shift + pdelta + md * yl);
+            float out_lo_r = in_mono + delay.get_interp_1616(shift + md * yl); // - delay.get_interp_1616(shift + pdelta + md * yl);
             
             out_hi_l = crossover2l.process_d2(out_hi_l); // sanitize(out_hi_l);
             out_hi_r = crossover2r.process_d2(out_hi_r); // sanitize(out_hi_r);
diff --git a/src/calf/modules_small.h b/src/calf/modules_small.h
new file mode 100644
index 0000000..2ee2594
--- /dev/null
+++ b/src/calf/modules_small.h
@@ -0,0 +1,110 @@
+/* Calf DSP Library
+ * "Small" audio modules for modular synthesis
+ *
+ * Copyright (C) 2001-2007 Krzysztof Foltman
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General
+ * Public License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+#ifndef __CALF_MODULES_SMALL_H
+#define __CALF_MODULES_SMALL_H
+
+#include <assert.h>
+#include "biquad.h"
+#include "inertia.h"
+#include "audio_fx.h"
+#include "giface.h"
+#include "modules.h"
+
+namespace synth {
+
+using namespace dsp;
+
+class small_filter_audio_module: public null_audio_module
+{
+public:    
+    enum { par_cutoff, par_resonance, param_count };
+    enum { in_count = 1, out_count = 1, rt_capable = true, support_midi = false };
+    float *ins[in_count]; 
+    float *outs[out_count];
+    float *params[param_count];
+    static const char *port_names[];
+    dsp::biquad<float> filter;
+    uint32_t srate;
+    static parameter_properties param_props[];
+    
+    /// do not export mode and inertia as CVs, as those are settings and not parameters
+    void params_changed()
+    {
+    }
+    void activate() {
+        params_changed();
+        filter.reset();
+    }
+    void deactivate() {
+    }
+    void set_sample_rate(uint32_t sr) {
+        srate = sr;
+    }
+};
+
+class small_lp_filter_audio_module: public small_filter_audio_module
+{
+public:
+    uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask) {
+        filter.set_lp_rbj(*params[par_cutoff], *params[par_resonance], srate);
+        for (uint32_t i = offset; i < offset + numsamples; i++)
+            outs[0][i] = filter.process_d1(ins[0][i]);
+        filter.sanitize_d1();
+        return !filter.empty_d1();
+    }
+    static const char *get_id() { return "lowpass12"; }
+    static const char *get_name() { return "lowpass12"; }
+    static const char *get_label() { return "12dB/oct RBJ Lowpass"; }
+};
+
+class small_hp_filter_audio_module: public small_filter_audio_module
+{
+public:
+    uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask) {
+        filter.set_lp_rbj(*params[par_cutoff], *params[par_resonance], srate);
+        for (uint32_t i = offset; i < offset + numsamples; i++)
+            outs[0][i] = filter.process_d1(ins[0][i]);
+        filter.sanitize_d1();
+        return !filter.empty_d1();
+    }
+    static const char *get_id() { return "highpass12"; }
+    static const char *get_name() { return "highpass12"; }
+    static const char *get_label() { return "12dB/oct RBJ Highpass"; }
+};
+
+class small_bp_filter_audio_module: public small_filter_audio_module
+{
+public:
+    uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask) {
+        filter.set_bp_rbj(*params[par_cutoff], *params[par_resonance], srate);
+        for (uint32_t i = offset; i < offset + numsamples; i++)
+            outs[0][i] = filter.process_d1(ins[0][i]);
+        filter.sanitize_d1();
+        return !filter.empty_d1();
+    }
+    static const char *get_id() { return "bandpass6"; }
+    static const char *get_name() { return "bandpass6"; }
+    static const char *get_label() { return "6dB/oct RBJ Bandpass"; }
+};
+
+};
+
+#endif
diff --git a/src/jackhost.cpp b/src/jackhost.cpp
index e71ab45..a08391b 100644
--- a/src/jackhost.cpp
+++ b/src/jackhost.cpp
@@ -32,6 +32,7 @@
 #include <calf/jackhost.h>
 #include <calf/modules.h>
 #include <calf/modules_dev.h>
+#include <calf/modules_small.h>
 #include <calf/gui.h>
 #include <calf/preset.h>
 #include <calf/preset_gui.h>
@@ -66,6 +67,12 @@ jack_host_base *synth::create_jack_host(const char *effect_name)
     else if (!strcasecmp(effect_name, "phaser"))
         return new jack_host<phaser_audio_module>();
 #ifdef ENABLE_EXPERIMENTAL
+    else if (!strcasecmp(effect_name, "lowpass12"))
+        return new jack_host<small_lp_filter_audio_module>();
+    else if (!strcasecmp(effect_name, "highpass12"))
+        return new jack_host<small_lp_filter_audio_module>();
+    else if (!strcasecmp(effect_name, "bandpass6"))
+        return new jack_host<small_lp_filter_audio_module>();
 #endif
     else
         return NULL;
diff --git a/src/modules.cpp b/src/modules.cpp
index ee9b517..0889712 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -28,24 +28,13 @@
 #include <calf/lv2wrap.h>
 #include <calf/modules.h>
 #include <calf/modules_dev.h>
-
-using namespace synth;
-
-#if USE_LADSPA
-#define LADSPA_WRAPPER(mod) static synth::ladspa_wrapper<mod##_audio_module> ladspa_##mod(mod##_info);
-#else
-#define LADSPA_WRAPPER(mod)
-#endif
-
-#if USE_LV2
-#define LV2_WRAPPER(mod) static synth::lv2_wrapper<mod##_audio_module> lv2_##mod(mod##_info);
-#else
-#define LV2_WRAPPER(mod)
+#ifdef ENABLE_EXPERIMENTAL
+#include <calf/modules_small.h>
 #endif
 
-#define ALL_WRAPPERS(mod) LADSPA_WRAPPER(mod) LV2_WRAPPER(mod)
+using namespace synth;
 
-const char *copyright = "(C) 2001-2007 Krzysztof Foltman, license: LGPL";
+static const char *copyright = "(C) 2001-2008 Krzysztof Foltman, license: LGPL";
 
 ////////////////////////////////////////////////////////////////////////////
 
@@ -183,8 +172,6 @@ static synth::ladspa_info organ_info = { 0x8481, "Organ", "Calf Organ", "Krzyszt
 
 ALL_WRAPPERS(organ)
 
-#ifdef ENABLE_EXPERIMENTAL
-#endif
 ////////////////////////////////////////////////////////////////////////////
 
 static synth::ladspa_info monosynth_info = { 0x8480, "Monosynth", "Calf Monosynth", "Krzysztof Foltman", copyright, "SynthesizerPlugin" };
@@ -193,6 +180,26 @@ ALL_WRAPPERS(monosynth)
 
 ////////////////////////////////////////////////////////////////////////////
 
+#ifdef ENABLE_EXPERIMENTAL
+////////////////////////////////////////////////////////////////////////////
+
+const char *synth::small_filter_audio_module::port_names[] = {"In", "Out"};
+
+parameter_properties synth::small_filter_audio_module::param_props[] = {
+    { 2000,      10,20000,    0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "freq", "Frequency" },
+    { 0.707,  0.707,   20,    0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "res", "Resonance" },
+};
+
+static synth::ladspa_info small_lp_filter_info = { 0x8490, "LP12", "12dB/oct LP Filter", "Krzysztof Foltman", copyright, "LowpassPlugin" };
+static synth::ladspa_info small_hp_filter_info = { 0x8491, "HP12", "12dB/oct HP Filter", "Krzysztof Foltman", copyright, "HighpassPlugin" };
+static synth::ladspa_info small_bp_filter_info = { 0x8492, "BP6", "6dB/oct BP Filter", "Krzysztof Foltman", copyright, "BandpassPlugin" };
+
+ALL_WRAPPERS(small_lp_filter)
+ALL_WRAPPERS(small_hp_filter)
+ALL_WRAPPERS(small_bp_filter)
+
+#endif
+
 #if USE_LV2
 extern "C" {
 
@@ -208,6 +215,9 @@ const LV2_Descriptor *lv2_descriptor(uint32_t index)
         case 6: return &::lv2_rotary_speaker.descriptor;
         case 7: return &::lv2_phaser.descriptor;
 #ifdef ENABLE_EXPERIMENTAL
+        case 8: return &::lv2_small_lp_filter.descriptor;
+        case 9: return &::lv2_small_bp_filter.descriptor;
+        case 10: return &::lv2_small_hp_filter.descriptor;
 #endif
         default: return NULL;
     }
@@ -229,6 +239,9 @@ const LADSPA_Descriptor *ladspa_descriptor(unsigned long Index)
         case 4: return &::ladspa_rotary_speaker.descriptor;
         case 5: return &::ladspa_phaser.descriptor;
 #ifdef ENABLE_EXPERIMENTAL
+        case 6: return &::ladspa_small_lp_filter.descriptor;
+        case 7: return &::ladspa_small_hp_filter.descriptor;
+        case 8: return &::ladspa_small_bp_filter.descriptor;
 #endif
         default: return NULL;
     }
@@ -251,6 +264,9 @@ const DSSI_Descriptor *dssi_descriptor(unsigned long Index)
         case 6: return &::ladspa_rotary_speaker.dssi_descriptor;
         case 7: return &::ladspa_phaser.dssi_descriptor;
 #ifdef ENABLE_EXPERIMENTAL
+        case 8: return &::ladspa_small_lp_filter.dssi_descriptor;
+        case 9: return &::ladspa_small_hp_filter.dssi_descriptor;
+        case 10: return &::ladspa_small_bp_filter.dssi_descriptor;
 #endif
         default: return NULL;
     }
@@ -271,6 +287,11 @@ std::string synth::get_builtin_modules_rdf()
     rdf += ::ladspa_organ.generate_rdf();
     rdf += ::ladspa_rotary_speaker.generate_rdf();
     rdf += ::ladspa_phaser.generate_rdf();
+#ifdef ENABLE_EXPERIMENTAL
+    rdf += ::ladspa_small_lp_filter.generate_rdf();
+    rdf += ::ladspa_small_hp_filter.generate_rdf();
+    rdf += ::ladspa_small_bp_filter.generate_rdf();
+#endif
     
     return rdf;
 }
@@ -303,4 +324,9 @@ void synth::get_all_plugins(std::vector<giface_plugin_info> &plugins)
     plugins.push_back(create_plugin_info<organ_audio_module>(organ_info));
     plugins.push_back(create_plugin_info<rotary_speaker_audio_module>(rotary_speaker_info));
     plugins.push_back(create_plugin_info<phaser_audio_module>(phaser_info));
+#ifdef ENABLE_EXPERIMENTAL
+    plugins.push_back(create_plugin_info<small_lp_filter_audio_module>(small_lp_filter_info));
+    plugins.push_back(create_plugin_info<small_hp_filter_audio_module>(small_hp_filter_info));
+    plugins.push_back(create_plugin_info<small_bp_filter_audio_module>(small_bp_filter_info));
+#endif
 }
diff --git a/src/calf/modules_dev.h b/src/modules_small.cpp
similarity index 67%
copy from src/calf/modules_dev.h
copy to src/modules_small.cpp
index 4513856..5e8993c 100644
--- a/src/calf/modules_dev.h
+++ b/src/modules_small.cpp
@@ -1,7 +1,7 @@
 /* Calf DSP Library
- * Prototype audio modules
+ * Example audio modules - parameters and LADSPA wrapper instantiation
  *
- * Copyright (C) 2001-2007 Krzysztof Foltman
+ * Copyright (C) 2001-2008 Krzysztof Foltman
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -18,11 +18,17 @@
  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  * Boston, MA 02111-1307, USA.
  */
-#ifndef __CALF_MODULES_DEV_H
-#define __CALF_MODULES_DEV_H
-
-#if ENABLE_EXPERIMENTAL
-
+#include <config.h>
+#include <assert.h>
+#include <memory.h>
+#if USE_JACK
+#include <jack/jack.h>
 #endif
+#include <calf/giface.h>
+#include <calf/lv2wrap.h>
+#include <calf/modules.h>
+#include <calf/modules_dev.h>
+#include <calf/modules_small.h>
+
+using namespace synth;
 
-#endif

-- 
calf audio plugins packaging



More information about the pkg-multimedia-commits mailing list