Merge branch 'master' of https://github.com/hellerve/lampshade
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,3 +3,4 @@ JuceLibraryCode/
|
||||
Builds/
|
||||
*bak
|
||||
*jucer
|
||||
*RPP
|
||||
|
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# pete
|
||||
|
||||
A VST plugin with JUCE. It makes noise. Stay tuned.
|
@@ -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,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();
|
||||
}
|
||||
|
@@ -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;
|
||||
};
|
||||
|
Binary file not shown.
174
test.RPP
174
test.RPP
@@ -1,174 +0,0 @@
|
||||
<REAPER_PROJECT 0.1 "5.40/OSX64" 1498537701
|
||||
RIPPLE 0
|
||||
GROUPOVERRIDE 0 0 0
|
||||
AUTOXFADE 1
|
||||
ENVATTACH 1
|
||||
MIXERUIFLAGS 11 48
|
||||
PEAKGAIN 1
|
||||
FEEDBACK 0
|
||||
PANLAW 1
|
||||
PROJOFFS 0 0
|
||||
MAXPROJLEN 0 600
|
||||
GRID 3199 8 1 8 1 0 0 0
|
||||
TIMEMODE 1 5 -1 30 0
|
||||
VIDEO_CONFIG 0 0 256
|
||||
PANMODE 3
|
||||
CURSOR 2.5
|
||||
ZOOM 100 0 0
|
||||
VZOOMEX 6
|
||||
USE_REC_CFG 0
|
||||
RECMODE 1
|
||||
SMPTESYNC 0 30 100 40 1000 300 0 0 1 0 0
|
||||
LOOP 0
|
||||
LOOPGRAN 0 4
|
||||
RECORD_PATH "" ""
|
||||
<RECORD_CFG
|
||||
>
|
||||
<APPLYFX_CFG
|
||||
>
|
||||
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
|
||||
<RENDER_CFG
|
||||
>
|
||||
LOCK 16385
|
||||
<METRONOME 6 2
|
||||
VOL 0.25 0.125
|
||||
FREQ 800 1600 1
|
||||
BEATLEN 4
|
||||
SAMPLES "" ""
|
||||
PATTERN 2863311530 2863311529
|
||||
>
|
||||
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
|
||||
<MASTERFXLIST
|
||||
WNDRECT 34 68 839 677
|
||||
SHOW 0
|
||||
LASTSEL 0
|
||||
DOCKED 0
|
||||
>
|
||||
<MASTERPLAYSPEEDENV
|
||||
ACT 0
|
||||
VIS 0 1 1
|
||||
LANEHEIGHT 0 0
|
||||
ARM 0
|
||||
DEFSHAPE 0 -1 -1
|
||||
>
|
||||
<TEMPOENVEX
|
||||
ACT 0
|
||||
VIS 1 0 1
|
||||
LANEHEIGHT 0 0
|
||||
ARM 0
|
||||
DEFSHAPE 1 -1 -1
|
||||
>
|
||||
<PROJBAY
|
||||
>
|
||||
<TRACK {0285AA2F-2341-854C-BBEE-985C6E7A9ADD}
|
||||
NAME "0001 3-Audio"
|
||||
PEAKCOL 16576
|
||||
BEAT -1
|
||||
AUTOMODE 0
|
||||
VOLPAN 1 0 -1 -1 1
|
||||
MUTESOLO 0 0 0
|
||||
IPHASE 0
|
||||
ISBUS 0 0
|
||||
BUSCOMP 0 0
|
||||
SHOWINMIX 1 0.6667 0.5 1 0.5 0 0 0
|
||||
FREEMODE 0
|
||||
SEL 1
|
||||
REC 0 0 0 0 0 0 0
|
||||
VU 2
|
||||
TRACKHEIGHT 0 0
|
||||
INQ 0 0 0 0.5 100 0 0 100
|
||||
NCHAN 2
|
||||
FX 1
|
||||
TRACKID {0285AA2F-2341-854C-BBEE-985C6E7A9ADD}
|
||||
PERF 0
|
||||
MIDIOUT -1
|
||||
MAINSEND 1 0
|
||||
<FXCHAIN
|
||||
WNDRECT 125 169 839 676
|
||||
SHOW 0
|
||||
LASTSEL 0
|
||||
DOCKED 0
|
||||
BYPASS 0 0 0
|
||||
<VST "VST: lampshade (yourcompany)" lampshade.vst 0 "" 1382378611
|
||||
c2xlUu5e7f4CAAAAAQAAAAAAAAACAAAAAAAAAAIAAAABAAAAAAAAAAIAAAAAAAAACAAAAAAAAAAAABAA
|
||||
776t3g3wrd4=
|
||||
AAAQAAAA
|
||||
>
|
||||
FLOATPOS 0 0 0 0
|
||||
FXID {B7DD42FB-8D0E-C24C-924A-407EC4334EB7}
|
||||
WAK 0
|
||||
>
|
||||
<ITEM
|
||||
POSITION 0
|
||||
SNAPOFFS 0
|
||||
LENGTH 2.368
|
||||
LOOP 1
|
||||
ALLTAKES 0
|
||||
FADEIN 1 0.01 0 1 0 0
|
||||
FADEOUT 1 0.01 0 1 0 0
|
||||
MUTE 0
|
||||
SEL 0
|
||||
IGUID {40DBFCD1-92BE-4748-9291-13EFE644D598}
|
||||
IID 1
|
||||
NAME "0001 3-Audio.wav"
|
||||
VOLPAN 1 0 1 -1
|
||||
SOFFS 0
|
||||
PLAYRATE 1 1 0 -1 0 0.0025
|
||||
CHANMODE 0
|
||||
GUID {76289E0D-F3CA-8942-B926-B9E354D05BC9}
|
||||
<SOURCE WAVE
|
||||
FILE "test Project/Samples/Recorded/0001 3-Audio.wav"
|
||||
>
|
||||
>
|
||||
<ITEM
|
||||
POSITION 2.5
|
||||
SNAPOFFS 0
|
||||
LENGTH 2.85605442176871
|
||||
LOOP 1
|
||||
ALLTAKES 0
|
||||
FADEIN 1 0.01 0 1 0 0
|
||||
FADEOUT 1 0.01 0 1 0 0
|
||||
MUTE 0
|
||||
SEL 0
|
||||
IGUID {40AE50E4-88C5-B04D-BC5B-0252C25CB29D}
|
||||
IID 2
|
||||
NAME "0002 3-Audio-1.wav"
|
||||
VOLPAN 1 0 1 -1
|
||||
SOFFS 0
|
||||
PLAYRATE 1 1 0 -1 0 0.0025
|
||||
CHANMODE 0
|
||||
GUID {5224CF49-4571-E246-A76E-9A2EA5058049}
|
||||
<SOURCE WAVE
|
||||
FILE "test Project/Samples/Recorded/0002 3-Audio-1.wav"
|
||||
>
|
||||
>
|
||||
>
|
||||
>
|
2
wrLib
2
wrLib
Submodule wrLib updated: a4e5fa1c58...76147e53b1
Reference in New Issue
Block a user