[SCM] calf/master: + Fluidsynth: implement control over reverb, chorus and interpolation mode
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:39:30 UTC 2013
The following commit has been merged in the master branch:
commit 6e4069314f075b751c0b1e99f9dc9dc39585aeaa
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Wed Apr 22 20:29:08 2009 +0100
+ Fluidsynth: implement control over reverb, chorus and interpolation mode
diff --git a/gui/gui-fluidsynth.xml b/gui/gui-fluidsynth.xml
index f49cc83..2f52e9a 100644
--- a/gui/gui-fluidsynth.xml
+++ b/gui/gui-fluidsynth.xml
@@ -1,11 +1,20 @@
-<table rows="3" cols="3">
+<table rows="6" cols="3">
<align attach-x="0" attach-y="0" align-x="1"><label param="master" /></align>
- <knob attach-x="1" attach-w="1" attach-y="0" shrink-x="1" param="master" />
+ <align attach-x="1" attach-w="1" attach-y="0"><knob param="master" /></align>
<value param="master" attach-x="2" attach-y="0" pad-x="10" />
<align attach-x="0" attach-y="1" align-x="1"><label param="soundfont" /></align>
<filechooser attach-x="1" attach-w="2" attach-y="1" key="soundfont" title="Select a soundfont" width_chars="30"/>
<align attach-x="0" attach-y="2" align-x="1"><label text="SF Name" /></align>
<value attach-x="1" attach-w="2" attach-y="2" key="preset_name" width="30"/>
+
+ <align attach-x="0" attach-y="3" align-x="1"><label param="interpolation" /></align>
+ <align attach-x="1" attach-y="3" attach-w="2" ><combo param="interpolation" /></align>
+ <hbox attach-x="0" attach-y="4" attach-w="3">
+ <label param="reverb" />
+ <toggle param="reverb" />
+ <label param="chorus" />
+ <toggle param="chorus" />
+ </hbox>
</table>
diff --git a/src/calf/metadata.h b/src/calf/metadata.h
index a216e31..b46522f 100644
--- a/src/calf/metadata.h
+++ b/src/calf/metadata.h
@@ -232,7 +232,7 @@ struct organ_metadata: public organ_enums, public plugin_metadata<organ_metadata
/// FluidSynth - metadata
struct fluidsynth_metadata: public plugin_metadata<fluidsynth_metadata>
{
- enum { par_master, par_soundfont, param_count };
+ enum { par_master, par_soundfont, par_interpolation, par_reverb, par_chorus, param_count };
enum { in_count = 0, out_count = 2, support_midi = true, require_midi = true, rt_capable = false };
PLUGIN_NAME_ID_LABEL("fluidsynth", "fluidsynth", "Fluidsynth")
const char **get_default_configure_vars();
diff --git a/src/fluidsynth.cpp b/src/fluidsynth.cpp
index 30d3360..45eace3 100644
--- a/src/fluidsynth.cpp
+++ b/src/fluidsynth.cpp
@@ -133,6 +133,10 @@ void fluidsynth_audio_module::update_preset_num()
uint32_t fluidsynth_audio_module::process(uint32_t offset, uint32_t nsamples, uint32_t inputs_mask, uint32_t outputs_mask)
{
+ static const int interp_lens[] = { 0, 1, 4, 7 };
+ fluid_synth_set_interp_method(synth, -1, interp_lens[dsp::clip<int>(fastf2i_drm(*params[par_interpolation]), 0, 3)]);
+ fluid_synth_set_reverb_on(synth, *params[par_reverb] > 0);
+ fluid_synth_set_chorus_on(synth, *params[par_chorus] > 0);
fluid_synth_set_gain(synth, *params[par_master]);
fluid_synth_write_float(synth, nsamples, outs[0], offset, 1, outs[1], offset, 1);
return 3;
diff --git a/src/modules.cpp b/src/modules.cpp
index 8c00a35..621bf61 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -509,6 +509,8 @@ CALF_PORT_PROPS(organ) = {
const char *fluidsynth_init_soundfont = "";
+const char *fluidsynth_interpolation_names[] = { "None (zero-hold)", "Linear", "Cubic", "7-point" };
+
CALF_PORT_NAMES(fluidsynth) = {
"Out L", "Out R",
};
@@ -518,6 +520,9 @@ CALF_PLUGIN_INFO(fluidsynth) = { 0x8700, "Fluidsynth", "Calf Fluidsynth", "Fluid
CALF_PORT_PROPS(fluidsynth) = {
{ 0.5, 0, 1, 100, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_PROP_OUTPUT_GAIN, NULL, "master", "Volume" },
{ 0, 0, 0, 0, PF_STRING | PF_PROP_MSGCONTEXT, &fluidsynth_init_soundfont, "soundfont", "Soundfont" },
+ { 2, 0, 3, 0, PF_ENUM | PF_CTL_COMBO, fluidsynth_interpolation_names, "interpolation", "Interpolation" },
+ { 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "reverb", "Enable Reverb" },
+ { 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "chorus", "Enable Chorus" },
};
////////////////////////////////////////////////////////////////////////////
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list