AU automation problem


#1

Hi, I was checking the demo filter plugin on Mac and host automation
does not seem to work for the AU version of the plugin. The vst version was working ok. I tested with PPC Mac OSX Tiger, Logic 7 and Live 6.

Thanks


#2

Really? I’ve tried automation in Logic and am sure it worked… Are you using the basic juce demo?


#3

Yes (demojuceaudiounit.component), I am moving the gain slider but it does not record the changes.(ex. using Logic touch)


#4

Right. I’ve spent nearly two days looking at this and have to admit I’m completely stumped.

There was a mistake in my code - I should have been sending a notification to say a parameter has changed. All the AU samples and documentation do it like this:

[code] void informHostOfParameterChange (int index, float newValue)
{
if (juceFilter != 0)
{
juceFilter->setParameter (index, newValue);

        if (AUEventListenerNotify != 0)
        {
            AudioUnitEvent e;
            e.mEventType = kAudioUnitEvent_ParameterValueChange;
            e.mArgument.mParameter.mAudioUnit = GetComponentInstance();
            e.mArgument.mParameter.mParameterID = (AudioUnitParameterID) index;
            e.mArgument.mParameter.mScope = kAudioUnitScope_Global;
            e.mArgument.mParameter.mElement = 0;
            AUEventListenerNotify (0, 0, &e);
        }
    }
}

[/code]

…so I altered my method as above, but it still doesn’t work. Logic just either doesn’t get the message or ignores it.

I’m baffled, I’ve gone through every bit of my code and the demo code looking for differences, but can’t find anything that might affect this. They also have a concept of begin/end messages to say when you’re about to start changing a param, so I tried using those as well, but this made no difference at all.

Any suggestions welcome, as I’m really out of ideas on this one!


#5

Hi Jules,

I have tested your changes on my new Intel Mac and the parameter automation is working for Live 6.

I will do some more testing on PPC Mac and Logic and let you know.

Regards
K.


#6

Hi Jules,

I have tested Live 6 on PPC and automation works as well (with the changes you have made), Logic though is not working.
It looks as Logic might need some extra events??

regards
K.


#7

That’s interesting - although I’ve no idea at all what extra events we could try! I spent a long time searching for examples/docs but didn’t come up with any other clues at all…


#8

Hi Jules,

I found the following information specific to Logic Automation.
I hope that this helps.

Regards
K.

For plug-in parameter automation in combination with custom interfaces, it is essential that Audio
Unit plug-ins send the events ‘kAudioUnitCarbonViewEvent_MouseDownInControl’ and
‘kAudioUnitCarbonViewEvent_MouseUpInControl’ and use the parameter listener scheme to inform
the host of parameter changes.


#9

Hmm. I’m pretty sure I tried that one, but it’s worth another go, I guess!

I’m busy today, but if you want to try it, the quickest way is just to send the down/up events before and after the code snippet above.


#10

Thanks Jules


#11

Hi guys, I investigated some month ago around this problem of notifying au parameters automation to the host. It is not easy as for VST, a little more complicated.

This is the starting point: http://developer.apple.com/technotes/tn2002/tn2104.html


#12

Yeah, that’s the webpage that I was working from, but using the code that’s there doesn’t seem to work in Logic (but it does work in Live…)


#13

Hi,

I have tried sending the following events
kAudioUnitEvent_BeginParameterChangeGesture
kAudioUnitEvent_EndParameterChangeGesture

kAudioUnitCarbonViewEvent_MouseDownInControl
kAudioUnitCarbonViewEvent_MouseUpInControl

but still Logic automation does not work. I am quite new on Mac and AU
(I first set my hands on a Mac four months ago) so I do not know if I
do things the correct way. Any AU experts help?

From the Apple filter example I see a lot of work with properties; what is the relation between properties and parameters?

Thanks


#14

Yeah, I tried all those events too, and it made no difference at all. No idea what’s going on there.

Parameters are numeric and can be changed by the host; properties are just places to store other kinds of data.


#15

Hi Jules,

I have tried some other things like setting the jucedemo to be an
effect aufx, set JucePlugin_EditorRequiresKeyboardFocus = 0, and used the au validation tool for both setups as fx or synth (validates ok) but still
not working in Logic.

From your site it seems that companies like korg, m-audio etc are using
juce for commercial products as us; is it possible to ask help from them how they handle this problem?


#16

The parameters were not available in the logic automation menu, this code fixes the problem. Must have been something with the CFString that didn’t allow logic to display it.

ComponentResult GetParameterInfo (AudioUnitScope inScope,
AudioUnitParameterID inParameterID,
AudioUnitParameterInfo& outParameterInfo)
{
if (inScope == kAudioUnitScope_Global && juceFilter != 0)
{
outParameterInfo.flags = kAudioUnitParameterFlag_IsWritable
| kAudioUnitParameterFlag_IsReadable ;

    AUBase::FillInParameterName (outParameterInfo, 
        PlatformUtilities::juceStringToCFString (juceFilter->getParameterName ((int) inParameterID)),
        false ) ;

    outParameterInfo.minValue     = 0.0f;
    outParameterInfo.maxValue     =1.0f;
    outParameterInfo.defaultValue = 0.0f;
    outParameterInfo.unit         = kAudioUnitParameterUnit_Generic;

    return noErr;
}
else
{
    return kAudioUnitErr_InvalidParameter;
}

}


#17

Thanks - though I’d already checked-in a fix for this if you grab the tip of the source tree. I didn’t know about that FillInParameterName call though, I might change it to use that instead.


#18

Hi Jules,Kenneth
I tried the code supplied by Kenneth by replacing the GetParameterInfo function in the AUwrapper but still no automation in Logic. I am using juce 1.43, should I recompile with 1.44 for the code to work?
Jules is your fix in 1.44 release?

Thanks


#19

I am compiling against the 1.44.
None of the parameters were being displayed in the logic automation menu for the plugin until I put my patch. I assume that taking from the head will also fix it as Jules said.

Hey Jules, how about upgrading me from a Weenie? :slight_smile:


#20

I’m afraid that’s out of my hands… You’re at the mercy of the phpbb server to give out promotions!