# Audio Processor &p provides no initializer for:

**URL:** <https://forum.juce.com/t/audio-processor-p-provides-no-initializer-for/51841>\
**Category:** Audio Plugins\
**Created:** [June 17, 2022, 3:23am UTC](https://forum.juce.com/t/audio-processor-p-provides-no-initializer-for/51841 "2022-06-17T03:23:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![craftono](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/craftono/32/13557_2.png) [@craftono](https://forum.juce.com/u/craftono)\
**Post date:** [June 17, 2022, 3:23am UTC](https://forum.juce.com/t/audio-processor-p-provides-no-initializer-for/51841/1 "2022-06-17T03:23:29Z")

</div>

Hi I am a beginner to JUCE and C++ in general and I am following the Audio Programmers Guide for making a sampler, and I am getting one final error that I can not figure out. It says: Audio Processor &p provides no initializer for:  
Any help would be appreciated!  
Here is the code I have:  
PluginEditor.cpp

```auto
InstrumentLibraryOneAudioProcessorEditor::InstrumentLibraryOneAudioProcessorEditor (InstrumentLibraryOneAudioProcessor& p)
    : AudioProcessorEditor (&p), audioProcessor (p)
{
    // Make sure that before the constructor has finished, you've set the
    // editor's size to whatever you need it to be.
  
    
    addAndMakeVisible(samplerButton);  
    samplerButton.onClick = [&]() {processor.loadFile(); };
    setSize(800, 500);
}

```

pluginEditor.h:

```auto
private:
    InstrumentLibraryOneAudioProcessor& audioProcessor;
    juce::TextButton samplerButton{ "Sampler" };

    InstrumentLibraryOneAudioProcessor& processor;
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InstrumentLibraryOneAudioProcessorEditor)

```

pluginprocessor.cpp

```auto
InstrumentLibraryOneAudioProcessor::InstrumentLibraryOneAudioProcessor()
#ifndef JucePlugin_PreferredChannelConfigurations
     : AudioProcessor (BusesProperties()
                     #if ! JucePlugin_IsMidiEffect
                      #if ! JucePlugin_IsSynth
                       .withInput ("Input", juce::AudioChannelSet::stereo(), true)
                      #endif
                       .withOutput ("Output", juce::AudioChannelSet::stereo(), true)
                     #endif
                       )
#endif
{
    for (int i = 0; i < numVoices; i++)
    {
        formatManager.registerBasicFormats();

        mSampler.addVoice(new SamplerVoice());
    }
}

InstrumentLibraryOneAudioProcessor::~InstrumentLibraryOneAudioProcessor()
{
    formatReader = nullptr;
}

void InstrumentLibraryOneAudioProcessor::loadFile()
{
    FileChooser chooser{ "Select Audio File" };

    if (chooser.browseForFileToOpen())
    {
        auto file = chooser.getResult();
        formatReader = formatManager.createReaderFor(file);
    }
    BigInteger range;
    range.setRange(0, 128, true);

    mSampler.addSound(new SamplerSound("Sample", *formatReader, range, 60, 0.1, 0.1, 10));
}

```

pluginprocessor.h

```auto
private:
    Synthesiser mSampler;
    const int numVoices{ 6 };
    AudioFormatManager formatManager;
    AudioFormatReader* formatReader{ nullptr };
    
    JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (InstrumentLibraryOneAudioProcessor)

```

I did not include the whole code, only the sections I changed.
