diff --git a/.gitignore b/.gitignore index 83d09a0..d2073b4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ JuceLibraryCode/ Builds/ *bak *jucer +*RPP diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index a8afb04..9f8a131 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -58,6 +58,8 @@ void PeteAudioProcessor::changeProgramName (int index, const String& newName) void PeteAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) { myYin = Yin(sampleRate, samplesPerBlock); + aFilter = (filter_svf_t*)malloc(sizeof(filter_svf_t)); + svf_init(aFilter, 0, sampleRate); } void PeteAudioProcessor::releaseResources() { @@ -92,11 +94,13 @@ void PeteAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& mi static float myPitch; if(pitch > 0) { myPitch = pitch; } + svf_set_freq(aFilter, myPitch); + float* channel1Data = buffer.getWritePointer (0); float* channel2Data = buffer.getWritePointer (1); for(int i=0; i < buffer.getNumSamples(); i++){ incrementer += (myPitch / 4000); - channel1Data[i] = sin(incrementer) * 0.1; + channel1Data[i] = svf_step(aFilter, channel1Data[i]); channel2Data[i] = channel1Data[i]; } printf("%f\n",channel1Data[0]); diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index 7a6af37..45e5ab3 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -1 +1,47 @@ -#pragma once #include "../JuceLibraryCode/JuceHeader.h" #include "Yin.h" class PeteAudioProcessor : public AudioProcessor { public: PeteAudioProcessor(); ~PeteAudioProcessor(); void prepareToPlay (double sampleRate, int samplesPerBlock) override; void releaseResources() override; #ifndef JucePlugin_PreferredChannelConfigurations bool isBusesLayoutSupported (const BusesLayout& layouts) const override; #endif void processBlock (AudioSampleBuffer&, MidiBuffer&) override; AudioProcessorEditor* createEditor() override; bool hasEditor() const override; const String getName() const override; bool acceptsMidi() const override; bool producesMidi() const override; double getTailLengthSeconds() const override; int getNumPrograms() override; int getCurrentProgram() override; void setCurrentProgram (int index) override; const String getProgramName (int index) override; void changeProgramName (int index, const String& newName) override; void getStateInformation (MemoryBlock& destData) override; void setStateInformation (const void* data, int sizeInBytes) override; private: JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PeteAudioProcessor) Yin myYin; }; \ No newline at end of file +#pragma once + +#include "../JuceLibraryCode/JuceHeader.h" +#include "Yin.h" +extern "C" { + #include "../wrDsp/wrFilter.h" +}; + + +class PeteAudioProcessor : public AudioProcessor +{ +public: + PeteAudioProcessor(); + ~PeteAudioProcessor(); + + void prepareToPlay (double sampleRate, int samplesPerBlock) override; + void releaseResources() override; + + #ifndef JucePlugin_PreferredChannelConfigurations + bool isBusesLayoutSupported (const BusesLayout& layouts) const override; + #endif + + void processBlock (AudioSampleBuffer&, MidiBuffer&) override; + + AudioProcessorEditor* createEditor() override; + bool hasEditor() const override; + + const String getName() const override; + + bool acceptsMidi() const override; + bool producesMidi() const override; + double getTailLengthSeconds() const override; + + int getNumPrograms() override; + int getCurrentProgram() override; + void setCurrentProgram (int index) override; + const String getProgramName (int index) override; + void changeProgramName (int index, const String& newName) override; + + void getStateInformation (MemoryBlock& destData) override; + void setStateInformation (const void* data, int sizeInBytes) override; + +private: + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PeteAudioProcessor) + Yin myYin; + filter_svf_t* aFilter; +}; diff --git a/test Project/Samples/Recorded/0002 3-Audio-1.wav b/test Project/Samples/Recorded/0002 3-Audio-1.wav index e69de29..906fd28 100644 Binary files a/test Project/Samples/Recorded/0002 3-Audio-1.wav and b/test Project/Samples/Recorded/0002 3-Audio-1.wav differ diff --git a/test Project/Samples/Recorded/0002 3-Audio-1.wav.asd b/test Project/Samples/Recorded/0002 3-Audio-1.wav.asd new file mode 100644 index 0000000..b92668d Binary files /dev/null and b/test Project/Samples/Recorded/0002 3-Audio-1.wav.asd differ diff --git a/test Project/Samples/Recorded/0002 3-Audio-1.wav.reapeaks b/test Project/Samples/Recorded/0002 3-Audio-1.wav.reapeaks new file mode 100644 index 0000000..2a4f397 Binary files /dev/null and b/test Project/Samples/Recorded/0002 3-Audio-1.wav.reapeaks differ diff --git a/test Project/Samples/Recorded/0003 3-Audio.wav b/test Project/Samples/Recorded/0003 3-Audio.wav new file mode 100644 index 0000000..e69de29 diff --git a/test.RPP b/test.RPP deleted file mode 100644 index cd02ac6..0000000 --- a/test.RPP +++ /dev/null @@ -1,161 +0,0 @@ - - - RENDER_FILE "" - RENDER_PATTERN "" - RENDER_FMT 0 2 0 - RENDER_1X 0 - RENDER_RANGE 1 0 0 18 1000 - RENDER_RESAMPLE 3 0 1 - RENDER_ADDTOPROJ 0 - RENDER_STEMS 0 - RENDER_DITHER 0 - TIMELOCKMODE 1 - TEMPOENVLOCKMODE 1 - ITEMMIX 0 - DEFPITCHMODE 589824 - TAKELANE 0 - SAMPLERATE 44100 0 0 - - LOCK 16385 - - GLOBAL_AUTO -1 - TEMPO 120 4 4 - PLAYRATE 1 0 0.25 4 - SELECTION 0 0 - SELECTION2 0 0 - MASTERAUTOMODE 0 - MASTERTRACKHEIGHT 0 - MASTERPEAKCOL 16576 - MASTERMUTESOLO 0 - MASTERTRACKVIEW 0 0.6667 0.5 0.5 0 0 0 - MASTERHWOUT 0 0 1 0 0 0 0 -1 - MASTER_NCH 2 2 - MASTER_VOLUME 1 0 -1 -1 1 - MASTER_FX 1 - MASTER_SEL 0 - - FLOATPOS 0 0 0 0 - FXID {C1E4684A-C510-DB43-B7BE-A481A4F2525D} - WAK 0 - > - - - - - FLOATPOS 0 0 0 0 - FXID {B7DD42FB-8D0E-C24C-924A-407EC4334EB7} - WAK 0 - > - - > - > ->