diff --git a/gtk/rtbuf_input_widget.c b/gtk/rtbuf_input_widget.c
index 67a5dbf..92ce225 100644
--- a/gtk/rtbuf_input_widget.c
+++ b/gtk/rtbuf_input_widget.c
@@ -15,6 +15,7 @@
*/
#include <assert.h>
+#include <math.h>
#include <gtk/gtk.h>
#include "rtbuf_gtk.h"
#include "rtbuf_input_widget.h"
@@ -31,6 +32,10 @@ struct _RtbufInputWidgetPrivate {
GtkWidget *slider;
GtkWidget *max;
double max_value;
+ double max_log;
+ double log_base;
+ double *unbound_value;
+ double unbound_value_log;
};
enum {
@@ -199,37 +204,65 @@ rtbuf_input_widget_get_check (RtbufInputWidget *widget)
void rtbuf_input_widget_slider_value_changed
(const RtbufInputWidgetPrivate *priv)
{
- double value;
- double *unbound_value;
char str[64];
- value = gtk_range_get_value(GTK_RANGE(priv->slider));
+ double value;
+ if (priv->log_base == 1.0) {
+ value = gtk_range_get_value(GTK_RANGE(priv->slider));
+ }
+ else {
+ const double log = gtk_range_get_value(GTK_RANGE(priv->slider));
+ value = priv->min_value * pow(priv->log_base, log);
+ }
snprintf(str, sizeof(str), "%lg", value);
gtk_entry_set_text(GTK_ENTRY(priv->value), str);
- unbound_value = rtbuf_in_unbound_value(priv->rtbuf, priv->in);
- *unbound_value = value;
+ *priv->unbound_value = value;
+}
+
+void rtbuf_input_widget_update_value (RtbufInputWidgetPrivate *priv)
+{
+ if (priv->log_base == 1.0)
+ gtk_range_set_value(GTK_RANGE(priv->slider), *priv->unbound_value);
+ else {
+ priv->unbound_value_log = (log(*priv->unbound_value) -
+ log(priv->min_value)) /
+ log(priv->log_base);
+ gtk_range_set_value(GTK_RANGE(priv->slider),
+ priv->unbound_value_log);
+ }
}
gboolean rtbuf_input_widget_value_key_press_event
-(const RtbufInputWidgetPrivate *priv, GdkEventKey *event)
+(RtbufInputWidgetPrivate *priv, GdkEventKey *event)
{
const char *str;
char str_mut[64];
double value;
- double *unbound_value;
if (event->keyval == GDK_KEY_Return) {
str = gtk_entry_get_text(GTK_ENTRY(priv->value));
if (sscanf(str, "%lg", &value) == 1) {
snprintf(str_mut, sizeof(str_mut), "%lg", value);
gtk_entry_set_text(GTK_ENTRY(priv->value), str_mut);
- gtk_range_set_value(GTK_RANGE(priv->slider), value);
- unbound_value = rtbuf_in_unbound_value(priv->rtbuf, priv->in);
- *unbound_value = value;
+ *priv->unbound_value = value;
+ rtbuf_input_widget_update_value(priv);
}
return TRUE;
}
return FALSE;
}
+void rtbuf_input_widget_update_range (RtbufInputWidgetPrivate *priv)
+{
+ if (priv->log_base == 1.0)
+ gtk_range_set_range(GTK_RANGE(priv->slider), priv->min_value,
+ priv->max_value);
+ else {
+ priv->max_log = (log(priv->max_value) - log(priv->min_value)) /
+ log(priv->log_base);
+ gtk_range_set_range(GTK_RANGE(priv->slider), 0, priv->max_log);
+ rtbuf_input_widget_update_value(priv);
+ }
+}
+
gboolean rtbuf_input_widget_min_key_press_event
(RtbufInputWidgetPrivate *priv, GdkEventKey *event)
{
@@ -242,8 +275,7 @@ gboolean rtbuf_input_widget_min_key_press_event
snprintf(str_mut, sizeof(str_mut), "%lg", min);
gtk_entry_set_text(GTK_ENTRY(priv->min), str_mut);
priv->min_value = min;
- gtk_range_set_range(GTK_RANGE(priv->slider), priv->min_value,
- priv->max_value);
+ rtbuf_input_widget_update_range(priv);
}
return TRUE;
}
@@ -262,14 +294,13 @@ gboolean rtbuf_input_widget_max_key_press_event
snprintf(str_mut, sizeof(str_mut), "%lg", max);
gtk_entry_set_text(GTK_ENTRY(priv->max), str_mut);
priv->max_value = max;
- gtk_range_set_range(GTK_RANGE(priv->slider), priv->min_value,
- priv->max_value);
+ rtbuf_input_widget_update_range(priv);
}
return TRUE;
}
return FALSE;
}
-
+
void
rtbuf_input_widget_update_rtbuf_in (RtbufInputWidget *widget)
{
@@ -285,22 +316,21 @@ rtbuf_input_widget_update_rtbuf_in (RtbufInputWidget *widget)
char min[64];
char max[64];
char value[64];
- double unbound_value;
assert((long long) priv->in < (long long) proc->in_n);
label = in->name_type;
gtk_label_set_text(GTK_LABEL(priv->label), label);
+ priv->unbound_value = rtbuf_in_unbound_value(priv->rtbuf, priv->in);
+ snprintf(value, sizeof(value), "%lg", *priv->unbound_value);
+ gtk_entry_set_text(GTK_ENTRY(priv->value), value);
snprintf(min, sizeof(min), "%lg", in->min);
gtk_entry_set_text(GTK_ENTRY(priv->min), min);
snprintf(max, sizeof(max), "%lg", in->max);
gtk_entry_set_text(GTK_ENTRY(priv->max), max);
- unbound_value = *rtbuf_in_unbound_value(priv->rtbuf, priv->in);
- snprintf(value, sizeof(value), "%lg", unbound_value);
- gtk_entry_set_text(GTK_ENTRY(priv->value), value);
priv->min_value = in->min;
priv->max_value = in->max;
- gtk_range_set_range(GTK_RANGE(priv->slider), priv->min_value,
- priv->max_value);
- gtk_range_set_value(GTK_RANGE(priv->slider), unbound_value);
+ priv->log_base = in->log_base;
+ rtbuf_input_widget_update_range(priv);
+ rtbuf_input_widget_update_value(priv);
g_signal_connect_swapped(priv->slider, "value-changed",
G_CALLBACK(rtbuf_input_widget_slider_value_changed),
priv);
diff --git a/gtk/rtbuf_input_widget.ui b/gtk/rtbuf_input_widget.ui
index 50ec52c..5a7efee 100644
--- a/gtk/rtbuf_input_widget.ui
+++ b/gtk/rtbuf_input_widget.ui
@@ -38,7 +38,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_frame">False</property>
- <property name="width_chars">9</property>
+ <property name="width_chars">11</property>
<property name="text" translatable="yes">0.0</property>
<property name="caps_lock_warning">False</property>
<property name="input_purpose">number</property>
@@ -54,7 +54,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_frame">False</property>
- <property name="width_chars">9</property>
+ <property name="width_chars">11</property>
<property name="text" translatable="yes">0.0</property>
<property name="caps_lock_warning">False</property>
<property name="input_purpose">number</property>
@@ -86,7 +86,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_frame">False</property>
- <property name="width_chars">9</property>
+ <property name="width_chars">11</property>
<property name="text" translatable="yes">1.0</property>
<property name="caps_lock_warning">False</property>
<property name="input_purpose">number</property>
diff --git a/lib/dynamic/limiter.c b/lib/dynamic/limiter.c
index f890345..073e9c3 100644
--- a/lib/dynamic/limiter.c
+++ b/lib/dynamic/limiter.c
@@ -15,6 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <float.h>
#include <math.h>
#include <rtbuf/rtbuf.h>
#include <rtbuf/lib.h>
@@ -22,18 +23,18 @@
#include <rtbuf/signal_type.h>
#include <rtbuf/dynamic.h>
-s_rtbuf_lib_proc_in rtbuf_dynamic_limiter_in[] = {
- { "signal" , RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "gain" , RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1.0 },
- { "treshold", RTBUF_SIGNAL_TYPE, 0.9, 0.0, 1.0 },
- { "attack" , RTBUF_SIGNAL_TYPE, 0.1, 0.0, 1.0 },
- { "release" , RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 }};
+s_rtbuf_lib_proc_in rtbuf_dynamic_limiter_in[] =
+ {{ "signal" , RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "gain" , RTBUF_SIGNAL_TYPE, 1.0, DBL_EPSILON, 1000.0, 10.0 },
+ { "treshold", RTBUF_SIGNAL_TYPE, 0.9, DBL_EPSILON, 1.0, 10.0 },
+ { "attack" , RTBUF_SIGNAL_TYPE, 0.1, 0, 1.0, 1.0 },
+ { "release" , RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1.0, 1.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_dynamic_limiter_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "ratio" , RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 }};
+s_rtbuf_lib_proc_out rtbuf_dynamic_limiter_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "ratio" , RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_dynamic_limiter (s_rtbuf *rtb)
{
diff --git a/lib/glfw3/oscilloscope.c b/lib/glfw3/oscilloscope.c
index 555e48f..54bac4c 100644
--- a/lib/glfw3/oscilloscope.c
+++ b/lib/glfw3/oscilloscope.c
@@ -22,16 +22,16 @@
#include <rtbuf/music_type.h>
#include <rtbuf/glfw3.h>
-s_rtbuf_lib_proc_in rtbuf_glfw3_oscilloscope_in[] = {
- { "black", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "red" , RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "green", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "blue" , RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_glfw3_oscilloscope_in[] =
+ {{ "black", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "red" , RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "green", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "blue" , RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_glfw3_oscilloscope_out[] = {
- { "window", "void*" },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_glfw3_oscilloscope_out[] =
+ {{ "window", "void*" },
+ { 0, 0 }};
int rtbuf_lib_init (s_rtbuf_lib *lib)
{
diff --git a/lib/include/rtbuf/music.h b/lib/include/rtbuf/music.h
index c370e37..b772f8c 100644
--- a/lib/include/rtbuf/music.h
+++ b/lib/include/rtbuf/music.h
@@ -33,12 +33,12 @@ typedef struct rtbuf_music_note {
t_rtbuf_signal_sample stop; /* time since stop, or -1.0 */
} s_rtbuf_music_note;
-#define RTBUF_MUSIC_NOTE_IN(note) \
- { note "velocity", RTBUF_SIGNAL_SAMPLE_TYPE, 1.0, 0.0, 1.0 }, \
- { note "frequency", RTBUF_SIGNAL_SAMPLE_TYPE, 220.0, 0.0, \
- RTBUF_SIGNAL_SAMPLERATE / 2.0 }, \
- { note "start", RTBUF_SIGNAL_SAMPLE_TYPE, -1.0, -1.0, FLT_MAX }, \
- { note "stop", RTBUF_SIGNAL_SAMPLE_TYPE, -1.0, -1.0, FLT_MAX }
+#define RTBUF_MUSIC_NOTE_IN(note) \
+ { note "velocity", RTBUF_SIGNAL_SAMPLE_TYPE, 1.0, 0.0, 1.0, 1.0 }, \
+ { note "frequency", RTBUF_SIGNAL_SAMPLE_TYPE, 220.0, 0.0, \
+ RTBUF_SIGNAL_SAMPLERATE / 2.0, 1.0 }, \
+ { note "start", RTBUF_SIGNAL_SAMPLE_TYPE, -1.0, -1.0, DBL_MAX, 1.0 }, \
+ { note "stop", RTBUF_SIGNAL_SAMPLE_TYPE, -1.0, -1.0, DBL_MAX, 1.0 }
#define RTBUF_MUSIC_NOTE_IN_ENUM(note) \
note ## _VELOCITY , \
diff --git a/lib/music_type.c b/lib/music_type.c
index 3ed4246..782c40a 100644
--- a/lib/music_type.c
+++ b/lib/music_type.c
@@ -24,14 +24,14 @@ void notes_in ()
const char *st = "RTBUF_SIGNAL_SAMPLE_TYPE";
printf("\n"
"#define RTBUF_MUSIC_NOTES_IN(note) \\\n"
- " { note \"s\" , RTBUF_MUSIC_NOTES_TYPE, 0.0, 0.0, 0.0 }"
+ " { note \"s\" , RTBUF_MUSIC_NOTES_TYPE, 0.0, 0.0, 0.0, 1.0 }"
", \\\n");
while (i < RTBUF_MUSIC_NOTE_MAX) {
- printf(" { note \"[%u].velocity\" , %s, 0.0, 0.0, 1.0 }, \\\n", i, st);
+ printf(" { note \"[%u].velocity\" , %s, 0.0, 0.0, 1.0, 1.0 }, \\\n", i, st);
printf(" { note \"[%u].frequency\", %s, 0.0, 0.0, "
- "RTBUF_SIGNAL_SAMPLERATE / 2.0 }, \\\n", i, st);
- printf(" { note \"[%u].start\" , %s, -1.0, -1.0, FLT_MAX }, \\\n", i, st);
- printf(" { note \"[%u].stop\" , %s, -1.0, -1.0, FLT_MAX }", i, st);
+ "RTBUF_SIGNAL_SAMPLERATE / 2.0, 1.0 }, \\\n", i, st);
+ printf(" { note \"[%u].start\" , %s, -1.0, -1.0, DBL_MAX, 1.0 }, \\\n", i, st);
+ printf(" { note \"[%u].stop\" , %s, -1.0, -1.0, DBL_MAX, 1.0 }", i, st);
if (i < RTBUF_MUSIC_NOTE_MAX - 1)
printf(", \\");
printf("\n");
diff --git a/lib/portaudio/output.c b/lib/portaudio/output.c
index e5895ec..fa97397 100644
--- a/lib/portaudio/output.c
+++ b/lib/portaudio/output.c
@@ -27,15 +27,15 @@
int g_initialized = 0;
-s_rtbuf_lib_proc_in rtbuf_portaudio_output_in[] = {
- { "left", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "right", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 }};
+s_rtbuf_lib_proc_in rtbuf_portaudio_output_in[] =
+ {{ "left", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "right", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_portaudio_output_out[] = {
- { "samples", RTBUF_PORTAUDIO_SAMPLES_TYPE },
- { "reserved", RTBUF_PORTAUDIO_OUTPUT_RESERVED_TYPE },
- { 0, 0 }};
+s_rtbuf_lib_proc_out rtbuf_portaudio_output_out[] =
+ {{ "samples", RTBUF_PORTAUDIO_SAMPLES_TYPE },
+ { "reserved", RTBUF_PORTAUDIO_OUTPUT_RESERVED_TYPE },
+ { 0, 0 }};
int rtbuf_portaudio_output_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/bandpass2.c b/lib/signal/bandpass2.c
index e3aefa2..f77215f 100644
--- a/lib/signal/bandpass2.c
+++ b/lib/signal/bandpass2.c
@@ -51,23 +51,23 @@ y: (4 f2 w2 (x4 - 2 x2 + x) - (b y1 + c y2 + d y3 + e y4)) / a;
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_bandpass2_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { "qfactor", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1000.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_bandpass2_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 20.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { "qfactor", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1000.0, 1.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_bandpass2_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_bandpass2_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_bandpass2_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/delay.c b/lib/signal/delay.c
index 4bed8b7..fa653de 100644
--- a/lib/signal/delay.c
+++ b/lib/signal/delay.c
@@ -21,17 +21,17 @@
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_delay_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "delay", RTBUF_SIGNAL_TYPE, 0.4, 0.0, RTBUF_SIGNAL_DELAY_MAX },
- { "feedback", RTBUF_SIGNAL_TYPE, 0.5, 0.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_delay_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "delay", RTBUF_SIGNAL_TYPE, 0.4, 0.0, RTBUF_SIGNAL_DELAY_MAX, 1.0 },
+ { "feedback", RTBUF_SIGNAL_TYPE, 0.5, 0.0, 1.0, 1.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_delay_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "in", RTBUF_SIGNAL_DELAY_TYPE },
- { "pos", "unsigned int" },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_delay_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "in", RTBUF_SIGNAL_DELAY_TYPE },
+ { "pos", "unsigned int" },
+ { 0, 0 }};
int rtbuf_signal_delay_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/equalizer10.c b/lib/signal/equalizer10.c
index 5baf3c1..da1901e 100644
--- a/lib/signal/equalizer10.c
+++ b/lib/signal/equalizer10.c
@@ -56,19 +56,19 @@ q: 2
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_equalizer10_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "amp32", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { "amp64", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { "amp128", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { "amp256", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { "amp512", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { "amp1k", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { "amp2k", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { "amp4k", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { "amp8k", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { "amp16k", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_equalizer10_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "amp32", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { "amp64", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { "amp128", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { "amp256", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { "amp512", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { "amp1k", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { "amp2k", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { "amp4k", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { "amp8k", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { "amp16k", RTBUF_SIGNAL_TYPE, 1.0, 0.01, 2.0, 10.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
s_rtbuf_lib_proc_out rtbuf_signal_equalizer10_out[] = {
{ "signal", RTBUF_SIGNAL_TYPE },
diff --git a/lib/signal/flanger.c b/lib/signal/flanger.c
index 490ead4..7564529 100644
--- a/lib/signal/flanger.c
+++ b/lib/signal/flanger.c
@@ -24,21 +24,21 @@
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_flanger_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "frequency", RTBUF_SIGNAL_TYPE, 0.5, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { "amplitude", RTBUF_SIGNAL_TYPE, 0.02, 0.0, 1.0 },
- { "delay", RTBUF_SIGNAL_TYPE, 0.0001, 0.0, 1.0 },
- { "feedback", RTBUF_SIGNAL_TYPE, 0.01, 0.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_flanger_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "frequency", RTBUF_SIGNAL_TYPE, 0.5, 0.01, 20.0, 2.0 },
+ { "amplitude", RTBUF_SIGNAL_TYPE, 0.02, 0.01, 1.0, 10.0 },
+ { "delay", RTBUF_SIGNAL_TYPE, 0.01, 0.01, 1.0, 2.0 },
+ { "feedback", RTBUF_SIGNAL_TYPE, 0.01, 0.0, 1.0, 1.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_flanger_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "phase", "double" },
- { "in", RTBUF_SIGNAL_FLANGER_TYPE },
- { "pos", "unsigned int" },
- { "ds", "unsigned int" },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_flanger_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "phase", "double" },
+ { "in", RTBUF_SIGNAL_FLANGER_TYPE },
+ { "pos", "unsigned int" },
+ { "ds", "unsigned int" },
+ { 0, 0 }};
int rtbuf_signal_flanger_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/hipass.c b/lib/signal/hipass.c
index d34595e..b5c64a3 100644
--- a/lib/signal/hipass.c
+++ b/lib/signal/hipass.c
@@ -20,16 +20,16 @@
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_hipass_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 8000.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_hipass_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 8000.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_hipass_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_hipass_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_hipass_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/hipass2.c b/lib/signal/hipass2.c
index 55116c5..d74b4a6 100644
--- a/lib/signal/hipass2.c
+++ b/lib/signal/hipass2.c
@@ -20,18 +20,18 @@
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_hipass2_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 8000.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_hipass2_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 8000.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_hipass2_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_hipass2_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_hipass2_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/hipass3.c b/lib/signal/hipass3.c
index a5c743a..a7d5f92 100644
--- a/lib/signal/hipass3.c
+++ b/lib/signal/hipass3.c
@@ -46,20 +46,20 @@ y: (8 F³ ((x - x3) + 3 (x2 - x1)) - (a y3 + b y2 + c y1)) / d
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_hipass3_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 8000.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_hipass3_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 0.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 8000.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_hipass3_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_hipass3_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_hipass3_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/hipass4.c b/lib/signal/hipass4.c
index fddb130..8c319a2 100644
--- a/lib/signal/hipass4.c
+++ b/lib/signal/hipass4.c
@@ -51,22 +51,22 @@ y: f4 (16 (x4 + x) - 64 (x3 + x1) + 96 x2 - (e y4 + d y3 + c y2 + b y1)) / a $
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_hipass4_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 8000.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_hipass4_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 8000.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_hipass4_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_hipass4_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_hipass4_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/hipass5.c b/lib/signal/hipass5.c
index 30ffeac..572e69a 100644
--- a/lib/signal/hipass5.c
+++ b/lib/signal/hipass5.c
@@ -63,24 +63,24 @@ y: (f5 (32 (x - x5) + 160 (x4 - x1) + 320 (x2 - x3)) - (b y1 + c y2 + d y3 + e y
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_hipass5_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_hipass5_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_hipass5_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x5", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y5", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_hipass5_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x5", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y5", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_hipass5_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/lowpass.c b/lib/signal/lowpass.c
index 6b70532..fd0b2c3 100644
--- a/lib/signal/lowpass.c
+++ b/lib/signal/lowpass.c
@@ -21,16 +21,16 @@
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_lowpass_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_lowpass_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_lowpass_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_lowpass_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_lowpass_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/lowpass2.c b/lib/signal/lowpass2.c
index 659c9b8..3f75be8 100644
--- a/lib/signal/lowpass2.c
+++ b/lib/signal/lowpass2.c
@@ -25,18 +25,18 @@ H: 1/B2 $
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_lowpass2_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_lowpass2_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_lowpass2_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_lowpass2_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_lowpass2_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/lowpass3.c b/lib/signal/lowpass3.c
index 6b32658..26218d9 100644
--- a/lib/signal/lowpass3.c
+++ b/lib/signal/lowpass3.c
@@ -21,20 +21,20 @@
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_lowpass3_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_lowpass3_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_lowpass3_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_lowpass3_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_lowpass3_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/lowpass4.c b/lib/signal/lowpass4.c
index 0c43de7..fdb4f29 100644
--- a/lib/signal/lowpass4.c
+++ b/lib/signal/lowpass4.c
@@ -55,22 +55,22 @@ y: (w4*(x4+4*x3+6*x2+4*x1+x)-(c*y4+d*y3+e*y2+f*y1))/g $
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_lowpass4_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_lowpass4_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_lowpass4_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_lowpass4_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_lowpass4_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/lowpass5.c b/lib/signal/lowpass5.c
index 843ac6b..7ed8a4d 100644
--- a/lib/signal/lowpass5.c
+++ b/lib/signal/lowpass5.c
@@ -61,24 +61,24 @@ f: w5 + (r5 + 1)(-2)(f w4 - 8 f4 w) + (4 r5 + 12) (f2 w3 - 2 f3 w2) - 32
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_lowpass5_in[] = {
- { "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_lowpass5_in[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "cutoff", RTBUF_SIGNAL_TYPE, 400.0, 1.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_lowpass5_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "x5", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
- { "y5", RTBUF_SIGNAL_SAMPLE_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_lowpass5_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "x1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "x5", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y1", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y2", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y3", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y4", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { "y5", RTBUF_SIGNAL_SAMPLE_TYPE },
+ { 0, 0 }};
int rtbuf_signal_lowpass5_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/sawtooth.c b/lib/signal/sawtooth.c
index 3d29b98..fcbc944 100644
--- a/lib/signal/sawtooth.c
+++ b/lib/signal/sawtooth.c
@@ -15,6 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <float.h>
#include <math.h>
#include <stdio.h>
#include <rtbuf/rtbuf.h>
@@ -22,15 +23,15 @@
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_sawtooth_in[] = {
- { "frequency", RTBUF_SIGNAL_TYPE, 220.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { "amplitude", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_sawtooth_in[] =
+ {{ "frequency", RTBUF_SIGNAL_TYPE, 220.0, 20.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { "amplitude", RTBUF_SIGNAL_TYPE, 1.0, 0.001, 1.0, 10.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_sawtooth_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "phase", "double" },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_sawtooth_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "phase", "double" },
+ { 0, 0 }};
int rtbuf_signal_sawtooth_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/sinus.c b/lib/signal/sinus.c
index e07f990..94dcc24 100644
--- a/lib/signal/sinus.c
+++ b/lib/signal/sinus.c
@@ -15,6 +15,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <float.h>
#include <math.h>
#include <stdio.h>
#include <rtbuf/rtbuf.h>
@@ -22,15 +23,15 @@
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_sinus_in[] = {
- { "frequency", RTBUF_SIGNAL_TYPE, 220.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { "amplitude", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_sinus_in[] =
+ {{ "frequency", RTBUF_SIGNAL_TYPE, 220.0, 20.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { "amplitude", RTBUF_SIGNAL_TYPE, 1.0, 0.001, 1.0, 10.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_sinus_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "phase", "double" },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_sinus_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "phase", "double" },
+ { 0, 0 }};
int rtbuf_signal_sinus_start (s_rtbuf *rtb)
{
diff --git a/lib/signal/square.c b/lib/signal/square.c
index 39835f7..761fef0 100644
--- a/lib/signal/square.c
+++ b/lib/signal/square.c
@@ -14,6 +14,7 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include <float.h>
#include <math.h>
#include <stdio.h>
#include <rtbuf/rtbuf.h>
@@ -21,16 +22,16 @@
#include <rtbuf/signal.h>
#include <rtbuf/signal_type.h>
-s_rtbuf_lib_proc_in rtbuf_signal_square_in[] = {
- { "frequency", RTBUF_SIGNAL_TYPE, 220.0, 0.0, RTBUF_SIGNAL_SAMPLERATE / 2.0 },
- { "amplitude", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1.0 },
- { "pulse", RTBUF_SIGNAL_TYPE, 0.5, 0.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_signal_square_in[] =
+ {{ "frequency", RTBUF_SIGNAL_TYPE, 220.0, 20.0, RTBUF_SIGNAL_SAMPLERATE / 2.0, 2.0 },
+ { "amplitude", RTBUF_SIGNAL_TYPE, 1.0, 0.001, 1.0, 10.0 },
+ { "pulse", RTBUF_SIGNAL_TYPE, 0.5, 0.0, 1.0, 1.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_signal_square_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "phase", "double" },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_signal_square_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "phase", "double" },
+ { 0, 0 }};
static
double square (double amp, double phase, double pulse)
diff --git a/lib/sndio/output.c b/lib/sndio/output.c
index d9f6ba1..140426d 100644
--- a/lib/sndio/output.c
+++ b/lib/sndio/output.c
@@ -25,15 +25,15 @@
#include <rtbuf/sndio.h>
#include <rtbuf/sndio_type.h>
-s_rtbuf_lib_proc_in rtbuf_sndio_output_in[] = {
- { "left", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { "right", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_sndio_output_in[] =
+ {{ "left", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { "right", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_sndio_output_out[] = {
- { "samples", RTBUF_SNDIO_SAMPLES_TYPE },
- { "reserved", RTBUF_SNDIO_OUTPUT_RESERVED_TYPE },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_sndio_output_out[] =
+ {{ "samples", RTBUF_SNDIO_SAMPLES_TYPE },
+ { "reserved", RTBUF_SNDIO_OUTPUT_RESERVED_TYPE },
+ { 0, 0 }};
void rtbuf_sndio_output_parameters (struct sio_par *want)
{
diff --git a/lib/synth/adsr.c b/lib/synth/adsr.c
index 3face6f..7f2422a 100644
--- a/lib/synth/adsr.c
+++ b/lib/synth/adsr.c
@@ -26,18 +26,18 @@
#include <rtbuf/music_type.h>
#include <rtbuf/synth.h>
-s_rtbuf_lib_proc_in rtbuf_synth_adsr_in[] = {
- RTBUF_MUSIC_NOTE_IN(),
- { "attack", RTBUF_SIGNAL_TYPE, 0.02, 0.0, 2.0 },
- { "decay", RTBUF_SIGNAL_TYPE, 0.01, 0.0, 2.0 },
- { "sustain", RTBUF_SIGNAL_TYPE, 0.4, 0.0, 1.0 },
- { "release", RTBUF_SIGNAL_TYPE, 0.3, 0.0, 10.0 },
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_synth_adsr_in[] =
+ {RTBUF_MUSIC_NOTE_IN(),
+ { "attack", RTBUF_SIGNAL_TYPE, 0.02, 0.0, 2.0, 1.0 },
+ { "decay", RTBUF_SIGNAL_TYPE, 0.01, 0.0, 2.0, 1.0 },
+ { "sustain", RTBUF_SIGNAL_TYPE, 0.4, 0.0, 1.0, 1.0 },
+ { "release", RTBUF_SIGNAL_TYPE, 0.3, 0.0, 10.0, 1.0 },
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_synth_adsr_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "state", "int" },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_synth_adsr_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "state", "int" },
+ { 0, 0 }};
static
double adsr (double attack, double decay, double sustain,
diff --git a/lib/synth/synth.c b/lib/synth/synth.c
index 2a39ea5..5a8c239 100644
--- a/lib/synth/synth.c
+++ b/lib/synth/synth.c
@@ -27,16 +27,16 @@
#include <rtbuf/synth.h>
#include <rtbuf/synth_type.h>
-s_rtbuf_lib_proc_in rtbuf_synth_synth_in[] = {
- { "envelope", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1.0 },
- { "oscillator", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0 },
- RTBUF_MUSIC_NOTES_IN("note"),
- { 0, 0, 0.0, 0.0, 0.0 } };
+s_rtbuf_lib_proc_in rtbuf_synth_synth_in[] =
+ {{ "envelope", RTBUF_SIGNAL_TYPE, 1.0, 0.0, 1.0, 1.0 },
+ { "oscillator", RTBUF_SIGNAL_TYPE, 0.0, -1.0, 1.0, 1.0 },
+ RTBUF_MUSIC_NOTES_IN("note"),
+ { 0, 0, 0.0, 0.0, 0.0, 0.0 }};
-s_rtbuf_lib_proc_out rtbuf_synth_synth_out[] = {
- { "signal", RTBUF_SIGNAL_TYPE },
- { "note_n", "unsigned int" },
- { 0, 0 } };
+s_rtbuf_lib_proc_out rtbuf_synth_synth_out[] =
+ {{ "signal", RTBUF_SIGNAL_TYPE },
+ { "note_n", "unsigned int" },
+ { 0, 0 }};
int rtbuf_lib_init (s_rtbuf_lib *lib)
{
diff --git a/librtbuf/include/rtbuf/lib.h b/librtbuf/include/rtbuf/lib.h
index 861db6f..5b9f4f8 100644
--- a/librtbuf/include/rtbuf/lib.h
+++ b/librtbuf/include/rtbuf/lib.h
@@ -27,6 +27,7 @@ struct rtbuf_lib_proc_in {
double def;
double min;
double max;
+ double log_base;
};
struct rtbuf_lib_proc_out {
diff --git a/librtbuf/include/rtbuf/proc.h b/librtbuf/include/rtbuf/proc.h
index e372688..32441dc 100644
--- a/librtbuf/include/rtbuf/proc.h
+++ b/librtbuf/include/rtbuf/proc.h
@@ -27,6 +27,7 @@ struct rtbuf_proc_in {
double def;
double min;
double max;
+ double log_base;
unsigned int offset;
};
diff --git a/librtbuf/rtbuf_lib.c b/librtbuf/rtbuf_lib.c
index e71ecd3..ab21c4f 100644
--- a/librtbuf/rtbuf_lib.c
+++ b/librtbuf/rtbuf_lib.c
@@ -213,6 +213,7 @@ void rtbuf_lib_proc_in_init_proc (s_rtbuf_proc *proc,
v->def = in->def;
v->min = in->min;
v->max = in->max;
+ v->log_base = in->log_base;
size = sizeof(double);
offset = add_padding(offset, size);
v->offset = offset;