So I’m trying to implement C++ code produced from HEAVY in my JUCE project. I’ve decided to lift the functionality from the HEAVY code and try implement it directly into my JUCE project, taking the generator and calling it from the ‘processingBlock’.
The issue I’m having is that I need to call the constructor for “audioEffectX” in my main class which is “Animal_generator_krotosAudioProcessor”. There is a lot of stuff that has been auto-generated from HEAVY so it can be quite messy to work with. Can someone look at how I’m calling this constructor and explain why Xcode is complaining about it.
This is my .cpp file:
/* ==============================================================================
This file was auto-generated!
It contains the basic framework code for a JUCE plugin processor.
============================================================================== */
#include "PluginProcessor.h" #include "PluginEditor.h" #include "HeavyVst2_creatureSynthHL.h" #include "HvUtils.h"
#define HV_VST2_NUM_PARAMETERS 5
//============================================================================== Animal_generator_krotosAudioProcessor::Animal_generator_krotosAudioProcessor(audioMasterCallback amCallback) #ifndef JucePlugin_PreferredChannelConfigurations : AudioProcessor (BusesProperties() #if ! JucePlugin_IsMidiEffect #if ! JucePlugin_IsSynth .withInput ("Input", AudioChannelSet::stereo(), true) #endif .withOutput ("Output", AudioChannelSet::stereo(), true) #endif ) #endif { //constructor },
AudioEffectX(amCallback, 0, HV_VST2_NUM_PARAMETERS) { setUniqueID(0x2FEC904B); setNumInputs(0); setNumOutputs(2); isSynth(true); canProcessReplacing(true); canDoubleReplacing(false); // initialise parameters with defaults _parameters[0] = 0.5f; // aggression _parameters[1] = 0.5f; // excitation _parameters[2] = 0.5f; // mouthScale _parameters[3] = 1.0f; // rippleScale _parameters[4] = 0.5f; // size _context = NULL; this->sampleRate = 0.0f; // initialise sample rate setSampleRate(44100.0f); // set sample rate to some default }
Animal_generator_krotosAudioProcessor::~Animal_generator_krotosAudioProcessor() { if (_context != NULL) hv_creatureSynthHL_free(_context); }
This is my .h file:
/*
==============================================================================
This file was auto-generated!
It contains the basic framework code for a JUCE plugin processor.
==============================================================================
*/
#ifndef PLUGINPROCESSOR_H_INCLUDED
#define PLUGINPROCESSOR_H_INCLUDED
#include "../JuceLibraryCode/JuceHeader.h"
#include "Generator/vst2/audioeffectx.h"
#include "Heavy_creatureSynthHL.h"
//==============================================================================
/**
*/
class Animal_generator_krotosAudioProcessor : public AudioProcessor, public AudioEffectX
{
public:
//==============================================================================
Animal_generator_krotosAudioProcessor(audioMasterCallback amCallback);
~Animal_generator_krotosAudioProcessor();
//==============================================================================
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;
//==============================================================================
//From 'HeavyVst2_creatureSynthHL'
void setSampleRate(float sampleRate) override;
void setParameter(VstInt32 index, float value) override;
float getParameter(VstInt32 index) override;
void getParameterDisplay(VstInt32 index, char* text) override;
void getParameterName(VstInt32 index, char* text) override;
bool string2parameter(VstInt32 index, char* text) override;
VstInt32 canDo(char *text) override;
void processReplacing(float** inputs, float** outputs, VstInt32 sampleFrames) override;
VstInt32 processEvents(VstEvents* events) override;
bool getEffectName(char* name) override;
bool getVendorString(char* text) override;
VstInt32 getChunk(void** data, bool isPreset) override;
VstInt32 setChunk(void* data, VstInt32 byteSize, bool isPreset) override;
//===============================================================================
If someone can let me know where I’m going wrong here that would be great!