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"
|
#include "../JuceLibraryCode/JuceHeader.h"
|
||||||
|
|
||||||
class LampshadeLookAndFeel : public LookAndFeel_V4 {
|
class PeteLookAndFeel : public LookAndFeel_V4 {
|
||||||
public:
|
public:
|
||||||
void drawLinearSlider (Graphics& g,
|
void drawLinearSlider (Graphics& g,
|
||||||
int x,
|
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 "PluginProcessor.h"
|
||||||
#include "PluginEditor.h"
|
#include "PluginEditor.h"
|
||||||
|
|
||||||
|
PeteAudioProcessorEditor::PeteAudioProcessorEditor(PeteAudioProcessor& p)
|
||||||
LampshadeAudioProcessorEditor::LampshadeAudioProcessorEditor(LampshadeAudioProcessor& p)
|
|
||||||
: AudioProcessorEditor (&p), processor (p), lineThickness(4)
|
: AudioProcessorEditor (&p), processor (p), lineThickness(4)
|
||||||
{
|
{
|
||||||
hlines = {
|
hlines = {
|
||||||
LampshadeLine(LampshadeLine::Horizontal, 1./3.),
|
PeteLine(PeteLine::Horizontal, 1./3.),
|
||||||
LampshadeLine(LampshadeLine::Horizontal, 2./3.)
|
PeteLine(PeteLine::Horizontal, 2./3.)
|
||||||
};
|
};
|
||||||
vlines = {
|
vlines = {
|
||||||
LampshadeLine(LampshadeLine::Vertical, 1./3.),
|
PeteLine(PeteLine::Vertical, 1./3.),
|
||||||
LampshadeLine(LampshadeLine::Vertical, 1./3.+0.01, 1./3.+0.01, 1./3.),
|
PeteLine(PeteLine::Vertical, 1./3.+0.01, 1./3.+0.01, 1./3.),
|
||||||
LampshadeLine(LampshadeLine::Vertical, 2./3.+0.05, 2./3.+0.05, 2./3.),
|
PeteLine(PeteLine::Vertical, 2./3.+0.05, 2./3.+0.05, 2./3.),
|
||||||
LampshadeLine(LampshadeLine::Vertical, 2./3.)
|
PeteLine(PeteLine::Vertical, 2./3.)
|
||||||
};
|
};
|
||||||
slider.setTextBoxStyle(Slider::NoTextBox, true, 0, 0);
|
slider.setTextBoxStyle(Slider::NoTextBox, true, 0, 0);
|
||||||
setSize(600, 600);
|
setSize(600, 600);
|
||||||
@@ -23,11 +22,11 @@ LampshadeAudioProcessorEditor::LampshadeAudioProcessorEditor(LampshadeAudioProce
|
|||||||
setResizeLimits(300, 300, 1200, 1200);
|
setResizeLimits(300, 300, 1200, 1200);
|
||||||
}
|
}
|
||||||
|
|
||||||
LampshadeAudioProcessorEditor::~LampshadeAudioProcessorEditor()
|
PeteAudioProcessorEditor::~PeteAudioProcessorEditor()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void LampshadeAudioProcessorEditor::paint(Graphics& g)
|
void PeteAudioProcessorEditor::paint(Graphics& g)
|
||||||
{
|
{
|
||||||
g.fillAll(Colours::white);
|
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
|
// hardcoded because they should stay in the same rectangle
|
||||||
float w = getWidth() * vlines[0].x;
|
float w = getWidth() * vlines[0].x;
|
||||||
|
@@ -5,26 +5,26 @@
|
|||||||
#include "../JuceLibraryCode/JuceHeader.h"
|
#include "../JuceLibraryCode/JuceHeader.h"
|
||||||
#include "PluginProcessor.h"
|
#include "PluginProcessor.h"
|
||||||
#include "LookAndFeel.h"
|
#include "LookAndFeel.h"
|
||||||
#include "LampshadeLine.h"
|
#include "PeteLine.h"
|
||||||
|
|
||||||
class LampshadeAudioProcessorEditor : public AudioProcessorEditor
|
class PeteAudioProcessorEditor : public AudioProcessorEditor
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LampshadeAudioProcessorEditor (LampshadeAudioProcessor&);
|
PeteAudioProcessorEditor (PeteAudioProcessor&);
|
||||||
~LampshadeAudioProcessorEditor();
|
~PeteAudioProcessorEditor();
|
||||||
|
|
||||||
void paint (Graphics&) override;
|
void paint (Graphics&) override;
|
||||||
void resized() override;
|
void resized() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LampshadeAudioProcessor& processor;
|
PeteAudioProcessor& processor;
|
||||||
LampshadeLookAndFeel* gui = new LampshadeLookAndFeel();
|
PeteLookAndFeel* gui = new PeteLookAndFeel();
|
||||||
std::vector<LampshadeLine> hlines;
|
std::vector<PeteLine> hlines;
|
||||||
std::vector<LampshadeLine> vlines;
|
std::vector<PeteLine> vlines;
|
||||||
int lineThickness;
|
int lineThickness;
|
||||||
|
|
||||||
Slider slider;
|
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 "PluginProcessor.h"
|
||||||
#include "PluginEditor.h"
|
#include "PluginEditor.h"
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
PeteAudioProcessor::PeteAudioProcessor()
|
||||||
LampshadeAudioProcessor::LampshadeAudioProcessor()
|
|
||||||
#ifndef JucePlugin_PreferredChannelConfigurations
|
#ifndef JucePlugin_PreferredChannelConfigurations
|
||||||
: AudioProcessor (BusesProperties()
|
: AudioProcessor (BusesProperties()
|
||||||
#if ! JucePlugin_IsMidiEffect
|
#if ! JucePlugin_IsMidiEffect
|
||||||
@@ -15,17 +14,14 @@ LampshadeAudioProcessor::LampshadeAudioProcessor()
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
PeteAudioProcessor::~PeteAudioProcessor()
|
||||||
LampshadeAudioProcessor::~LampshadeAudioProcessor()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
const String PeteAudioProcessor::getName() const
|
||||||
const String LampshadeAudioProcessor::getName() const
|
|
||||||
{
|
{
|
||||||
return JucePlugin_Name;
|
return JucePlugin_Name;
|
||||||
}
|
}
|
||||||
|
bool PeteAudioProcessor::acceptsMidi() const
|
||||||
bool LampshadeAudioProcessor::acceptsMidi() const
|
|
||||||
{
|
{
|
||||||
#if JucePlugin_WantsMidiInput
|
#if JucePlugin_WantsMidiInput
|
||||||
return true;
|
return true;
|
||||||
@@ -33,71 +29,57 @@ bool LampshadeAudioProcessor::acceptsMidi() const
|
|||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
bool PeteAudioProcessor::producesMidi() const
|
||||||
bool LampshadeAudioProcessor::producesMidi() const
|
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
double PeteAudioProcessor::getTailLengthSeconds() const
|
||||||
double LampshadeAudioProcessor::getTailLengthSeconds() const
|
|
||||||
{
|
{
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
int PeteAudioProcessor::getNumPrograms()
|
||||||
int LampshadeAudioProcessor::getNumPrograms()
|
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
int PeteAudioProcessor::getCurrentProgram()
|
||||||
int LampshadeAudioProcessor::getCurrentProgram()
|
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
void PeteAudioProcessor::setCurrentProgram (int index)
|
||||||
void LampshadeAudioProcessor::setCurrentProgram (int index)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
const String PeteAudioProcessor::getProgramName (int index)
|
||||||
const String LampshadeAudioProcessor::getProgramName (int index)
|
|
||||||
{
|
{
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
void PeteAudioProcessor::changeProgramName (int index, const String& newName)
|
||||||
void LampshadeAudioProcessor::changeProgramName (int index, const String& newName)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void PeteAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
|
||||||
void LampshadeAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock)
|
|
||||||
{
|
{
|
||||||
myYin = Yin(sampleRate, samplesPerBlock);
|
myYin = Yin(sampleRate, samplesPerBlock);
|
||||||
}
|
}
|
||||||
|
void PeteAudioProcessor::releaseResources()
|
||||||
void LampshadeAudioProcessor::releaseResources()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef JucePlugin_PreferredChannelConfigurations
|
#ifndef JucePlugin_PreferredChannelConfigurations
|
||||||
bool LampshadeAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
|
bool PeteAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const
|
||||||
{
|
{
|
||||||
if (layouts.getMainOutputChannelSet() != AudioChannelSet::mono()
|
if (layouts.getMainOutputChannelSet() != AudioChannelSet::mono()
|
||||||
&& layouts.getMainOutputChannelSet() != AudioChannelSet::stereo())
|
&& layouts.getMainOutputChannelSet() != AudioChannelSet::stereo())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#if ! JucePlugin_IsSynth
|
#if ! JucePlugin_IsSynth
|
||||||
if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
|
if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet())
|
||||||
return false;
|
return false;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
void PeteAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
|
||||||
void LampshadeAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)
|
|
||||||
{
|
{
|
||||||
static float incrementer;
|
static float incrementer;
|
||||||
const int totalNumInputChannels = getTotalNumInputChannels();
|
const int totalNumInputChannels = getTotalNumInputChannels();
|
||||||
const int totalNumOutputChannels = getTotalNumOutputChannels();
|
const int totalNumOutputChannels = getTotalNumOutputChannels();
|
||||||
|
|
||||||
// In case we have more outputs than inputs, this code clears any output
|
// In case we have more outputs than inputs, this code clears any output
|
||||||
// channels that didn't contain input data, (because these aren't
|
// channels that didn't contain input data, (because these aren't
|
||||||
// guaranteed to be empty - they may contain garbage).
|
// 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.
|
// this code if your algorithm always overwrites all the output channels.
|
||||||
for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
|
for (int i = totalNumInputChannels; i < totalNumOutputChannels; ++i)
|
||||||
buffer.clear(i, 0, buffer.getNumSamples());
|
buffer.clear(i, 0, buffer.getNumSamples());
|
||||||
|
|
||||||
float pitch = myYin.getPitch(buffer.getWritePointer (0)); // returns Pitch in Hertz
|
float pitch = myYin.getPitch(buffer.getWritePointer (0)); // returns Pitch in Hertz
|
||||||
static float myPitch;
|
static float myPitch;
|
||||||
if(pitch > 0) { myPitch = pitch; }
|
if(pitch > 0) { myPitch = pitch; }
|
||||||
@@ -120,26 +101,21 @@ void LampshadeAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffe
|
|||||||
}
|
}
|
||||||
printf("%f\n",channel1Data[0]);
|
printf("%f\n",channel1Data[0]);
|
||||||
}
|
}
|
||||||
|
bool PeteAudioProcessor::hasEditor() const
|
||||||
bool LampshadeAudioProcessor::hasEditor() const
|
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
AudioProcessorEditor* PeteAudioProcessor::createEditor()
|
||||||
AudioProcessorEditor* LampshadeAudioProcessor::createEditor()
|
|
||||||
{
|
{
|
||||||
return new LampshadeAudioProcessorEditor(*this);
|
return new PeteAudioProcessorEditor(*this);
|
||||||
}
|
}
|
||||||
|
void PeteAudioProcessor::getStateInformation (MemoryBlock& destData)
|
||||||
void LampshadeAudioProcessor::getStateInformation (MemoryBlock& destData)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void PeteAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
|
||||||
void LampshadeAudioProcessor::setStateInformation (const void* data, int sizeInBytes)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
AudioProcessor* JUCE_CALLTYPE createPluginFilter()
|
AudioProcessor* JUCE_CALLTYPE createPluginFilter()
|
||||||
{
|
{
|
||||||
return new LampshadeAudioProcessor();
|
return new PeteAudioProcessor();
|
||||||
}
|
}
|
||||||
|
@@ -1,42 +1 @@
|
|||||||
#pragma once
|
#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;
|
|
||||||
};
|
|
Binary file not shown.
17
test.RPP
17
test.RPP
@@ -1,4 +1,4 @@
|
|||||||
<REAPER_PROJECT 0.1 "5.40/OSX64" 1498532532
|
<REAPER_PROJECT 0.1 "5.40/OSX64" 1498539720
|
||||||
RIPPLE 0
|
RIPPLE 0
|
||||||
GROUPOVERRIDE 0 0 0
|
GROUPOVERRIDE 0 0 0
|
||||||
AUTOXFADE 1
|
AUTOXFADE 1
|
||||||
@@ -64,13 +64,22 @@
|
|||||||
MASTERHWOUT 0 0 1 0 0 0 0 -1
|
MASTERHWOUT 0 0 1 0 0 0 0 -1
|
||||||
MASTER_NCH 2 2
|
MASTER_NCH 2 2
|
||||||
MASTER_VOLUME 1 0 -1 -1 1
|
MASTER_VOLUME 1 0 -1 -1 1
|
||||||
MASTER_FX 0
|
MASTER_FX 1
|
||||||
MASTER_SEL 0
|
MASTER_SEL 0
|
||||||
<MASTERFXLIST
|
<MASTERFXLIST
|
||||||
WNDRECT 34 68 839 677
|
WNDRECT 34 69 839 676
|
||||||
SHOW 0
|
SHOW 0
|
||||||
LASTSEL 0
|
LASTSEL 0
|
||||||
DOCKED 0
|
DOCKED 0
|
||||||
|
BYPASS 0 0 0
|
||||||
|
<VST "VST: pete (yourcompany)" pete.vst 0 "" 1382378611
|
||||||
|
c2xlUu5e7f4CAAAAAQAAAAAAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAAAAAAACAAAAAAAAAAAABAA
|
||||||
|
776t3g3wrd4=
|
||||||
|
AAAQAAAA
|
||||||
|
>
|
||||||
|
FLOATPOS 0 0 0 0
|
||||||
|
FXID {C1E4684A-C510-DB43-B7BE-A481A4F2525D}
|
||||||
|
WAK 0
|
||||||
>
|
>
|
||||||
<MASTERPLAYSPEEDENV
|
<MASTERPLAYSPEEDENV
|
||||||
ACT 0
|
ACT 0
|
||||||
@@ -100,7 +109,7 @@
|
|||||||
BUSCOMP 0 0
|
BUSCOMP 0 0
|
||||||
SHOWINMIX 1 0.6667 0.5 1 0.5 0 0 0
|
SHOWINMIX 1 0.6667 0.5 1 0.5 0 0 0
|
||||||
FREEMODE 0
|
FREEMODE 0
|
||||||
SEL 1
|
SEL 0
|
||||||
REC 0 0 0 0 0 0 0
|
REC 0 0 0 0 0 0 0
|
||||||
VU 2
|
VU 2
|
||||||
TRACKHEIGHT 0 0
|
TRACKHEIGHT 0 0
|
||||||
|
Reference in New Issue
Block a user