[SCM] calf/master: + MultiChorus: make number of voices adjustable, make default settings even more in-your-face
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:37:49 UTC 2013
The following commit has been merged in the master branch:
commit ba54776692bfe7e542b3afabd0bce8d86efff88a
Author: Krzysztof Foltman <wdev at foltman.com>
Date: Tue Oct 28 21:22:44 2008 +0000
+ MultiChorus: make number of voices adjustable, make default settings even more in-your-face
diff --git a/src/calf/modules.h b/src/calf/modules.h
index 9f47cad..85c4081 100644
--- a/src/calf/modules.h
+++ b/src/calf/modules.h
@@ -781,14 +781,14 @@ public:
class multichorus_audio_module: public null_audio_module
{
public:
- enum { par_delay, par_depth, par_rate, par_stereo, par_vphase, par_amount, param_count };
+ enum { par_delay, par_depth, par_rate, par_stereo, par_voices, par_vphase, par_amount, param_count };
enum { in_count = 2, out_count = 2, rt_capable = true, support_midi = false };
float *ins[in_count];
float *outs[out_count];
float *params[param_count];
static const char *port_names[];
uint32_t srate;
- dsp::multichorus<float, sine_multi_lfo<float, 6>, 4096> left, right;
+ dsp::multichorus<float, sine_multi_lfo<float, 8>, 4096> left, right;
float last_r_phase;
static parameter_properties param_props[];
@@ -811,6 +811,8 @@ public:
left.set_rate(rate); right.set_rate(rate);
left.set_min_delay(min_delay); right.set_min_delay(min_delay);
left.set_mod_depth(mod_depth); right.set_mod_depth(mod_depth);
+ int voices = (int)*params[par_voices];
+ left.lfo.set_voices(voices); right.lfo.set_voices(voices);
float vphase = *params[par_vphase] * (1.f / 360.f);
left.lfo.vphase = right.lfo.vphase = vphase * 4096;
float r_phase = *params[par_stereo] * (1.f / 360.f);
diff --git a/src/calf/multichorus.h b/src/calf/multichorus.h
index 9c65199..49ee54e 100644
--- a/src/calf/multichorus.h
+++ b/src/calf/multichorus.h
@@ -40,15 +40,25 @@ public:
chorus_phase dphase;
/// LFO phase per-voice increment
chorus_phase vphase;
-
+ /// Current number of voices
+ uint32_t voices;
+ /// Current scale (output multiplier)
+ T scale;
public:
sine_multi_lfo()
{
phase = dphase = vphase = 0.0;
+ set_voices(Voices);
}
inline uint32_t get_voices() const
{
- return Voices;
+ return voices;
+ }
+ inline void set_voices(uint32_t value)
+ {
+ voices = value;
+ // use sqrt, because some phases will cancel each other - so 1 / N is usually too low
+ scale = sqrt(1.0 / voices);
}
/// Get LFO value for given voice, returns a values in range of [-65536, 65535] (or close)
inline int get_value(uint32_t voice) {
@@ -65,8 +75,7 @@ public:
phase += dphase;
}
inline T get_scale() const {
- // use sqrt, because some phases will cancel each other - so 1 / N is usually too low
- return sqrt(1.0 / Voices);
+ return scale;
}
void reset() {
phase = 0.f;
diff --git a/src/modules.cpp b/src/modules.cpp
index 9b4d752..f9f307f 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -166,12 +166,13 @@ synth::ladspa_plugin_info monosynth_audio_module::plugin_info = { 0x8480, "Monos
const char *multichorus_audio_module::port_names[] = {"In L", "In R", "Out L", "Out R"};
parameter_properties multichorus_audio_module::param_props[] = {
- { 0.1, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "min_delay", "Minimum delay" },
- { 3, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "mod_depth", "Modulation depth" },
- { 0.25, 0.01, 20, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "mod_rate", "Modulation rate" },
- { 180, 0, 360, 9, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_DEG, NULL, "stereo", "Stereo phase" },
- { 32, 0, 360, 91, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_DEG, NULL, "vphase", "Inter-voice phase" },
- { 1, 0, 2, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "amount", "Amount" },
+ { 5, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "min_delay", "Minimum delay" },
+ { 6, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "mod_depth", "Modulation depth" },
+ { 0.5, 0.01, 20, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "mod_rate", "Modulation rate" },
+ { 180, 0, 360, 91, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_DEG, NULL, "stereo", "Stereo phase" },
+ { 4, 1, 8, 8, PF_INT | PF_SCALE_LINEAR | PF_CTL_FADER, NULL, "voices", "Voices"},
+ { 64, 0, 360, 91, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_DEG, NULL, "vphase", "Inter-voice phase" },
+ { 2, 0, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "amount", "Amount" },
};
synth::ladspa_plugin_info multichorus_audio_module::plugin_info = { 0x8501, "MultiChorus", "Calf MultiChorus", "Krzysztof Foltman", synth::calf_copyright_info, "ChorusPlugin" };
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list