[SCM] calf/master: + Updated ChangeLog + Organ: moved declarations to separate file + Organ: added a provisional GUI + Knob: updated to position itself correctly (in non-PHAT version) + RotarySpeaker: gave correct name to Slow speed + GUI: new vscale control (only for drawbars so far, will need Invert parameter later)
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:36:50 UTC 2013
The following commit has been merged in the master branch:
commit dcbf09f39b37e5e8632ae5d482f9697f67f69011
Author: kfoltman <kfoltman at 78b06b96-2940-0410-b7fc-879d825d01d8>
Date: Sat Dec 29 00:07:30 2007 +0000
+ Updated ChangeLog
+ Organ: moved declarations to separate file
+ Organ: added a provisional GUI
+ Knob: updated to position itself correctly (in non-PHAT version)
+ RotarySpeaker: gave correct name to Slow speed
+ GUI: new vscale control (only for drawbars so far, will need Invert parameter later)
git-svn-id: https://calf.svn.sourceforge.net/svnroot/calf/trunk@52 78b06b96-2940-0410-b7fc-879d825d01d8
diff --git a/ChangeLog b/ChangeLog
index 04e80ad..0affc45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,8 @@
Version 0.0.9
+ started creating an XML-based GUI (for monosynth only in this version)
-+ created a GTK+ control for displaying waveforms and filter response graphs
-in Monosynth (and maybe others in future)
++ LineGraph: new GTK+ control for displaying waveforms and filter response
+graphs in Monosynth (and maybe others in future)
+ Monosynth: notch filter changes (made notch bandwidth proportional to Q,
just for fun, might be a bad idea)
+ Monosynth: more waves
@@ -10,3 +10,8 @@ just for fun, might be a bad idea)
something with Sustain = 100% (not a great way to do it, but acceptable in
this case)
+ autotools configuration update (detect Cairo and require newer GTK+)
++ Knob: new GTK+ control based on GtkRange, with my primitive bitmap set
+(generated with Python and Cairo)
++ Organ: added a GUI too, very provisional
++ new effect: Rotary Speaker (split off Organ), unoptimized so far (uses
+trig function in inner loop, icky!)
diff --git a/src/Makefile.am b/src/Makefile.am
index 3319275..2161dd0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -44,10 +44,10 @@ endif
calfbenchmark_SOURCES = benchmark.cpp
calfbenchmark_LDADD =
-calf_la_SOURCES = modules.cpp giface.cpp monosynth.cpp synth.cpp preset.cpp
+calf_la_SOURCES = modules.cpp giface.cpp monosynth.cpp organ.cpp preset.cpp synth.cpp
calf_la_LDFLAGS = -rpath $(ladspadir) -avoid-version -module -lexpat
-libcalfstatic_la_SOURCES = modules.cpp giface.cpp monosynth.cpp synth.cpp preset.cpp
+libcalfstatic_la_SOURCES = modules.cpp giface.cpp monosynth.cpp organ.cpp preset.cpp synth.cpp
libcalfstatic_la_LDFLAGS = -static -lexpat
libcalfgui_la_SOURCES = gui.cpp preset_gui.cpp custom_ctl.cpp
diff --git a/src/calf/gui.h b/src/calf/gui.h
index 4b3f815..16bff73 100644
--- a/src/calf/gui.h
+++ b/src/calf/gui.h
@@ -131,7 +131,6 @@ struct value_param_control: public param_control
virtual void set();
};
-
struct hscale_param_control: public param_control
{
GtkHScale *scale;
@@ -144,6 +143,17 @@ struct hscale_param_control: public param_control
static gchar *hscale_format_value(GtkScale *widget, double arg1, gpointer value);
};
+struct vscale_param_control: public param_control
+{
+ GtkHScale *scale;
+
+ virtual GtkWidget *create(plugin_gui *_gui, int _param_no);
+ virtual void get();
+ virtual void set();
+ virtual void init_xml(const char *element);
+ static void vscale_value_changed(GtkHScale *widget, gpointer value);
+};
+
struct toggle_param_control: public param_control
{
GtkCheckButton *scale;
diff --git a/src/calf/modules_dev.h b/src/calf/modules_dev.h
index 2345504..b27adc5 100644
--- a/src/calf/modules_dev.h
+++ b/src/calf/modules_dev.h
@@ -54,6 +54,8 @@ public:
{
}
static parameter_properties param_props[];
+ static const char *get_gui_xml();
+
void set_sample_rate(uint32_t sr) {
srate = sr;
}
diff --git a/src/custom_ctl.cpp b/src/custom_ctl.cpp
index 0f1b13a..c26f7c3 100644
--- a/src/custom_ctl.cpp
+++ b/src/custom_ctl.cpp
@@ -132,6 +132,10 @@ calf_knob_expose (GtkWidget *widget, GdkEventExpose *event)
// printf("adjustment = %p value = %f\n", adj, adj->value);
int ox = widget->allocation.x, oy = widget->allocation.y;
+
+ ox += (widget->allocation.width - 40) / 2;
+ oy += (widget->allocation.height - 40) / 2;
+
int phase = (adj->value - adj->lower) * 64 / (adj->upper - adj->lower);
if (self->knob_type == 1 && phase == 32) {
double pt = (adj->value - adj->lower) * 2.0 / (adj->upper - adj->lower) - 1.0;
diff --git a/src/gui.cpp b/src/gui.cpp
index 7576131..0266678 100644
--- a/src/gui.cpp
+++ b/src/gui.cpp
@@ -144,6 +144,48 @@ gchar *hscale_param_control::hscale_format_value(GtkScale *widget, double arg1,
return g_strdup (props.to_string (cvalue).c_str());
}
+// vertical fader
+
+GtkWidget *vscale_param_control::create(plugin_gui *_gui, int _param_no)
+{
+ gui = _gui;
+ param_no = _param_no;
+
+ widget = gtk_vscale_new_with_range (0, 1, 0.01);
+ gtk_signal_connect (GTK_OBJECT (widget), "value-changed", G_CALLBACK (vscale_value_changed), (gpointer)this);
+ gtk_scale_set_draw_value(GTK_SCALE(widget), FALSE);
+ gtk_widget_set_size_request (widget, -1, 200);
+
+ return widget;
+}
+
+void vscale_param_control::init_xml(const char *element)
+{
+ if (attribs.count("height"))
+ gtk_widget_set_size_request (widget, -1, get_int("height", 200));
+}
+
+void vscale_param_control::set()
+{
+ _GUARD_CHANGE_
+ parameter_properties &props = get_props();
+ gtk_range_set_value (GTK_RANGE (widget), props.to_01 (gui->plugin->get_param_value(param_no)));
+ // vscale_value_changed (GTK_HSCALE (widget), (gpointer)this);
+}
+
+void vscale_param_control::get()
+{
+ parameter_properties &props = get_props();
+ float cvalue = props.from_01 (gtk_range_get_value (GTK_RANGE (widget)));
+ gui->set_param_value(param_no, cvalue, this);
+}
+
+void vscale_param_control::vscale_value_changed(GtkHScale *widget, gpointer value)
+{
+ vscale_param_control *jhp = (vscale_param_control *)value;
+ jhp->get();
+}
+
// label
GtkWidget *label_param_control::create(plugin_gui *_gui, int _param_no)
@@ -215,6 +257,7 @@ GtkWidget *knob_param_control::create(plugin_gui *_gui, int _param_no)
const parameter_properties &props = get_props();
widget = phat_knob_new_with_range (props.to_01 (gui->plugin->get_param_value(param_no)), 0, 1, 0.01);
+ gtk_widget_set_size_request(widget, 50, 50);
gtk_signal_connect(GTK_OBJECT(widget), "value-changed", G_CALLBACK(knob_value_changed), (gpointer)this);
return widget;
}
@@ -489,6 +532,8 @@ param_control *plugin_gui::create_control_from_xml(const char *element, const ch
return new knob_param_control;
if (!strcmp(element, "hscale"))
return new hscale_param_control;
+ if (!strcmp(element, "vscale"))
+ return new vscale_param_control;
if (!strcmp(element, "combo"))
return new combo_box_param_control;
if (!strcmp(element, "toggle"))
diff --git a/src/modules.cpp b/src/modules.cpp
index 300d3be..fee70fb 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -137,49 +137,16 @@ static synth::ladspa_wrapper<vintage_delay_audio_module> vintage_delay(vintage_d
////////////////////////////////////////////////////////////////////////////
#ifdef ENABLE_EXPERIMENTAL
-const char *organ_audio_module::port_names[] = {"Out L", "Out R"};
-
-const char *organ_percussion_mode_names[] = { "Off", "Short", "Long" };
-const char *organ_percussion_harmonic_names[] = { "2nd", "3rd" };
-
-parameter_properties organ_audio_module::param_props[] = {
- { 0.3, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h1", "16'" },
- { 0.3, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h3", "5 1/3'" },
- { 0.3, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h2", "8'" },
- { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h4", "4'" },
- { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h6", "2 2/3'" },
- { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h8", "2'" },
- { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h10", "1 3/5'" },
- { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h12", "1 1/3'" },
- { 0.3, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h16", "1'" },
-
- { 1, 0, 1, 1.01, PF_BOOL | PF_CTL_TOGGLE, NULL, "foldover", "Foldover" },
- { 1, 0, 2, 1.01, PF_ENUM | PF_CTL_COMBO, organ_percussion_mode_names, "perc_mode", "Perc. mode" },
- { 3, 2, 3, 1.01, PF_ENUM | PF_CTL_COMBO, organ_percussion_harmonic_names, "perc_hrm", "Perc. harmonic" },
-
- { 0.1, 0, 1, 1.01, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB, NULL, "amount", "Amount" },
-};
-
-static synth::ladspa_info organ_info = { 0x8481, "Organ", "Calf Organ", "Krzysztof Foltman", copyright, "SynthesizerPlugin" };
+static synth::ladspa_info rotary_speaker_info = { 0x8483, "RotarySpeaker", "Calf Rotary Speaker", "Krzysztof Foltman", copyright, "SimulationPlugin" };
#if USE_LADSPA
-static synth::ladspa_wrapper<organ_audio_module> organ(organ_info);
+static synth::ladspa_wrapper<rotary_speaker_audio_module> rotary_speaker(rotary_speaker_info);
#endif
-////////////////////////////////////////////////////////////////////////////
-
-const char *rotary_speaker_audio_module::port_names[] = {"In L", "In R", "Out L", "Out R"};
-
-const char *rotary_speaker_speed_names[] = { "Off", "Swell", "Tremolo", "HoldPedal", "ModWheel" };
-
-parameter_properties rotary_speaker_audio_module::param_props[] = {
- { 2, 0, 4, 1.01, PF_ENUM | PF_CTL_COMBO, rotary_speaker_speed_names, "vib_speed", "Speed Mode" },
-};
-
-static synth::ladspa_info rotary_speaker_info = { 0x8483, "RotarySpeaker", "Calf Rotary Speaker", "Krzysztof Foltman", copyright, "SimulationPlugin" };
+static synth::ladspa_info organ_info = { 0x8481, "Organ", "Calf Organ", "Krzysztof Foltman", copyright, "SynthesizerPlugin" };
#if USE_LADSPA
-static synth::ladspa_wrapper<rotary_speaker_audio_module> rotary_speaker(rotary_speaker_info);
+static synth::ladspa_wrapper<organ_audio_module> organ(organ_info);
#endif
#endif
diff --git a/src/organ.cpp b/src/organ.cpp
new file mode 100644
index 0000000..c593d7e
--- /dev/null
+++ b/src/organ.cpp
@@ -0,0 +1,131 @@
+/* Calf DSP Library
+ * Example audio modules - organ
+ *
+ * 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.
+ */
+#if ENABLE_EXPERIMENTAL
+
+#include <assert.h>
+#include <memory.h>
+#include <complex>
+#if USE_JACK
+#include <jack/jack.h>
+#endif
+#include <calf/giface.h>
+#include <calf/modules.h>
+#include <calf/modules_dev.h>
+
+using namespace synth;
+using namespace std;
+
+const char *organ_audio_module::get_gui_xml()
+{
+ return
+ "<vbox border=\"10\">"
+ "<hbox>"
+ "<label param=\"foldover\"/>"
+ "<toggle param=\"foldover\"/>"
+ "<vbox>"
+ "<label param=\"perc_mode\"/>"
+ "<combo param=\"perc_mode\"/>"
+ "</vbox>"
+ "<vbox>"
+ "<label param=\"perc_hrm\"/>"
+ "<combo param=\"perc_hrm\"/>"
+ "</vbox>"
+ "<vbox>"
+ "<label param=\"master\"/>"
+ "<knob param=\"master\"/>"
+ "<value param=\"master\"/>"
+ "</vbox>"
+ "</hbox>"
+ "<table rows=\"3\" cols=\"9\">"
+ "<label attach-x=\"0\" attach-y=\"0\" param=\"h1\"/>"
+ "<vscale attach-x=\"0\" attach-y=\"1\" param=\"h1\"/>"
+ "<value attach-x=\"0\" attach-y=\"2\" param=\"h1\"/>"
+
+ "<label attach-x=\"1\" attach-y=\"0\" param=\"h3\"/>"
+ "<vscale attach-x=\"1\" attach-y=\"1\" param=\"h3\"/>"
+ "<value attach-x=\"1\" attach-y=\"2\" param=\"h3\"/>"
+
+ "<label attach-x=\"2\" attach-y=\"0\" param=\"h2\"/>"
+ "<vscale attach-x=\"2\" attach-y=\"1\" param=\"h2\"/>"
+ "<value attach-x=\"2\" attach-y=\"2\" param=\"h2\"/>"
+
+ "<label attach-x=\"3\" attach-y=\"0\" param=\"h4\"/>"
+ "<vscale attach-x=\"3\" attach-y=\"1\" param=\"h4\"/>"
+ "<value attach-x=\"3\" attach-y=\"2\" param=\"h4\"/>"
+
+ "<label attach-x=\"4\" attach-y=\"0\" param=\"h6\"/>"
+ "<vscale attach-x=\"4\" attach-y=\"1\" param=\"h6\"/>"
+ "<value attach-x=\"4\" attach-y=\"2\" param=\"h6\"/>"
+
+ "<label attach-x=\"5\" attach-y=\"0\" param=\"h8\"/>"
+ "<vscale attach-x=\"5\" attach-y=\"1\" param=\"h8\"/>"
+ "<value attach-x=\"5\" attach-y=\"2\" param=\"h8\"/>"
+
+ "<label attach-x=\"6\" attach-y=\"0\" param=\"h10\"/>"
+ "<vscale attach-x=\"6\" attach-y=\"1\" param=\"h10\"/>"
+ "<value attach-x=\"6\" attach-y=\"2\" param=\"h10\"/>"
+
+ "<label attach-x=\"7\" attach-y=\"0\" param=\"h12\"/>"
+ "<vscale attach-x=\"7\" attach-y=\"1\" param=\"h12\"/>"
+ "<value attach-x=\"7\" attach-y=\"2\" param=\"h12\"/>"
+
+ "<label attach-x=\"8\" attach-y=\"0\" param=\"h16\"/>"
+ "<vscale attach-x=\"8\" attach-y=\"1\" param=\"h16\"/>"
+ "<value attach-x=\"8\" attach-y=\"2\" param=\"h16\"/>"
+ "</table>"
+ "</vbox>"
+ ;
+}
+
+const char *organ_audio_module::port_names[] = {"Out L", "Out R"};
+
+const char *organ_percussion_mode_names[] = { "Off", "Short", "Long" };
+const char *organ_percussion_harmonic_names[] = { "2nd", "3rd" };
+
+parameter_properties organ_audio_module::param_props[] = {
+ { 0.3, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h1", "16'" },
+ { 0.3, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h3", "5 1/3'" },
+ { 0.3, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h2", "8'" },
+ { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h4", "4'" },
+ { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h6", "2 2/3'" },
+ { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h8", "2'" },
+ { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h10", "1 3/5'" },
+ { 0, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h12", "1 1/3'" },
+ { 0.3, 0, 1, 1.01, PF_FLOAT | PF_SCALE_QUAD | PF_CTL_FADER, NULL, "h16", "1'" },
+
+ { 1, 0, 1, 1.01, PF_BOOL | PF_CTL_TOGGLE, NULL, "foldover", "Foldover" },
+ { 1, 0, 2, 1.01, PF_ENUM | PF_CTL_COMBO, organ_percussion_mode_names, "perc_mode", "Perc. mode" },
+ { 3, 2, 3, 1.01, PF_ENUM | PF_CTL_COMBO, organ_percussion_harmonic_names, "perc_hrm", "Perc. harmonic" },
+
+ { 0.1, 0, 1, 1.01, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB, NULL, "master", "Master" },
+};
+
+////////////////////////////////////////////////////////////////////////////
+
+const char *rotary_speaker_audio_module::port_names[] = {"In L", "In R", "Out L", "Out R"};
+
+const char *rotary_speaker_speed_names[] = { "Off", "Chorale", "Tremolo", "HoldPedal", "ModWheel" };
+
+parameter_properties rotary_speaker_audio_module::param_props[] = {
+ { 2, 0, 4, 1.01, PF_ENUM | PF_CTL_COMBO, rotary_speaker_speed_names, "vib_speed", "Speed Mode" },
+};
+
+#endif
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list