diff options
author | David Robillard <d@drobilla.net> | 2012-10-27 19:25:22 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-10-27 19:25:22 +0000 |
commit | 25b23d1df7083694d2a29ff585231a646f379c96 (patch) | |
tree | 22e0aca6060930ef969fbe28ceb4fd224c0dd14f | |
parent | bd8739571d2594bb2223a5e00483627e3209b55a (diff) | |
download | fomp.lv2-25b23d1df7083694d2a29ff585231a646f379c96.tar.gz fomp.lv2-25b23d1df7083694d2a29ff585231a646f379c96.tar.bz2 fomp.lv2-25b23d1df7083694d2a29ff585231a646f379c96.zip |
Convert absolute frequency ports to use Hz.
git-svn-id: http://svn.drobilla.net/lad/trunk/plugins/fomp.lv2@4805 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | fomp.lv2/cs_phaser1.ttl | 4 | ||||
-rw-r--r-- | fomp.lv2/mvchpf1.ttl | 19 | ||||
-rw-r--r-- | fomp.lv2/mvclpf1.ttl | 19 | ||||
-rw-r--r-- | fomp.lv2/mvclpf2.ttl | 19 | ||||
-rw-r--r-- | fomp.lv2/mvclpf3.ttl | 19 | ||||
-rw-r--r-- | fomp.lv2/mvclpf4.ttl | 19 | ||||
-rw-r--r-- | fomp.lv2/pulse_vco.ttl | 11 | ||||
-rw-r--r-- | fomp.lv2/rec_vco.ttl | 11 | ||||
-rw-r--r-- | fomp.lv2/saw_vco.ttl | 11 | ||||
-rw-r--r-- | src/blvco.cc | 8 | ||||
-rw-r--r-- | src/mvchpf24.cc | 5 | ||||
-rw-r--r-- | src/mvclpf24.cc | 11 |
12 files changed, 100 insertions, 56 deletions
diff --git a/fomp.lv2/cs_phaser1.ttl b/fomp.lv2/cs_phaser1.ttl index 196d5b2..f0bcf17 100644 --- a/fomp.lv2/cs_phaser1.ttl +++ b/fomp.lv2/cs_phaser1.ttl @@ -46,8 +46,8 @@ fomp:phaser1 a lv2:CVPort , lv2:InputPort ; lv2:index 2 ; - lv2:name "Frequency Mod" ; - lv2:symbol "freq_mod" + lv2:name "FM" ; + lv2:symbol "fm" ] , [ a lv2:CVPort , lv2:InputPort ; diff --git a/fomp.lv2/mvchpf1.ttl b/fomp.lv2/mvchpf1.ttl index 46ca616..b4a2b13 100644 --- a/fomp.lv2/mvchpf1.ttl +++ b/fomp.lv2/mvchpf1.ttl @@ -28,15 +28,16 @@ fomp:mvchpf1 a lv2:CVPort , lv2:InputPort ; lv2:index 2 ; - lv2:name "Frequency Mod" ; - lv2:symbol "freq_mod" ; + lv2:name "FM" ; + lv2:symbol "fm" ; units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; lv2:index 3 ; - lv2:name "Exp. FM" ; - lv2:symbol "exp_fm" + lv2:name "Exp FM" ; + lv2:symbol "exp_fm" ; + units:unit units:oct ] , [ a lv2:ControlPort , lv2:InputPort ; @@ -50,13 +51,15 @@ fomp:mvchpf1 ] , [ a lv2:ControlPort , lv2:InputPort ; - lv2:default 0.0 ; + lv2:default 440.0 ; lv2:index 5 ; - lv2:maximum 6.0 ; - lv2:minimum -6.0 ; + lv2:maximum 1.0 ; + lv2:minimum 0.000001 ; lv2:name "Frequency" ; + lv2:portProperty <http://lv2plug.in/ns/ext/port-props#logarithmic> , + lv2:sampleRate ; lv2:symbol "freq" ; - units:unit units:oct + units:unit units:hz ] , [ a lv2:ControlPort , lv2:InputPort ; diff --git a/fomp.lv2/mvclpf1.ttl b/fomp.lv2/mvclpf1.ttl index 06c52d8..25d92fe 100644 --- a/fomp.lv2/mvclpf1.ttl +++ b/fomp.lv2/mvclpf1.ttl @@ -28,15 +28,16 @@ fomp:mvclpf1 a lv2:CVPort , lv2:InputPort ; lv2:index 2 ; - lv2:name "Frequency Mod" ; - lv2:symbol "freq_mod" ; + lv2:name "FM" ; + lv2:symbol "fm" ; units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; lv2:index 3 ; - lv2:name "Exp. Frequency Mod" ; - lv2:symbol "exp_fm" + lv2:name "Exp FM" ; + lv2:symbol "exp_fm" ; + units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; @@ -56,13 +57,15 @@ fomp:mvclpf1 ] , [ a lv2:ControlPort , lv2:InputPort ; - lv2:default 0.0 ; + lv2:default 440.0 ; lv2:index 6 ; - lv2:maximum 6.0 ; - lv2:minimum -6.0 ; + lv2:maximum 1.0 ; + lv2:minimum 0.000001 ; lv2:name "Frequency" ; + lv2:portProperty <http://lv2plug.in/ns/ext/port-props#logarithmic> , + lv2:sampleRate ; lv2:symbol "freq" ; - units:unit units:oct + units:unit units:hz ] , [ a lv2:ControlPort , lv2:InputPort ; diff --git a/fomp.lv2/mvclpf2.ttl b/fomp.lv2/mvclpf2.ttl index 0f09f44..a7f5ff0 100644 --- a/fomp.lv2/mvclpf2.ttl +++ b/fomp.lv2/mvclpf2.ttl @@ -28,15 +28,16 @@ fomp:mvclpf2 a lv2:CVPort , lv2:InputPort ; lv2:index 2 ; - lv2:name "Frequency Mod" ; - lv2:symbol "freq_mod" ; + lv2:name "FM" ; + lv2:symbol "fm" ; units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; lv2:index 3 ; - lv2:name "Exp. Frequency Mod" ; - lv2:symbol "exp_fm" + lv2:name "Exp FM" ; + lv2:symbol "exp_fm" ; + units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; @@ -56,13 +57,15 @@ fomp:mvclpf2 ] , [ a lv2:ControlPort , lv2:InputPort ; - lv2:default 0.0 ; + lv2:default 440.0 ; lv2:index 6 ; - lv2:maximum 6.0 ; - lv2:minimum -6.0 ; + lv2:maximum 1.0 ; + lv2:minimum 0.000001 ; lv2:name "Frequency" ; + lv2:portProperty <http://lv2plug.in/ns/ext/port-props#logarithmic> , + lv2:sampleRate ; lv2:symbol "freq" ; - units:unit units:oct + units:unit units:hz ] , [ a lv2:ControlPort , lv2:InputPort ; diff --git a/fomp.lv2/mvclpf3.ttl b/fomp.lv2/mvclpf3.ttl index 627f8dc..9d6ff60 100644 --- a/fomp.lv2/mvclpf3.ttl +++ b/fomp.lv2/mvclpf3.ttl @@ -28,15 +28,16 @@ fomp:mvclpf3 a lv2:CVPort , lv2:InputPort ; lv2:index 2 ; - lv2:name "Frequency Mod" ; - lv2:symbol "freq_mod" ; + lv2:name "FM" ; + lv2:symbol "fm" ; units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; lv2:index 3 ; - lv2:name "Exp. Frequency Mod" ; - lv2:symbol "exp_fm" + lv2:name "Exp FM" ; + lv2:symbol "exp_fm" ; + units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; @@ -56,13 +57,15 @@ fomp:mvclpf3 ] , [ a lv2:ControlPort , lv2:InputPort ; - lv2:default 0.0 ; + lv2:default 440.0 ; lv2:index 6 ; - lv2:maximum 6.0 ; - lv2:minimum -6.0 ; + lv2:maximum 1.0 ; + lv2:minimum 0.000001 ; lv2:name "Frequency" ; + lv2:portProperty <http://lv2plug.in/ns/ext/port-props#logarithmic> , + lv2:sampleRate ; lv2:symbol "freq" ; - units:unit units:oct + units:unit units:hz ] , [ a lv2:ControlPort , lv2:InputPort ; diff --git a/fomp.lv2/mvclpf4.ttl b/fomp.lv2/mvclpf4.ttl index 3745847..e1bcc00 100644 --- a/fomp.lv2/mvclpf4.ttl +++ b/fomp.lv2/mvclpf4.ttl @@ -29,16 +29,17 @@ fomp:mvclpf4 lv2:InputPort ; lv2:default 0.0 ; lv2:index 2 ; - lv2:name "Frequency" ; - lv2:symbol "freq" ; + lv2:name "FM" ; + lv2:symbol "fm" ; units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; lv2:default 0.0 ; lv2:index 3 ; - lv2:name "Exp. FM" ; - lv2:symbol "exp_fm" + lv2:name "Exp FM" ; + lv2:symbol "exp_fm" ; + units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; @@ -59,13 +60,15 @@ fomp:mvclpf4 ] , [ a lv2:ControlPort , lv2:InputPort ; - lv2:default 0.0 ; + lv2:default 440.0 ; lv2:index 6 ; - lv2:maximum 6.0 ; - lv2:minimum -6.0 ; + lv2:maximum 1.0 ; + lv2:minimum 0.000001 ; lv2:name "Frequency" ; + lv2:portProperty <http://lv2plug.in/ns/ext/port-props#logarithmic> , + lv2:sampleRate ; lv2:symbol "freq" ; - units:unit units:oct + units:unit units:hz ] , [ a lv2:ControlPort , lv2:InputPort ; diff --git a/fomp.lv2/pulse_vco.ttl b/fomp.lv2/pulse_vco.ttl index c1a2048..15c634f 100644 --- a/fomp.lv2/pulse_vco.ttl +++ b/fomp.lv2/pulse_vco.ttl @@ -22,15 +22,22 @@ fomp:pulse_vco ] , [ a lv2:CVPort , lv2:InputPort ; + lv2:default 440.0 ; lv2:index 1 ; + lv2:maximum 1.0 ; + lv2:minimum 0.000001 ; lv2:name "Frequency" ; - lv2:symbol "freq" + lv2:portProperty <http://lv2plug.in/ns/ext/port-props#logarithmic> , + lv2:sampleRate ; + lv2:symbol "freq" ; + units:unit units:hz ] , [ a lv2:CVPort , lv2:InputPort ; lv2:index 2 ; lv2:name "Exp FM" ; - lv2:symbol "exp_fm" + lv2:symbol "exp_fm" ; + units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; diff --git a/fomp.lv2/rec_vco.ttl b/fomp.lv2/rec_vco.ttl index 54b8679..2d99e11 100644 --- a/fomp.lv2/rec_vco.ttl +++ b/fomp.lv2/rec_vco.ttl @@ -21,9 +21,15 @@ fomp:rec_vco ] , [ a lv2:CVPort , lv2:InputPort ; + lv2:default 440.0 ; lv2:index 1 ; + lv2:maximum 1.0 ; + lv2:minimum 0.000001 ; lv2:name "Frequency" ; - lv2:symbol "freq" + lv2:portProperty <http://lv2plug.in/ns/ext/port-props#logarithmic> , + lv2:sampleRate ; + lv2:symbol "freq" ; + units:unit units:hz ] , [ a lv2:ControlPort , lv2:InputPort ; @@ -56,7 +62,8 @@ fomp:rec_vco lv2:InputPort ; lv2:index 2 ; lv2:name "Exp FM" ; - lv2:symbol "exp_fm" + lv2:symbol "exp_fm" ; + units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; diff --git a/fomp.lv2/saw_vco.ttl b/fomp.lv2/saw_vco.ttl index 05d24a7..7fbde9b 100644 --- a/fomp.lv2/saw_vco.ttl +++ b/fomp.lv2/saw_vco.ttl @@ -21,15 +21,22 @@ fomp:saw_vco ] , [ a lv2:CVPort , lv2:InputPort ; + lv2:default 440.0 ; lv2:index 1 ; + lv2:maximum 1.0 ; + lv2:minimum 0.000001 ; lv2:name "Frequency" ; - lv2:symbol "freq" + lv2:portProperty <http://lv2plug.in/ns/ext/port-props#logarithmic> , + lv2:sampleRate ; + lv2:symbol "freq" ; + units:unit units:hz ] , [ a lv2:CVPort , lv2:InputPort ; lv2:index 2 ; lv2:name "Exp FM" ; - lv2:symbol "exp_fm" + lv2:symbol "exp_fm" ; + units:unit units:oct ] , [ a lv2:CVPort , lv2:InputPort ; diff --git a/src/blvco.cc b/src/blvco.cc index 8f1c65c..328f4b0 100644 --- a/src/blvco.cc +++ b/src/blvco.cc @@ -44,6 +44,8 @@ static float _pulse [] = }; +static const float lg2midc = log2f(261.63f); + void Ladspa_VCO_pulse1::setport (PortIndex port, PortData *data) { @@ -86,7 +88,7 @@ void Ladspa_VCO_pulse1::runproc (SampleCount len, bool add) linm += n; len -= n; - t = (exp2ap (*freq + _port[OCTN][0] + _port[TUNE][0] + *expm * _port[EXPG][0] + 8.03136) + t = (exp2ap (log2f(*freq) - lg2midc + _port[OCTN][0] + _port[TUNE][0] + *expm * _port[EXPG][0] + 8.03136) + 1e3 * *linm * _port[LING][0]) / _fsam; if (t < 1e-5) t = 1e-5; if (t > 0.5) t = 0.5; @@ -176,7 +178,7 @@ void Ladspa_VCO_saw1::runproc (SampleCount len, bool add) linm += n; len -= n; - t = (exp2ap (*freq + _port[OCTN][0] + _port[TUNE][0] + *expm * _port[EXPG][0] + 8.03136 + d) + t = (exp2ap (log2f(*freq) - lg2midc + _port[OCTN][0] + _port[TUNE][0] + *expm * _port[EXPG][0] + 8.03136 + d) + 1e3 * *linm * _port[LING][0]) / _fsam; if (t < 1e-5) t = 1e-5; if (t > 0.5) t = 0.5; @@ -276,7 +278,7 @@ void Ladspa_VCO_rec1::runproc (SampleCount len, bool add) wavm += n; len -= n; - t = (exp2ap (*freq + _port[OCTN][0] + _port[TUNE][0] + *expm * _port[EXPG][0] + 8.03136 + d) + t = (exp2ap (log2f(*freq) - lg2midc + _port[OCTN][0] + _port[TUNE][0] + *expm * _port[EXPG][0] + 8.03136 + d) + 1e3 * *linm * _port[LING][0]) / _fsam; if (t < 1e-5) t = 1e-5; if (t > 0.5) t = 0.5; diff --git a/src/mvchpf24.cc b/src/mvchpf24.cc index d63155b..96d3097 100644 --- a/src/mvchpf24.cc +++ b/src/mvchpf24.cc @@ -23,6 +23,9 @@ #include "exp2ap.h" +static const float lg2midc = log2f(261.63f); + + void Ladspa_Mvchpf1::setport (PortIndex port, PortData *data) { _port [port] = (float*)data; @@ -65,7 +68,7 @@ void Ladspa_Mvchpf1::runproc (SampleCount len, bool add) p3 += k; len -= k; - t = _fsam / exp2ap (_port [CFMOD][0] * *p3 + *p2 + _port [CFREQ][0] + 9.2f); + t = _fsam / exp2ap (_port [CFMOD][0] * *p3 + *p2 + log2f(_port [CFREQ][0]) - lg2midc + 9.2f); if (t < 2) t = 2; dw = (t - w) / k; diff --git a/src/mvclpf24.cc b/src/mvclpf24.cc index ae0a287..357fd7c 100644 --- a/src/mvclpf24.cc +++ b/src/mvclpf24.cc @@ -23,6 +23,9 @@ #include "exp2ap.h" +static const float lg2midc = log2f(261.63f); + + void Ladspa_Moogvcf1::setport (PortIndex port, PortData *data) { _port [port] = (float*)data; @@ -67,7 +70,7 @@ void Ladspa_Moogvcf1::runproc (SampleCount len, bool add) p4 += k; len -= k; - t = exp2ap (_port [C_FMODG][0] * *p3 + _port [C_FREQ][0] + *p2 + 10.82f) / _fsam; + t = exp2ap (_port [C_FMODG][0] * *p3 + log2f(_port [C_FREQ][0]) - lg2midc + *p2 + 10.82f) / _fsam; if (t < 0.8f) t *= 1 - 0.4f * t - 0.125f * t * t; else { @@ -154,7 +157,7 @@ void Ladspa_Moogvcf2::runproc (SampleCount len, bool add) p4 += k; len -= k; - t = exp2ap (_port [C_FMODG][0] * *p3 + _port [C_FREQ][0] + *p2 + 10.71f) / _fsam; + t = exp2ap (_port [C_FMODG][0] * *p3 + log2f(_port [C_FREQ][0]) - lg2midc + *p2 + 10.71f) / _fsam; if (t < 0.8f) t *= 1 - 0.4f * t - 0.125f * t * t; else { @@ -243,7 +246,7 @@ void Ladspa_Moogvcf3::runproc (SampleCount len, bool add) p4 += k; len -= k; - t = exp2ap (_port [C_FMODG][0] * *p3 + _port [C_FREQ][0] + *p2 + 9.70f) / _fsam; + t = exp2ap (_port [C_FMODG][0] * *p3 + log2f(_port [C_FREQ][0]) - lg2midc + *p2 + 9.70f) / _fsam; if (t < 0.75f) t *= 1.005f - t * (0.624f - t * (0.65f - t * 0.54f)); else { @@ -357,7 +360,7 @@ void Ladspa_Moogvcf4::runproc (SampleCount len, bool add) p4 += k; len -= k; - t = exp2ap (_port [C_FMODG][0] * *p3 + _port [C_FREQ][0] + *p2 + 9.70f) / _fsam; + t = exp2ap (_port [C_FMODG][0] * *p3 + log2f(_port [C_FREQ][0]) - lg2midc + *p2 + 9.70f) / _fsam; if (t < 0.75f) t *= 1.005f - t * (0.624f - t * (0.65f - t * 0.54f)); else { |