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/README.md b/README.md new file mode 100644 index 0000000..4581fb5 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# pete + +A VST plugin with JUCE. It makes noise. Stay tuned. diff --git a/Source/LampshadeLine.h b/Source/LampshadeLine.h deleted file mode 100644 index 89cd1b5..0000000 --- a/Source/LampshadeLine.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once - -class LampshadeLine { -public: - LampshadeLine(bool orientation, float x, float y, float len) : orientation(orientation), x(x), y(y), len(len) {} - LampshadeLine(bool orientation, float x, float y) : orientation(orientation), x(x), y(y), len(1.) {} - LampshadeLine(bool orientation, float xy) : orientation(orientation), x(xy), y(xy), len(1.) {} - - bool orientation; - float x; - float y; - float len; - - const static bool Horizontal = 0; - const static bool Vertical = 1; -}; diff --git a/Source/LookAndFeel.h b/Source/LookAndFeel.h index 02d5266..2b03561 100644 --- a/Source/LookAndFeel.h +++ b/Source/LookAndFeel.h @@ -2,7 +2,7 @@ #include "../JuceLibraryCode/JuceHeader.h" -class LampshadeLookAndFeel : public LookAndFeel_V4 { +class PeteLookAndFeel : public LookAndFeel_V4 { public: void drawLinearSlider (Graphics& g, int x, diff --git a/Source/PeteLine.h b/Source/PeteLine.h new file mode 100644 index 0000000..bbd2df5 --- /dev/null +++ b/Source/PeteLine.h @@ -0,0 +1,16 @@ +#pragma once + +class PeteLine { +public: + PeteLine(bool orientation, float x, float y, float len) : orientation(orientation), x(x), y(y), len(len) {} + PeteLine(bool orientation, float x, float y) : orientation(orientation), x(x), y(y), len(1.) {} + PeteLine(bool orientation, float xy) : orientation(orientation), x(xy), y(xy), len(1.) {} + + bool orientation; + float x; + float y; + float len; + + const static bool Horizontal = 0; + const static bool Vertical = 1; +}; diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 9a0a208..82e6157 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -1,19 +1,18 @@ #include "PluginProcessor.h" #include "PluginEditor.h" - -LampshadeAudioProcessorEditor::LampshadeAudioProcessorEditor(LampshadeAudioProcessor& p) +PeteAudioProcessorEditor::PeteAudioProcessorEditor(PeteAudioProcessor& p) : AudioProcessorEditor (&p), processor (p), lineThickness(4) { hlines = { - LampshadeLine(LampshadeLine::Horizontal, 1./3.), - LampshadeLine(LampshadeLine::Horizontal, 2./3.) + PeteLine(PeteLine::Horizontal, 1./3.), + PeteLine(PeteLine::Horizontal, 2./3.) }; vlines = { - LampshadeLine(LampshadeLine::Vertical, 1./3.), - LampshadeLine(LampshadeLine::Vertical, 1./3.+0.01, 1./3.+0.01, 1./3.), - LampshadeLine(LampshadeLine::Vertical, 2./3.+0.05, 2./3.+0.05, 2./3.), - LampshadeLine(LampshadeLine::Vertical, 2./3.) + PeteLine(PeteLine::Vertical, 1./3.), + PeteLine(PeteLine::Vertical, 1./3.+0.01, 1./3.+0.01, 1./3.), + PeteLine(PeteLine::Vertical, 2./3.+0.05, 2./3.+0.05, 2./3.), + PeteLine(PeteLine::Vertical, 2./3.) }; slider.setTextBoxStyle(Slider::NoTextBox, true, 0, 0); setSize(600, 600); @@ -23,11 +22,11 @@ LampshadeAudioProcessorEditor::LampshadeAudioProcessorEditor(LampshadeAudioProce setResizeLimits(300, 300, 1200, 1200); } -LampshadeAudioProcessorEditor::~LampshadeAudioProcessorEditor() +PeteAudioProcessorEditor::~PeteAudioProcessorEditor() { } -void LampshadeAudioProcessorEditor::paint(Graphics& g) +void PeteAudioProcessorEditor::paint(Graphics& g) { g.fillAll(Colours::white); @@ -40,7 +39,7 @@ void LampshadeAudioProcessorEditor::paint(Graphics& g) } -void LampshadeAudioProcessorEditor::resized() +void PeteAudioProcessorEditor::resized() { // hardcoded because they should stay in the same rectangle float w = getWidth() * vlines[0].x; diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index fc8ef78..b31c0d8 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -5,26 +5,26 @@ #include "../JuceLibraryCode/JuceHeader.h" #include "PluginProcessor.h" #include "LookAndFeel.h" -#include "LampshadeLine.h" +#include "PeteLine.h" -class LampshadeAudioProcessorEditor : public AudioProcessorEditor +class PeteAudioProcessorEditor : public AudioProcessorEditor { public: - LampshadeAudioProcessorEditor (LampshadeAudioProcessor&); - ~LampshadeAudioProcessorEditor(); + PeteAudioProcessorEditor (PeteAudioProcessor&); + ~PeteAudioProcessorEditor(); void paint (Graphics&) override; void resized() override; private: - LampshadeAudioProcessor& processor; - LampshadeLookAndFeel* gui = new LampshadeLookAndFeel(); - std::vector hlines; - std::vector vlines; + PeteAudioProcessor& processor; + PeteLookAndFeel* gui = new PeteLookAndFeel(); + std::vector hlines; + std::vector vlines; int lineThickness; Slider slider; - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LampshadeAudioProcessorEditor) + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PeteAudioProcessorEditor) }; diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 2837f3c..a3df4a8 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -1,8 +1,7 @@ #include "PluginProcessor.h" #include "PluginEditor.h" #include - -LampshadeAudioProcessor::LampshadeAudioProcessor() +PeteAudioProcessor::PeteAudioProcessor() #ifndef JucePlugin_PreferredChannelConfigurations : AudioProcessor (BusesProperties() #if ! JucePlugin_IsMidiEffect @@ -15,17 +14,14 @@ LampshadeAudioProcessor::LampshadeAudioProcessor() #endif { } - -LampshadeAudioProcessor::~LampshadeAudioProcessor() +PeteAudioProcessor::~PeteAudioProcessor() { } - -const String LampshadeAudioProcessor::getName() const +const String PeteAudioProcessor::getName() const { return JucePlugin_Name; } - -bool LampshadeAudioProcessor::acceptsMidi() const +bool PeteAudioProcessor::acceptsMidi() const { #if JucePlugin_WantsMidiInput return true; @@ -33,73 +29,59 @@ bool LampshadeAudioProcessor::acceptsMidi() const return false; #endif } - -bool LampshadeAudioProcessor::producesMidi() const +bool PeteAudioProcessor::producesMidi() const { return false; } - -double LampshadeAudioProcessor::getTailLengthSeconds() const +double PeteAudioProcessor::getTailLengthSeconds() const { return 0.0; } - -int LampshadeAudioProcessor::getNumPrograms() +int PeteAudioProcessor::getNumPrograms() { return 1; } - -int LampshadeAudioProcessor::getCurrentProgram() +int PeteAudioProcessor::getCurrentProgram() { return 0; } - -void LampshadeAudioProcessor::setCurrentProgram (int index) +void PeteAudioProcessor::setCurrentProgram (int index) { } - -const String LampshadeAudioProcessor::getProgramName (int index) +const String PeteAudioProcessor::getProgramName (int index) { return {}; } - -void LampshadeAudioProcessor::changeProgramName (int index, const String& newName) +void PeteAudioProcessor::changeProgramName (int index, const String& newName) { } - -void LampshadeAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) +void PeteAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) { myYin = Yin(sampleRate, samplesPerBlock); aFilter = (filter_svf_t*)malloc(sizeof(filter_svf_t)); svf_init(aFilter, 2, sampleRate); } - -void LampshadeAudioProcessor::releaseResources() +void PeteAudioProcessor::releaseResources() { } - #ifndef JucePlugin_PreferredChannelConfigurations -bool LampshadeAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const +bool PeteAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const { if (layouts.getMainOutputChannelSet() != AudioChannelSet::mono() && layouts.getMainOutputChannelSet() != AudioChannelSet::stereo()) return false; - #if ! JucePlugin_IsSynth if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet()) return false; #endif - return true; } #endif - -void LampshadeAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) +void PeteAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) { static float incrementer; const int totalNumInputChannels = getTotalNumInputChannels(); const int totalNumOutputChannels = getTotalNumOutputChannels(); - // In case we have more outputs than inputs, this code clears any output // channels that didn't contain input data, (because these aren't // guaranteed to be empty - they may contain garbage). @@ -108,7 +90,6 @@ void LampshadeAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffe // this code if your algorithm always overwrites all the output channels. for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i) buffer.clear(i, 0, buffer.getNumSamples()); - float pitch = myYin.getPitch(buffer.getWritePointer (0)); // returns Pitch in Hertz static float myPitch; if(pitch > 0) { myPitch = pitch; } @@ -125,26 +106,21 @@ void LampshadeAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffe } printf("%f\n",channel1Data[0]); } - -bool LampshadeAudioProcessor::hasEditor() const +bool PeteAudioProcessor::hasEditor() const { return true; } - -AudioProcessorEditor* LampshadeAudioProcessor::createEditor() +AudioProcessorEditor* PeteAudioProcessor::createEditor() { - return new LampshadeAudioProcessorEditor(*this); + return new PeteAudioProcessorEditor(*this); } - -void LampshadeAudioProcessor::getStateInformation (MemoryBlock& destData) +void PeteAudioProcessor::getStateInformation (MemoryBlock& destData) { } - -void LampshadeAudioProcessor::setStateInformation (const void* data, int sizeInBytes) +void PeteAudioProcessor::setStateInformation (const void* data, int sizeInBytes) { } - AudioProcessor* JUCE_CALLTYPE createPluginFilter() { - return new LampshadeAudioProcessor(); + return new PeteAudioProcessor(); } diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index f033750..45e5ab3 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -7,11 +7,11 @@ extern "C" { }; -class LampshadeAudioProcessor : public AudioProcessor +class PeteAudioProcessor : public AudioProcessor { public: - LampshadeAudioProcessor(); - ~LampshadeAudioProcessor(); + PeteAudioProcessor(); + ~PeteAudioProcessor(); void prepareToPlay (double sampleRate, int samplesPerBlock) override; void releaseResources() override; @@ -41,7 +41,7 @@ public: void setStateInformation (const void* data, int sizeInBytes) override; private: - JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LampshadeAudioProcessor) + JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PeteAudioProcessor) Yin myYin; filter_svf_t* aFilter; }; diff --git a/test Project/Samples/Recorded/0001 3-Audio.wav.reapeaks b/test Project/Samples/Recorded/0001 3-Audio.wav.reapeaks index f310826..bdc9ba4 100644 Binary files a/test Project/Samples/Recorded/0001 3-Audio.wav.reapeaks and b/test Project/Samples/Recorded/0001 3-Audio.wav.reapeaks differ diff --git a/test.RPP b/test.RPP deleted file mode 100644 index 02c73e4..0000000 --- a/test.RPP +++ /dev/null @@ -1,174 +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 0 - MASTER_SEL 0 - - - - - - FLOATPOS 0 0 0 0 - FXID {B7DD42FB-8D0E-C24C-924A-407EC4334EB7} - WAK 0 - > - - > - - > - > -> diff --git a/wrLib b/wrLib index a4e5fa1..76147e5 160000 --- a/wrLib +++ b/wrLib @@ -1 +1 @@ -Subproject commit a4e5fa1c58bb2ced235ebd7d3493a19c3113b12a +Subproject commit 76147e53b1a8d2280ac59f3d6927d1c4b550920c