Editing plugin: How to preview audio

Hey,

I’m working on a plugin to assist with editing vocals.
As part of the plugin I’d like to be able to let users preview small sections of a vocal, so that edits such as fade-lengths can be interactively adjusted.

I got something working by making my PluginEditor an AudioAppComponent. However, this seems very clunky and I fear compatibility issues, since I’m not working “with” the host.

Is there some way to implement preview in a more host-friendly way? I’ve been looking on the forums and there doesn’t seem to be consensus on what the proper way to achieve this is.

To be more precise, I’m not supposed to do the only thing that I have gotten to work so far…

From the docs for AudioAppComponent

This class should not be inherited when creating a plug-in as the host will handle audio streams from hardware devices.

Have you taken a look at ARA yet? That might give you the correct level of host communications that you are looking for.

Yes, I have looked into ARA, however Pro Tools is doing it’s own thing with regards to ARA (surprise surprise). So I am looking for a generic solution, but would be more than happy with a Pro Tools specific solution, too.

Pro Tools has an interface for this kind of thing in AAX (for Audiosuite) I believe but I’m not sure if it’s built in to JUCE. Maybe in the Sound Radix fork of JUCE?

Normally plugins work in real time for processing rather than editing so all the default behaviour is geared towards that. Pro Tools’s ‘capture’ and ‘render’ approach used by tools like RX connect and Sound Radix Auto Align would be more along these lines. You’d need to investigate the AAX SDK.

For anyone else working with AudioSuite, or GPT5, this is the best solution we’ve found (working with SoundRadix fork)

  • Enable preview
  • Add a listener for the event emitted by Pro Tools which informs your plugin on preview state (needs a modification in juce aax wrapper)
  • If in preview mode, just send whatever samples you want in processBlock
  • Otherwise render everything

Now, when users preview using the native AudioSuite function, they hear whatever you want them to hear at that time. Sadly, as of right now, it doesn’t seem possible to preview directly from the PluginEditor in AudioSuite, but lets hope for general ARA support soon…