all: renamed to pete
This commit is contained in:
@@ -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;
|
||||
};
|
@@ -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,
|
||||
|
16
Source/PeteLine.h
Normal file
16
Source/PeteLine.h
Normal file
@@ -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;
|
||||
};
|
@@ -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;
|
||||
|
@@ -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<LampshadeLine> hlines;
|
||||
std::vector<LampshadeLine> vlines;
|
||||
PeteAudioProcessor& processor;
|
||||
PeteLookAndFeel* gui = new PeteLookAndFeel();
|
||||
std::vector<PeteLine> hlines;
|
||||
std::vector<PeteLine> vlines;
|
||||
int lineThickness;
|
||||
|
||||
Slider slider;
|
||||
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (LampshadeAudioProcessorEditor)
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PeteAudioProcessorEditor)
|
||||
};
|
||||
|
@@ -1,8 +1,7 @@
|
||||
#include "PluginProcessor.h"
|
||||
#include "PluginEditor.h"
|
||||
#include <math.h>
|
||||
|
||||
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,71 +29,57 @@ 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);
|
||||
}
|
||||
|
||||
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).
|
||||
@@ -106,7 +88,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; }
|
||||
@@ -120,26 +101,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();
|
||||
}
|
||||
|
@@ -1,42 +1 @@
|
||||
#pragma once
|
||||
|
||||
#include "../JuceLibraryCode/JuceHeader.h"
|
||||
#include "Yin.h"
|
||||
|
||||
class LampshadeAudioProcessor : public AudioProcessor
|
||||
{
|
||||
public:
|
||||
LampshadeAudioProcessor();
|
||||
~LampshadeAudioProcessor();
|
||||
|
||||
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 (LampshadeAudioProcessor)
|
||||
Yin myYin;
|
||||
};
|
||||
#pragma once
|
Reference in New Issue
Block a user