diff --git a/KissOfShame.jucer b/KissOfShame.jucer index c6f55b3..4ebfb3d 100644 --- a/KissOfShame.jucer +++ b/KissOfShame.jucer @@ -53,7 +53,6 @@ - diff --git a/README.md b/README.md index ca5e0ee..049630f 100644 --- a/README.md +++ b/README.md @@ -158,7 +158,7 @@ Bugs I found (or introduced hehe): Other things that can / should be improved in the code (volunteers welcome!): - Don't hardcode the sample rate to 44100 Hz. -- Add `prepareToPlay()` and `reset()` methods to the DSP classes. The reset method should clear out old state. +- [FIXED] ~~Add `prepareToPlay()` and `reset()` methods to the DSP classes. The reset method should clear out old state.~~ - Allocate buffers ahead of time and copy into them, rather than doing `audioGraphProcessingBuffer = audioBuffer`, which may allocate (at least the first time). - The envelope generators (`Envelope` and `EnvelopeDips`) could keep track of the prev and next point, so we don't have to loop through all the points at every timestep. - Often the loop for the channels is nested inside the loop for the samples, which can be inefficient. @@ -168,7 +168,7 @@ Other things that can / should be improved in the code (volunteers welcome!): - There are some data races between the editor and processor. For example, VU meter RMS readings should be atomic, and ideally be independent of the block size. - Remove most of the compiler warnings. (I set the warning level high on purpose.) - Replace the Biquads with TPT / SVF filters. -- [Needs review] ~~Don't use `rand()` and `srand()`. Replace with `juce::Random`.~~ +- [FIXED] ~~Don't use `rand()` and `srand()`. Replace with `juce::Random`.~~ - Parameter smoothing. - When you put the plug-in in bypass mode, change the Age or Shame controls, and disable bypass, there can be a glitch because old filter state etc no longer makes sense. @@ -177,7 +177,8 @@ Maybe: - When you drag to apply flanging, I would expect a mouse up to reset the flanging depth, since the animation does return to normal speed. - Skew the flange depth so that shorter delays are easier to dial in. (For example by doing `targetDepth = depth * depth * 1000.0f`.) - Oversampling. The saturation stage can easily add aliases. -- [Needs to include AAX] ~~Use CMake instead of Projucer~~. +- [FIXED] ~~Use CMake instead of Projucer~~. +- Add AAX support. ## Credits & license @@ -195,7 +196,7 @@ Updates and improvements by [Matthijs Hollemans](https://audiodev.blog) and cont This program is free software: you can redistribute it and/or modify it under the terms of the [GNU General Public License](https://www.gnu.org/licenses/gpl-3.0.en.html) as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. -Some of the code in this repo (`Granulate` and `Noise`) was taken from [The Synthesis ToolKit in C++ (STK)](https://github.com/thestk/stk) by Perry R. Cook and Gary P. Scavone. +Some of the code in this repo (the `Granulate` class) was taken from [The Synthesis ToolKit in C++ (STK)](https://github.com/thestk/stk) by Perry R. Cook and Gary P. Scavone. JUCE is copyright © Raw Material Software. diff --git a/Source/AudioProcessing/CMakeLists.txt b/Source/AudioProcessing/CMakeLists.txt index 0a0e9a4..4adbf45 100644 --- a/Source/AudioProcessing/CMakeLists.txt +++ b/Source/AudioProcessing/CMakeLists.txt @@ -13,6 +13,5 @@ target_sources("${BaseTargetName}" HurricaneSandy.h InputSaturation.h LoopCrossfade.h - Noise.h Shame.h ) \ No newline at end of file diff --git a/Source/AudioProcessing/HurricaneSandy.h b/Source/AudioProcessing/HurricaneSandy.h index 146ddc0..27fffcb 100644 --- a/Source/AudioProcessing/HurricaneSandy.h +++ b/Source/AudioProcessing/HurricaneSandy.h @@ -6,7 +6,6 @@ #include "LoopCrossfade.h" #include "Biquads.h" #include "Envelope.h" -#include "Noise.h" class HurricaneSandy { @@ -157,7 +156,6 @@ class HurricaneSandy Biquads hpButterworth_Grains; Biquads lpButterworth_Signal; - Noise whiteNoise; Envelope noiseEnv { 350 }; Envelope sigEnv { 350 }; diff --git a/Source/AudioProcessing/Noise.h b/Source/AudioProcessing/Noise.h deleted file mode 100644 index 95e3f67..0000000 --- a/Source/AudioProcessing/Noise.h +++ /dev/null @@ -1,58 +0,0 @@ -#pragma once - -#include -#include - -/***************************************************/ -/*! \class Noise - \brief STK noise generator. - - Generic random number generation using the - C rand() function. The quality of the rand() - function varies from one OS to another. - - by Perry R. Cook and Gary P. Scavone, 1995--2014. -*/ -/***************************************************/ - -class Noise -{ -public: - //! Default constructor that can also take a specific seed value. - /*! - If the seed value is zero (the default value), the random number generator is - seeded with the system time. - */ - Noise( unsigned int seed = 0 ) - { - // Seed the random number generator - this->setSeed( seed ); - } - - //! Seed the random number generator with a specific seed value. - /*! - If no seed is provided or the seed value is zero, the random - number generator is seeded with the current system time. - */ - void setSeed( unsigned int seed = 0 ) - { - if ( seed == 0 ) - srand( (unsigned int) time( nullptr ) ); - else - srand( seed ); - } - - //! Return the last computed output value. - float lastOut( void ) const { return lastFrame; } - - //! Compute and return one output sample. - float tick( void ); - -protected: - float lastFrame; -}; - -inline float Noise :: tick( void ) -{ - return lastFrame = (float) ( 2.0 * rand() / (RAND_MAX + 1.0) - 1.0 ); -}