Effect plug-in that can generate sound (AU/Logic)

Hi all, I’m working on a plug-in that is basically a granular synth/engine. The plug-in is primarily designed to process incoming audio, but I’ve designed it such that one could also just open a file and run the granular engine on the contents of that file. So it’s basically an effect that could also generate sound on its own, in some cases.

This seems to work fine in every environment that I’ve tested (Ableton, Bitwig, iOS AUM, iOS standalone, and standalone) except for Logic. Logic seems to care that my plug-in is declared as an “audio effect” and will refuse to let the plug-in play any sound of its own until the plug-in actually receives any sound. I’m seeing that when I load up an instance of my plug-in in Logic, processBlock isn’t called at all unless any audio gets sent to the plug-in (at which point Logic will save the state of the plug-in and reload it. with the specified state). So the user journey of opening the plug-in → loading an audio file → hearing the granular output from said file is totally borked in Logic, unless the user sends the plug-in audio first.

Is there a solution to this or am I SOL? I’m not sure if the plug-in being declared as an AUFX is the issue… Is there a different type of plug-in that it should be declared as? I see that I can declare “plug-in is a synth” in Projucer, but 1) I’m not sure if the plug-in will still be able to process audio if it’s a synth and 2) auval seems to get upset if the plug-in is declared as a synth but doesn’t accept MIDI. Perhaps I need to make the plug-in accept MIDI and do nothing with the result? It would also seem that whatever I do is really only necessary for the AU version since the VST3 and AUv3 version doesn’t seem to have any issues.

I guess the meat of the question is really whether an AU effect can act like an AU generator, or vice versa? Or is it possible to make a hybrid AU somehow?

I’ve been doing some research into this, and I’m starting to think that I might be SOL here, unless I make both an effect and generator/instrument version of my plug-in (and it would be kind of weird/impossible to make an “instrument” that ignores MIDI).

I realized that some tape plug-ins, like Arturia’s Tape Mello-fi, will affect audio as well as injecting noise into the signal as well. I verified in Logic that Tape Mello-fi does not inject that noise into the signal until it first receives audio, or unless it’s loaded onto a MIDI track with an actual instrument loaded (those two cases seem like the criteria Logic uses for determining if a track is silent or not, and therefore whether or not it starts running aufx on the channel).

So it seems like, short of some way to declare to Logic “please let me make noise!”, this just flat out won’t work…?

I would guess that Logic is so smart that it disables effect plugins (i.e., it won’t call processBlock or processBlockBypassed) when there is no audio going through. My EQ plugin has a similar issue and I give up on that :sweat_smile: I am also interested in a solution.

There are no solution besides being on some kind of white list defined by Logic team

Hi,

Have you tried configuring your plugin as a music effect?

As per the official docs from Apple:

A music effect unit (of type 'aumf') provides DSP, like an effect unit, but also responds to MIDI data, like an instrument unit. You build a music effect unit by subclassing the AUMIDIEffectBase superclass from the SDK. For example, you would do this to create an audio unit that provides a filtering effect that is tuned according to the note pressed on a keyboard.

Source: https://developer.apple.com/library/archive/documentation/MusicAudio/Conceptual/AudioUnitProgrammingGuide/TheAudioUnit/TheAudioUnit.html

When configuring your plugin, you can set AU_MAIN_TYPE to kAudioUnitType_MusicEffect to enable this behavior. It will let your plugin be loaded both as an effect and as a software instrument under the “AU MIDI-Controlled Effects” category in Logic Pro.

I haven’t tested if Logic Pro calls processBlock at all when there are no incoming MIDI messages, so that might still be an issue.

@otristan - This was pretty much my conclusion as well. I think what I’m just going to have to do is to throw up a warning in this situation and advise the user on how to fix it, since it’s just a limitation of AUv2s. It’s fairly easy to identify this situation too - I just periodically check if the wrapperType is AUv2, if the user has loaded a file, and whether processBlock has ever been called.

@bencekovacs - I had the same thought, and see my above comment. It turns out the Mello-fi is also an aumf, but it behaves in the same way as my plug-in - there’s no noise generated unless and until the plug-in receives signal (or is loaded onto a MIDI track with an instrument). Unless I’m misunderstanding, I think what I definitely don’t want to do is to have the plug-in show up as multiple versions or in multiple categories, since that would be kind of confusing… in that case, I’d want the effect version to only process incoming audio and the instrument version to only load files, and it seems like a lot of work to tease those apart and create special versions of the plug-in just for AUv2.

Oh, right, you have explored music effect units. Sorry for missing that detail.

In that case, I’d argue that what you’re describing goes against the normal UX for audio plugins. I would never expect an audio effect to act like a tone generator. That would be more confusing to me than having the plugin also show up as an instrument, which would then inform me it can also generate some sort of signal “on its own”. My 2 cents is most users would be able to understand this distinction.

I totally hear that, and this is pretty much where I take off my developer hat and put on my product manager and business owner hat, so the following might be more detail than you care to hear… :joy:

Personally, I’m coming from the opposite perspective. I’m coming from the Ableton/Bitwig/iOS workflow where it seems like plug-ins devices pretty much either deal with affecting/generating audio or deal with generating audio from MIDI, and they let you do whatever otherwise. The Logic/Pro Tools workflow of things being super categorized feels a bit too handhold-y to me personally. My company is also founded on the ethos of bringing a hardware-like workflow to DAW users, and virtually every hardware sampler under the sun will let you either record audio arbitrarily or load it from a file, so that’s a workflow I want to preserve.

I think I’m just going to release it as-is (with a warning message explaining what you need to do if you find yourself with no sound output) and I’ll see if people even use this feature or have complaints, because like I said earlier, my testers seemed to think it was a pretty niche feature and didn’t even try it until I asked about it (at which point we discovered this behavior). If there a bunch of complaints then I’ll have to rethink, but sometimes it seems best to just open the floodgates and see what happens :slight_smile:

1 Like