# AU automation recording problems in Digital Performer/Logic

**URL:** <https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651>\
**Category:** Audio Plugins\
**Created:** [March 13, 2008, 10:57am UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651 "2008-03-13T10:57:39Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 13, 2008, 10:57am UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/1 "2008-03-13T10:57:39Z")

</div>

A user of my plugin has found some strange bug:

> [@](#):
>
> Seems to work ok from limited testing done, except for automation: moves on the gui don’t get written to DP; I can automate it and write moves to DP using my Novation Remote SL midi controller, but playback of these moves is sketchy – Transient Shaper will only read and play back these recorded moves if you first click on each of the gui’s knob

Why does it only work after the user clicked the knob? Seems strange, because it’s not only a GUI issue, but the user also not hears the changes until he clicks the knobs,…

In Logic Express 7 trial (free download), automation recording does not work either. In Ableton it does. Playback works in Logic and Ableton.

Same problem with Juce AU Demo.

I compiled with 1.44 (wrote 1.45 before, which was not correct, I’m trying with 1.45 now).

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 13, 2008, 12:29pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/2 "2008-03-13T12:29:28Z")

</div>

I’ll add it to my list of AU issues to look at…

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 14, 2008, 4:52pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/3 "2008-03-14T16:52:00Z")

</div>

Just tried with Juce 1.45. It’s all the same. I think this is an important issue, because Logic is for sure the most important sequencer on Mac. Do you perhaps know what it could be? I checked the AU code, and the only thing I noticed that is more or less different from the FilterDemo AU code is that there are no listeners registered for notifications, although this should not be a problem?

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 15, 2008, 9:23am UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/4 "2008-03-15T09:23:01Z")

</div>

After several hours of searching, it seems I have found what the problem is.  
This code is from Destroy FX’s RMS Buddy:

OSStatus RMSBuddyEditor::SendAUParameterEvent(AudioUnitParameterID inParameterID, AudioUnitEventType inEventType)  
{  
// we’re not actually prepared to do anything at this point if we don’t yet know which AU we are controlling  
if (GetEditAudioUnit() == NULL)  
return kAudioUnitErr\_Uninitialized;

```
OSStatus result = noErr;

// do the current way, if it's available on the user's system
AudioUnitEvent paramEvent;
paramEvent.mEventType = inEventType;
paramEvent.mArgument.mParameter.mParameterID = inParameterID;
paramEvent.mArgument.mParameter.mAudioUnit = GetEditAudioUnit();
paramEvent.mArgument.mParameter.mScope = kAudioUnitScope_Global;
paramEvent.mArgument.mParameter.mElement = 0;
if (AUEventListenerNotify != NULL)
	result = AUEventListenerNotify(NULL, NULL, &paramEvent);

```

//return result; // \<---- IF THIS IS UNCOMMENTED, LOGIC 7 WILL STOP RESPONDING TO AUTOMATION

```
// as a back-up, also still do the old way, until it's enough obsolete
if (mEventListener != NULL)
{
	AudioUnitCarbonViewEventID carbonViewEventType = -1;
	if (inEventType == kAudioUnitEvent_BeginParameterChangeGesture)
		carbonViewEventType = kAudioUnitCarbonViewEvent_MouseDownInControl;
	else if (inEventType == kAudioUnitEvent_EndParameterChangeGesture)
		carbonViewEventType = kAudioUnitCarbonViewEvent_MouseUpInControl;
	(*mEventListener)(mEventListenerUserData, GetComponentInstance(), &(paramEvent.mArgument.mParameter), carbonViewEventType, NULL);
}

return result;

```

}

I compiled RMSBuddy once normally and it worked in Logic. Then I put the commented line into the code and then after compiling again automation recording stopped working. I also read on some pages that the “oldfashioned” mEventListener way works, whereas the AUEventListenerNotify way can cause strange bugs.

Also check this out: [http://lists.apple.com/archives/coreaudio-api/2005/Nov/msg00174.html](http://lists.apple.com/archives/coreaudio-api/2005/Nov/msg00174.html)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 16, 2008, 12:04pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/5 "2008-03-16T12:04:35Z")

</div>

Right… So this kind of thing might work?

[code] void sendAUEvent (const AudioUnitEventType type, const int index) throw()  
{  
if (AUEventListenerNotify != 0)  
{  
auEvent.mEventType = type;  
auEvent.mArgument.mParameter.mParameterID = (AudioUnitParameterID) index;  
AUEventListenerNotify (0, 0, &auEvent);  
}

```
    if ((type == kAudioUnitEvent_BeginParameterChangeGesture 
          || type == kAudioUnitEvent_EndParameterChangeGesture)
         && mEventListener != 0)
    {
        (*mEventListener) (mEventListenerUserData, GetComponentInstance(),
                           &(auEvent.mArgument.mParameter),
                           type == kAudioUnitEvent_BeginParameterChangeGesture
                             ? kAudioUnitCarbonViewEvent_MouseDownInControl
                             : kAudioUnitCarbonViewEvent_MouseUpInControl,
                           0);
    }
}

```

[/code]

(P.S. I’ve not got my mac with me right now to try this out, so haven’t even checked if this compiles…)

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 16, 2008, 2:32pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/6 "2008-03-16T14:32:45Z")

</div>

I haven’t compiled yet, but I think one would have to first get the mEventListener function’s pointer, which is part of JuceAUView (becaused it inherits from AUCarbonView where the pointer is in), and not of JuceAUBaseClass / AUMIDIEffectBase. Is there some simple way to retrieve the AUCarbonView pointer? If yes, one just has to get the pointer and then it should work.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 16, 2008, 3:02pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/7 "2008-03-16T15:02:13Z")

</div>

