From 3bb3d4ef1df1aa773e6acf5e3aa6b171464f1e32 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 15 Jul 2020 00:43:16 -0400 Subject: [PATCH 1/4] Make VCF more accurate and stable by using a linear interpolation of the previous and current input values in `LadderFilter::process()`. Thanks Andy Simpler! --- src/VCF.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/VCF.cpp b/src/VCF.cpp index 2935dff..61b9422 100644 --- a/src/VCF.cpp +++ b/src/VCF.cpp @@ -37,7 +37,8 @@ struct LadderFilter { void process(T input, T dt) { dsp::stepRK4(T(0), dt, state, 4, [&](T t, const T x[], T dxdt[]) { - T inputc = clip(input - resonance * x[3]); + T inputt = crossfade(this->input, input, t / dt); + T inputc = clip(inputt - resonance * x[3]); T yc0 = clip(x[0]); T yc1 = clip(x[1]); T yc2 = clip(x[2]); From 53ca5fefc35eb02e788af05386b976012b1639f6 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 15 Jul 2020 00:45:56 -0400 Subject: [PATCH 2/4] Add manualUrls to all modules, linking to specific parts of the manual. --- plugin.json | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/plugin.json b/plugin.json index d37c218..46bf143 100644 --- a/plugin.json +++ b/plugin.json @@ -16,6 +16,7 @@ "slug": "VCO", "name": "VCO-1", "description": "Voltage-controlled oscillator", + "manualUrl": "https://vcvrack.com/Fundamental#VCO", "tags": [ "VCO", "Polyphonic" @@ -24,7 +25,8 @@ { "slug": "VCO2", "name": "VCO-2", - "description": "Voltage-controlled oscillator", + "description": "Voltage-controlled oscillator with output morphing", + "manualUrl": "https://vcvrack.com/Fundamental#VCO", "tags": [ "VCO", "Polyphonic" @@ -34,6 +36,7 @@ "slug": "VCF", "name": "VCF", "description": "Voltage-controlled filter", + "manualUrl": "https://vcvrack.com/Fundamental#VCF", "tags": [ "VCF", "Polyphonic" @@ -43,6 +46,7 @@ "slug": "VCA-1", "name": "VCA-1", "description": "Voltage-controlled amplifier", + "manualUrl": "https://vcvrack.com/Fundamental#VCA", "tags": [ "VCA", "Polyphonic" @@ -51,7 +55,8 @@ { "slug": "VCA", "name": "VCA-2", - "description": "Voltage-controlled amplifier", + "description": "2-channel voltage-controlled amplifier", + "manualUrl": "https://vcvrack.com/Fundamental#VCA", "tags": [ "VCA", "Dual", @@ -62,6 +67,7 @@ "slug": "LFO", "name": "LFO-1", "description": "Low-frequency oscillator", + "manualUrl": "https://vcvrack.com/Fundamental#LFO", "tags": [ "LFO", "Polyphonic" @@ -71,6 +77,7 @@ "slug": "LFO2", "name": "LFO-2", "description": "Low-frequency oscillator", + "manualUrl": "https://vcvrack.com/Fundamental#LFO", "tags": [ "LFO", "Polyphonic" @@ -80,6 +87,7 @@ "slug": "Delay", "name": "Delay", "description": "", + "manualUrl": "https://vcvrack.com/Fundamental#Delay", "tags": [ "Delay" ] @@ -88,6 +96,7 @@ "slug": "ADSR", "name": "ADSR", "description": "Generates an envelope with Attack/Decay/Sustain/Release", + "manualUrl": "https://vcvrack.com/Fundamental#ADSR", "tags": [ "Envelope Generator", "Polyphonic" @@ -97,6 +106,7 @@ "slug": "VCMixer", "name": "Mixer", "description": "Mixes 4 signals with built-in VCAs", + "manualUrl": "https://vcvrack.com/Fundamental#VCMixer", "tags": [ "Mixer", "VCA", @@ -107,6 +117,7 @@ "slug": "8vert", "name": "8vert", "description": "Attenuverts 8 signals or creates constant voltages", + "manualUrl": "https://vcvrack.com/Fundamental#8vert", "tags": [ "Attenuator", "Polyphonic" @@ -116,6 +127,7 @@ "slug": "Unity", "name": "Unity", "description": "Mixes or averages signals with unity gain", + "manualUrl": "https://vcvrack.com/Fundamental#Unity", "tags": [ "Mixer", "Utility", @@ -126,6 +138,7 @@ "slug": "Mutes", "name": "Mutes", "description": "Toggles up to 10 signals", + "manualUrl": "https://vcvrack.com/Fundamental#Mutes", "tags": [ "Switch", "Polyphonic" @@ -135,6 +148,7 @@ "slug": "Pulses", "name": "Pulses", "description": "Generates up to 10 trigger and gate signals", + "manualUrl": "https://vcvrack.com/Fundamental#Pulses", "tags": [ "Switch" ] @@ -143,6 +157,7 @@ "slug": "Scope", "name": "Scope", "description": "Inspect waveforms with an oscilloscope", + "manualUrl": "https://vcvrack.com/Fundamental#Scope", "tags": [ "Visual", "Polyphonic" @@ -152,6 +167,7 @@ "slug": "SEQ3", "name": "SEQ-3", "description": "3-channel 8-step sequencer also with gate outputs", + "manualUrl": "https://vcvrack.com/Fundamental#SEQ-3", "tags": [ "Sequencer" ] @@ -160,6 +176,7 @@ "slug": "SequentialSwitch1", "name": "Sequential Switch 1", "description": "Routes an input to one of to 4 outputs", + "manualUrl": "https://vcvrack.com/Fundamental#SequentialSwitch", "tags": [ "Utility", "Polyphonic" @@ -169,6 +186,7 @@ "slug": "SequentialSwitch2", "name": "Sequential Switch 2", "description": "Routes one of to 4 inputs to an output", + "manualUrl": "https://vcvrack.com/Fundamental#SequentialSwitch", "tags": [ "Utility", "Polyphonic" @@ -178,6 +196,7 @@ "slug": "Octave", "name": "Octave", "description": "Shifts 1V/oct CV by octaves", + "manualUrl": "https://vcvrack.com/Fundamental#Octave", "tags": [ "Utility", "Polyphonic" @@ -187,6 +206,7 @@ "slug": "Quantizer", "name": "Quantizer", "description": "12-note quantizer and scale selector", + "manualUrl": "https://vcvrack.com/Fundamental#Quantizer", "tags": [ "Quantizer", "Polyphonic" @@ -196,6 +216,7 @@ "slug": "Split", "name": "Split", "description": "Splits a polyphonic cable into multiple monophonic cables", + "manualUrl": "https://vcvrack.com/Fundamental#Split", "tags": [ "Polyphonic", "Utility" @@ -205,6 +226,7 @@ "slug": "Merge", "name": "Merge", "description": "Combines multiple monophonic cables into a polyphonic cable", + "manualUrl": "https://vcvrack.com/Fundamental#Split", "tags": [ "Polyphonic", "Utility" @@ -214,6 +236,7 @@ "slug": "Sum", "name": "Sum", "description": "Sums all channels in a polyphonic cable", + "manualUrl": "https://vcvrack.com/Fundamental#Sum", "tags": [ "Polyphonic", "Utility" @@ -223,6 +246,7 @@ "slug": "Viz", "name": "Viz", "description": "Visualizes all channels of a polyphonic cable", + "manualUrl": "https://vcvrack.com/Fundamental#Viz", "tags": [ "Polyphonic", "Visual" @@ -232,6 +256,7 @@ "slug": "MidSide", "name": "Mid/Side", "description": "Mid/side stereo encoder/decoder", + "manualUrl": "https://vcvrack.com/Fundamental#MidSide", "tags": [ "Utility", "Polyphonic" @@ -241,6 +266,7 @@ "slug": "Noise", "name": "Noise", "description": "Multicolored noise generator", + "manualUrl": "https://vcvrack.com/Fundamental#Noise", "tags": [ "Noise" ] @@ -249,6 +275,7 @@ "slug": "Random", "name": "Random", "description": "Random CV generator", + "manualUrl": "https://vcvrack.com/Fundamental#Random", "tags": [ "Random", "Sample and hold" From 57545c49ab765f3f8bb7f03797213546ed734ef5 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Wed, 15 Jul 2020 00:51:52 -0400 Subject: [PATCH 3/4] Fix indentation. --- src/Noise.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/Noise.cpp b/src/Noise.cpp index a19213c..5d1172b 100644 --- a/src/Noise.cpp +++ b/src/Noise.cpp @@ -6,25 +6,25 @@ http://www.firstpr.com.au/dsp/pink-noise/ */ template struct PinkNoiseGenerator { - int frame = -1; - float values[QUALITY] = {}; - - float process() { - int lastFrame = frame; - frame++; - if (frame >= (1 << QUALITY)) - frame = 0; - int diff = lastFrame ^ frame; - - float sum = 0.f; - for (int i = 0; i < QUALITY; i++) { - if (diff & (1 << i)) { - values[i] = random::uniform() - 0.5f; - } - sum += values[i]; - } - return sum; - } + int frame = -1; + float values[QUALITY] = {}; + + float process() { + int lastFrame = frame; + frame++; + if (frame >= (1 << QUALITY)) + frame = 0; + int diff = lastFrame ^ frame; + + float sum = 0.f; + for (int i = 0; i < QUALITY; i++) { + if (diff & (1 << i)) { + values[i] = random::uniform() - 0.5f; + } + sum += values[i]; + } + return sum; + } }; From 5799ee2a9b21492b42ebcb9b65d5395ef5c1cbe2 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 24 Aug 2020 09:40:08 -0400 Subject: [PATCH 4/4] Update changelog. --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8578aab..eb1e693 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 1.4.1 (in development) +- Improve VCF model accuracy and stability. + ### 1.4.0 (2019-11-08) - Add Pulses.