AnalogTapeModel

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

commit 7872f5e4bc537122af8a4a72747919725ac5de19
parent 9886db1e1a41be64affbafaebd67b490f34b9f37
Author: jatinchowdhury18 <jatinchowdhury18@gmail.com>
Date:   Sun,  6 Oct 2019 00:05:29 -0700

Fixes for Linux compilation, add Linux to Travis (#6)



Diffstat:
M.travis.yml | 41++++++++++++++++++++++++++++++++++++++---
MPlugin/Source/Processors/Hysteresis/HysteresisProcessing.cpp | 2+-
MPlugin/Source/Processors/Loss Effects/LossEffects.cpp | 8++++----
3 files changed, 43 insertions(+), 8 deletions(-)

diff --git a/.travis.yml b/.travis.yml @@ -27,6 +27,38 @@ matrix: - MSBUILD_PATH="c:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" - BUILD_FOLDER="VisualStudio2017" - PROJUCER_EXPORT="$TRAVIS_BUILD_DIR/Plugin/JUCE/extras/Projucer/Builds/VisualStudio2017/x64/Debug/App/Projucer.exe" + - name: "linux" + os: linux + dist: xenial + sudo: required + compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-6 + - g++-6 + - freeglut3-dev + - g++ + - libasound2-dev + - libcurl4-openssl-dev + - libfreetype6-dev + - libjack-jackd2-dev + - libx11-dev + - libxcomposite-dev + - libxcursor-dev + - libxinerama-dev + - libxrandr-dev + - mesa-common-dev + - ladspa-sdk + - webkit2gtk-4.0 + - libgtk-3-dev + services: + - xvfb + env: + - BUILD_FOLDER="LinuxMakefile" + - PROJUCER_EXPORT="$TRAVIS_BUILD_DIR/Plugin/Juce/extras/Projucer/Builds/LinuxMakefile/build/Projucer" before_install: # mac installs @@ -36,21 +68,24 @@ before_install: - if [[ $TRAVIS_OS_NAME == 'windows' ]]; then export PATH=$MSBUILD_PATH:$PATH; fi # Build Projucer - - cd $TRAVIS_BUILD_DIR/Plugin/JUCE/extras/Projucer/Builds/$BUILD_FOLDER + - cd $TRAVIS_BUILD_DIR/Plugin/Juce/extras/Projucer/Builds/$BUILD_FOLDER - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then xcodebuild -project Projucer.xcodeproj > /dev/null; fi - if [[ $TRAVIS_OS_NAME == 'windows' ]]; then msbuild.exe -v:quiet Projucer.sln; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then make; fi script: - cd $TRAVIS_BUILD_DIR/Plugin/ - export PROJUCER=$PROJUCER_EXPORT - - $PROJUCER --set-global-search-path $TRAVIS_OS_NAME defaultJuceModulePath $TRAVIS_BUILD_DIR/Plugin/JUCE/modules - - $PROJUCER --set-global-search-path $TRAVIS_OS_NAME vstLegacyPath $TRAVIS_BUILD_DIR/Plugin/JUCE/VST2_SDK + - $PROJUCER --set-global-search-path $TRAVIS_OS_NAME defaultJuceModulePath $TRAVIS_BUILD_DIR/Plugin/Juce/modules + - $PROJUCER --set-global-search-path $TRAVIS_OS_NAME vstLegacyPath $TRAVIS_BUILD_DIR/Plugin/Juce/VST2_SDK - $PROJUCER --resave CHOWTapeModel.jucer - cd $TRAVIS_BUILD_DIR/Plugin/Builds/$BUILD_FOLDER/ - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then xcodebuild -project CHOWTapeModel.xcodeproj/ clean; fi - if [[ $TRAVIS_JOB_NAME == 'osx' ]]; then xcodebuild -project CHOWTapeModel.xcodeproj/ -configuration Release | xcpretty -s -f `xcpretty-travis-formatter`; fi - if [[ $TRAVIS_JOB_NAME == 'win' ]]; then msbuild.exe -v:normal CHOWTapeModel.sln; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then make clean; fi + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then make CONFIG=Release; fi #- | # if [[ $TRAVIS_JOB_NAME == 'unit-tests' ]]; then diff --git a/Plugin/Source/Processors/Hysteresis/HysteresisProcessing.cpp b/Plugin/Source/Processors/Hysteresis/HysteresisProcessing.cpp @@ -43,7 +43,7 @@ float HysteresisProcessing::hysteresisFunc (float M, float H, float H_d) const float M_diff = M_s * langevin (Q) - M; const float delta = H_d > 0 ? 1.0f : -1.0f; - const float delta_M = signbit (delta) == signbit (M_diff) ? 1.0f : 0.0f; + const float delta_M = std::signbit (delta) == std::signbit (M_diff) ? 1.0f : 0.0f; const float L_prime = langevinD (Q); diff --git a/Plugin/Source/Processors/Loss Effects/LossEffects.cpp b/Plugin/Source/Processors/Loss Effects/LossEffects.cpp @@ -16,9 +16,9 @@ void LossEffects::init (float sampleRate, float speed, float spacing, float thic const auto freq = ((float) k * binWidth) + (binWidth / 2.0f); const auto waveNumber = MathConstants<float>::twoPi * freq / speedMetric; - const auto spacingLoss = std::expf (-1.0f * waveNumber * spacing); - const auto gapLoss = std::sinf (waveNumber * gap / 2.0f) / (waveNumber * gap / 2.0f); - const auto thicknessLoss = (1.0f - std::expf (-waveNumber * thickness)) / (waveNumber * thickness); + const auto spacingLoss = expf (-1.0f * waveNumber * spacing); + const auto gapLoss = sinf (waveNumber * gap / 2.0f) / (waveNumber * gap / 2.0f); + const auto thicknessLoss = (1.0f - expf (-waveNumber * thickness)) / (waveNumber * thickness); H[k] = spacingLoss * gapLoss * thicknessLoss; H[order - k - 1] = H[k]; @@ -29,7 +29,7 @@ void LossEffects::init (float sampleRate, float speed, float spacing, float thic { h[n] = 0; for (int k = 0; k < order; k++) - h[n] += H[k] * std::cosf (MathConstants<float>::twoPi * (float) k * (float) n / (float) order); + h[n] += H[k] * cosf (MathConstants<float>::twoPi * (float) k * (float) n / (float) order); h[n] /= (float) order; }