It’s quite hard to find the view from the effect, but you could do it in the other direction, and pass that function pointer to the effect during the view’s constructor. Might need a bit of hackery to get there.

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 16, 2008, 4:25pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/8 "2008-03-16T16:25:56Z")

</div>

when I copy the mEventListener and mEventListenerUserData in the JuceAUView constructor to the JuceAU, I just get a crash. I do it like this:

((JuceAU\*)GetEditAudioUnit())-\>mEventListener=mEventListener;  
((JuceAU\*)GetEditAudioUnit())-\>mEventListenerUserData=mEventListenerUserData;

I also tried to do it in the CreateUI function, but then it seems like the mEventListener will be set to NULL (or not modified?).

Even if I do this copying in the timerCallback() mEventListener still stays NULL.

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 16, 2008, 4:49pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/9 "2008-03-16T16:49:35Z")

</div>

Like I said, it requires a certain amount of cunningness… I’ve checked in a version now that you might want to try out.

I’m having a terrible time trying to build it under 10.5 though - all the apple files are failing to build in stupid ways. What config are you using?

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 16, 2008, 5:09pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/10 "2008-03-16T17:09:20Z")

</div>

I just found out that the function AUCarbonViewBase::ComponentEntryDispatch() is responsibe for setting the mEventListener. I guess this one never gets called and that’s why the mEventListener stays NULL?

I don’t know what this function is for, are you sure it gets called?

I have an IBook G4 with Tiger 10.4.10. And since my XCode is soooo slow on this machine it’s really PITA for me to code or even compile on it… (when source files get too big, I just have to spend some time drinking coffee until the wheel-of-death dissapears)…

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 16, 2008, 5:58pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/11 "2008-03-16T17:58:37Z")

</div>

Just tried your code, it starts working 🙂 But when I move the slider, the automated value jumps to the selected value once, and then goes back immediately to 0 and stays there even if I continue moving the slider. When I release it, and start over again, it again jumps to the actual slider value and then it goes back to 0 immediately.

Sometimes the automated parameter also changes, but it just changes at position 0 (so I get a straight horizontal automation line which varies in height).

Strange issues here… Anyway, you might check this out with Logic Trial yourself. I can’t find the reasons for this strange behaviour.

BTW that was in Juce Demo AU, forgot to mention. Just added the beginParameterChangeGesture and endParameterChangeGesture functions to the sliderDragStarted and sliderDragEnded listener functions.

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 17, 2008, 12:35pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/12 "2008-03-17T12:35:28Z")

</div>

Anyone else tried automation in Juce Demo AU with the latest SVN in Logic ?

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 18, 2008, 8:02am UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/13 "2008-03-18T08:02:17Z")

</div>

Jules, if you have any hint where I can look at to finally get rid of this bug (I think there’s another post from August 2007 where the bug is already described!), please let me know. So I can check what I can do.

If you need Logic Express 7 Trial (works fully for 1 week, I think), I can upload it somewhere for you.

Thanks.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [March 18, 2008, 9:06am UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/14 "2008-03-18T09:06:51Z")

</div>

All I actually need is some free time to spend looking at this, but that’s quite difficult to find at the moment…

I added code to use the old-fashioned way of sending the start/end gestures, but maybe there’s also an old-fashioned way to send the kAudioUnitEvent\_ParameterValueChange event?

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 18, 2008, 10:19am UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/15 "2008-03-18T10:19:49Z")

</div>

You can also use AUParameterSet() instead, but it’s just all the same - same weird automation recording behaviour.

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 19, 2008, 1:45pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/16 "2008-03-19T13:45:56Z")

</div>

Perhaps any other idea where I could look at? Can’t possibly sell my product with this bug…

---

<div class="post-metadata">

**Author:** ![asomers](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@asomers](https://forum.juce.com/u/asomers)\
**Post date:** [March 20, 2008, 6:50am UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/17 "2008-03-20T06:50:43Z")

</div>

> [@zamrate](#):
>
> Anyone else tried automation in Juce Demo AU with the latest SVN in Logic ?

Just to respond to this: yes, I am having this problem too. The project’s on hold right now but you may be hearing more from me shortly.

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [March 26, 2008, 12:59pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/18 "2008-03-26T12:59:59Z")

</div>

Have you already found something?

---

<div class="post-metadata">

**Author:** ![asomers](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@asomers](https://forum.juce.com/u/asomers)\
**Post date:** [April 5, 2008, 9:55pm UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/19 "2008-04-05T21:55:54Z")

</div>

Ok. Duh.

The control gestures are not being made in the demo AU.

EDIT:  
OLD BAD INFO EDITED OUT

You have to override SliderListener:: sliderDragStarted and sliderDragEnded to call beginParameterChangeGesture and endParameterChangeGesture. Otherwise automation does not work, at least in 10.5.2 and Logic 8.

```auto
void DemoEditorComponent::sliderDragStarted(Slider *)
{
	getFilter()->beginParameterChangeGesture(0);
}

void DemoEditorComponent::sliderDragEnded(Slider *)
{
	getFilter()->endParameterChangeGesture(0);
}
```

---

<div class="post-metadata">

**Author:** ![zamrate](https://avatars.discourse-cdn.com/v4/letter/z/f4b2a3/32.png) [@zamrate](https://forum.juce.com/u/zamrate)\
**Post date:** [April 6, 2008, 8:52am UTC](https://forum.juce.com/t/au-automation-recording-problems-in-digital-performer-logic/2651/20 "2008-04-06T08:52:56Z")

</div>

Yes, first one has to use the gesture functions. But in my case, it was the Timer that was not working correctly, so I decided to rewrite it using Carbon Timer API and now it works. Check this thread:  
[http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=2650&start=15](http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=2650&start=15)
