AU Synth Plugin Help needed


#1

Hi Juce folk, 

 

Im currently attempting to develop a synth with JUCE and building for AU. 

 

I have run into a few issues trying to set the plugin using the Is A Synth option and wondered if anyone can help me out. 

My project builds just fine but every time I try to load the AU in Logic pro 8 it causes Logic to crash. It also fails to open in the JUCE Plugin Host app. 

 

Could anyone give me a little advice on the correct setup for a synth plugin I.E AU Music Device type with a channel configuration of {0,1},{0,2}. Have also tried with channels set as {1,1},{2,2} to no avail. 

 

In logics AU validation checks the following error is showing on my plugin. 

 

Bad Max Frames - Render should fail

/Applications/Xcode.app/Contents/Developer/Extras/CoreAudio/AudioUnits/AUPublic/AUBase/AUBase.cpp:1439 inFramesToProcess=8192, mMaxFramesPerSlice=512; TooManyFrames

  from AU (0x810001): 'aumu' 'RudP' 'RudE', render err: -10874

  PASS

 

This also shows for the JUCE DEMO PLUGN however which seems to run fine (although ocasionally causes a crash on closing the Logic project it is hosted in).

 

If I change juce demo introjucer settings to Is A Synth it also fails to load but in this case logic does not even show the AU as available in channels etc. 

 

My Audio Processor processBlock call back is below. Essentially just a stripped down version of the demo plugin callback without the delay and gain processing. 

 

void RudeSynthPrototypeAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)

{

    const int numSamples = buffer.getNumSamples();

    int channel = 0

    

    // Now pass any incoming midi messages to our keyboard state object, and let it

    // add messages to the buffer if the user is clicking on the on-screen keys

    keyboardState.processNextMidiBuffer (midiMessages, 0, numSamples, true);

    

    // and now get the synth to process these midi events and generate its output.

     

synth.renderNextBlock (buffer, midiMessages, 0, numSamples);

        

for (channel = 0; channel < getNumOutputChannels(); ++channel)

        buffer.applyGain (channel, 0, buffer.getNumSamples(), gain);

}

 

I am aware that im most likely making some error in regards to how the buffer should be filled for my supplied channel configuration etc but at a bit of a loss as how I should be implementing this. 

Does anyone have any advice for setting up output for a synth.rendernextblock function when treating the plugin as a synth/instrument 

 

I have had my plugin runing at one point with all my dsp code etc working just fine but when trying to get the AU to be treated as a synth/instrument I'm coming across major issues. I've stripped the code down to bare bones for the moment just using Jules's sine wave approach in the synth voice and the only thing changed basically is the plugin editor as per the http://www.redwoodaudio.net/Tutorials/juce_for_vst_development__intro.html tutorial so that I am able to use the introjucers gui editor and the Is A Synth setup and channel configurations. 

 

Once I've got this working I shall keep some example code by and do some sort of post/thread for newbies like myself as suspect it would be useful.

 

Any Help would be much appreciated. 

(I have also changed juce demo plugins settings to Is A Synth and this is failing in Logic. Could someone possibly explain this AU setting to me ? )

Cheers


#2

I made a small mistake above. 

 

I have also attempted to run this without the following gain processing above. 

 

I.E 

 

void RudeSynthPrototypeAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages)

{

    const int numSamples = buffer.getNumSamples();

    int channel = 0

    

    // Now pass any incoming midi messages to our keyboard state object, and let it

    // add messages to the buffer if the user is clicking on the on-screen keys

    keyboardState.processNextMidiBuffer (midiMessages, 0, numSamples, true);

    

    // and now get the synth to process these midi events and generate its output.

     

synth.renderNextBlock (buffer, midiMessages, 0, numSamples);

}


#3

I'm a n00b at Juce/c++/etc but I did notice that in both of your examples, you're missing a semicolon after int channel = 0. Could that be throwing something off?


#4

That won't get compiled...