AnalogTapeModel

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

commit 81a59f727378aa1de604e9a27d575bc1bf9836bc
parent 4726aa34a9db4934b8b917e221a91146dfda058c
Author: jatinchowdhury18 <[email protected]>
Date:   Mon, 17 Aug 2020 13:31:37 -0700

Vst3 load bug (#71)

* Don't access parameter handles in hysteresis prepareToPlay

* New Mac builds

* Zip Mac builds [ci skip]

* Hysteresis: track oversampling param with member variable

* Fix dumb error

* Updated Mac builds

* Reset Travis

Co-authored-by: jatinchowdhury18 <[email protected]>
Co-authored-by: Travis CI <[email protected]>
Diffstat:
MPlugin/Source/Processors/Hysteresis/HysteresisProcessor.cpp | 17+++++++++--------
MPlugin/Source/Processors/Hysteresis/HysteresisProcessor.h | 2+-
Amac_builds.sh | 15+++++++++++++++
3 files changed, 25 insertions(+), 9 deletions(-)

diff --git a/Plugin/Source/Processors/Hysteresis/HysteresisProcessor.cpp b/Plugin/Source/Processors/Hysteresis/HysteresisProcessor.cpp @@ -85,10 +85,11 @@ void HysteresisProcessor::setSaturation (float newSaturation) void HysteresisProcessor::setOversampling() { - if ((int) *osParam != prevOS) + curOS = (int) *osParam; + if (curOS != prevOS) { - overSamplingFactor = (int) powf(2.0f, *osParam); - prevOS = (int) *osParam; + overSamplingFactor = 1 << curOS; + prevOS = curOS; for (int ch = 0; ch < 2; ++ch) { @@ -109,7 +110,7 @@ void HysteresisProcessor::calcBiasFreq() void HysteresisProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) { fs = (float) sampleRate; - overSamplingFactor = (int) powf(2.0f, *osParam); + overSamplingFactor = 1 << curOS; wasV1 = useV1; calcBiasFreq(); @@ -129,7 +130,7 @@ void HysteresisProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) for (int i = 0; i < 5; ++i) overSample[i]->initProcessing (samplesPerBlock); - prevOS = (int) *osParam; + prevOS = curOS; dcBlocker[0].reset (sampleRate); dcBlocker[0].calcCoefs (dcFreq, 0.707f); @@ -151,7 +152,7 @@ void HysteresisProcessor::releaseResources() float HysteresisProcessor::getLatencySamples() const noexcept { // latency of oversampling + fudge factor for Runge-Kutta and hysteresis - return overSample[(int) *osParam]->getLatencyInSamples() + 1.65f; + return overSample[curOS]->getLatencyInSamples() + 1.65f; } void HysteresisProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& /*midi*/) @@ -178,7 +179,7 @@ void HysteresisProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& buffer.getWritePointer (ch), -8.0f, 8.0f, buffer.getNumSamples()); dsp::AudioBlock<float> block (buffer); - dsp::AudioBlock<float> osBlock = overSample[(int) *osParam]->processSamplesUp (block); + dsp::AudioBlock<float> osBlock = overSample[curOS]->processSamplesUp (block); if (needsSmoothing) { @@ -195,7 +196,7 @@ void HysteresisProcessor::processBlock (AudioBuffer<float>& buffer, MidiBuffer& process (osBlock); } - overSample[(int) *osParam]->processSamplesDown (block); + overSample[curOS]->processSamplesDown (block); applyDCBlockers (buffer); } diff --git a/Plugin/Source/Processors/Hysteresis/HysteresisProcessor.h b/Plugin/Source/Processors/Hysteresis/HysteresisProcessor.h @@ -50,7 +50,7 @@ private: SmoothedValue<float, ValueSmoothingTypes::Multiplicative> makeup[2]; float fs = 44100.0f; - int prevOS = 0; + int curOS = 0, prevOS = 0; HysteresisProcessing hProcs[2]; std::unique_ptr<dsp::Oversampling<float>> overSample[5]; // needs oversampling to avoid aliasing TransformerHPF dcBlocker[2]; diff --git a/mac_builds.sh b/mac_builds.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +travis_run_before_install +travis_run_script + +cd $TRAVIS_BUILD_DIR/Plugin/Bin/Mac +rm -Rf CHOWTapeModel.* + +cp -Rf $TRAVIS_BUILD_DIR/Plugin/Builds/MacOSX/build/Release/CHOWTapeModel.app CHOWTapeModel.app +cp -Rf ~/Library/Audio/Plug-Ins/VST3/CHOWTapeModel.vst3 CHOWTapeModel.vst3 +cp -Rf ~/Library/Audio/Plug-Ins/VST/CHOWTapeModel.vst CHOWTapeModel.vst +cp -Rf ~/Library/Audio/Plug-Ins/Components/CHOWTapeModel.component CHOWTapeModel.component + +cd ../ +zip -r MacBuilds.zip Mac