AnalogTapeModel

Physical modelling signal processing for analog tape recording
Log | Files | Refs | Submodules | README | LICENSE

commit e88c28c4edeabae5cbbb4b0fdf6d67fd3bdf3674
parent 48675dda6ab2288c9dcfe8caf2b60bb5b3ad1e57
Author: jatinchowdhury18 <[email protected]>
Date:   Mon,  8 Jun 2020 12:30:52 -0700

Bug fixing (#41)

* Bug fixes in loss filter and flutter/wow

* Adjust presets

Co-authored-by: jatinchowdhury18 <[email protected]>
Diffstat:
MPlugin/Source/Presets/LoFi.xml | 2+-
MPlugin/Source/Presets/TC260.xml | 2+-
MPlugin/Source/Processors/Loss_Effects/LossFilter.h | 17+++++++++++------
MPlugin/Source/Processors/Timing_Effects/Flutter.cpp | 4++--
MREADME.md | 14+++++++++++---
5 files changed, 26 insertions(+), 13 deletions(-)

diff --git a/Plugin/Source/Presets/LoFi.xml b/Plugin/Source/Presets/LoFi.xml @@ -13,7 +13,7 @@ <PARAM id="gap" value="9.999999974752427e-7"/> <PARAM id="ingain" value="0.0"/> <PARAM id="os" value="1.0"/> - <PARAM id="outgain" value="0.0"/> + <PARAM id="outgain" value="-3.5"/> <PARAM id="rate" value="0.2999999821186066"/> <PARAM id="sat" value="1.0"/> <PARAM id="spacing" value="0.002999998396262527"/> diff --git a/Plugin/Source/Presets/TC260.xml b/Plugin/Source/Presets/TC260.xml @@ -13,7 +13,7 @@ <PARAM id="gap" value="1.614829443497001e-6"/> <PARAM id="ingain" value="0.0"/> <PARAM id="os" value="1.0"/> - <PARAM id="outgain" value="0.0"/> + <PARAM id="outgain" value="-2.0"/> <PARAM id="rate" value="0.199999988079071"/> <PARAM id="sat" value="0.75"/> <PARAM id="spacing" value="0.0002769171842373908"/> diff --git a/Plugin/Source/Processors/Loss_Effects/LossFilter.h b/Plugin/Source/Processors/Loss_Effects/LossFilter.h @@ -44,7 +44,7 @@ public: void prepare (float sampleRate, int samplesPerBlock) { fs = sampleRate; - fadeBuffer.resize (samplesPerBlock); + fadeBuffer.setSize (1, samplesPerBlock); fsFactor = (float) fs / 44100.0f; const int curOrder = int (order * fsFactor); @@ -121,10 +121,14 @@ public: } if (fadeCount > 0) - for (int n = 0; n < numSamples; ++n) - fadeBuffer.setUnchecked (n, buffer[n]); + { + fadeBuffer.setSize (1, numSamples, false, false, true); + fadeBuffer.copyFrom (0, 0, buffer, numSamples); + } else + { filters[! activeFilter]->processBypassed (buffer, numSamples); + } if (! starting) filters[activeFilter]->process (buffer, numSamples); @@ -136,12 +140,13 @@ public: if (fadeCount > 0) { - filters[! activeFilter]->process (fadeBuffer.getRawDataPointer(), numSamples); + auto* fadePtr = fadeBuffer.getWritePointer (0); + filters[! activeFilter]->process (fadePtr, numSamples); for (int n = 0; n < numSamples; ++n) { float mult = (float) fadeCount / (float) fadeLength; - buffer[n] = buffer[n] * mult + fadeBuffer[n] * (1.0f - mult); + buffer[n] = buffer[n] * mult + fadePtr[n] * (1.0f - mult); fadeCount--; if (fadeCount == 0) @@ -158,7 +163,7 @@ private: int activeFilter = 0; int fadeCount = 0; const int fadeLength = 512; - Array<float> fadeBuffer; + AudioBuffer<float> fadeBuffer; bool starting = false; std::atomic<float>* speed = nullptr; diff --git a/Plugin/Source/Processors/Timing_Effects/Flutter.cpp b/Plugin/Source/Processors/Timing_Effects/Flutter.cpp @@ -67,11 +67,11 @@ void Flutter::processBlock (AudioBuffer<float>& buffer, MidiBuffer& /*midiMessag { ScopedNoDenormals noDenormals; - auto curDepthWow = powf (*wowDepth, 0.5f); + auto curDepthWow = powf (*wowDepth, 3.0f); depthSlewWow[0].setTargetValue (jmax (depthSlewMin, curDepthWow)); depthSlewWow[1].setTargetValue (jmax (depthSlewMin, curDepthWow)); - auto curDepthFlutter = powf (*flutterDepth * 81.0f / 625.0f, 0.5f); + auto curDepthFlutter = powf (powf (*flutterDepth, 3.0f) * 81.0f / 625.0f, 0.5f); depthSlewFlutter[0].setTargetValue (jmax (depthSlewMin, curDepthFlutter)); depthSlewFlutter[1].setTargetValue (jmax (depthSlewMin, curDepthFlutter)); diff --git a/README.md b/README.md @@ -9,8 +9,7 @@ implemented as an audio plugin. The physical model is described in a [paper](http://dafx2019.bcu.ac.uk/papers/DAFx2019_paper_3.pdf) presented at the 2019 DAFx conference. This work began part of a class project for [Music 420](https://ccrma.stanford.edu/courses/420/) -at Stanford University (CCRMA). Download the latest release -[here](https://github.com/jatinchowdhury18/AnalogTapeModel/releases/latest). +at Stanford University (CCRMA). ## Definition **magnetic tape** noun<br/> @@ -32,11 +31,20 @@ CHOW Tape is currently available in the following formats: - AU - Standalone plugin -## Instructions For Building +## Installation + +Download the latest release +[here](https://github.com/jatinchowdhury18/AnalogTapeModel/releases/latest). If you would like to try the most recent builds (potentially unstable), see [here](https://github.com/jatinchowdhury18/AnalogTapeModel/tree/master/Plugin/Bin). If you need a build that is compatible with Mac OS Catalina, try [this link](https://www.dropbox.com/s/n14b1ju8kofp71v/CHOWTape.zip). + +Note for FL Studio users: If you're experiencing pops and click while using +the plugin, try enabling the "used fixed size buffers" setting. For more +information, see this [issue](https://github.com/jatinchowdhury18/AnalogTapeModel/issues/17#issuecomment-640199581). + +### Instructions For Building If you would like to build CHOW for yourself, use the following steps. - Install [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)