Merge branch 'master' of https://github.com/hellerve/lampshade
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user