ARA Plugin working with only one track

Hi all, I’m new to ARA and I’m trying to understand how it works. I’d like to make an ARA plugin that loads only the track it’s on. I mean, consider a case where the DAW has multiple instances of the ARA Plugin on different tracks, one instance for each track. Each plugin should show only the track it’s on, and don’t show the others. Is this possible? How can I achieve it?

Now I’m testing the plugin with Reaper only.

Thank you!

Yes it is!
But how you decide which content of the ara model you want to display in the current ara editor can be tricky.

If you want to get demotivated just start looking into the Logic implementation for ara…

I check if the current instance is also a playback renderer. If thats the case, I will use the playback regions associated with this playback renderer. Thats by far the best way since it will always result in the correct content displayed.
In practice this is the case for ara in studio one (as clip fx) and reaper when added as clip fx (not when added into a tracks insert). Probably also for Cubase since its ara implementation is clip based, but I havent tested that yet.

Otherwise you can get the current selection in the DAW.
This is really annoying since a user could open the same instance later with a different selection, which leads to a lot confusion (as seen in some reaper forum posts etc.).
But right now there does not seem to be a better solution since Celemony does the same with Melodyne.
I will probably cache the last selection of a plugin instance an use this. Then I will only change this instances cached selection when its the one thats visible during the selection change.

By the way: getting the playback regions from the associated editor renderer did not work but I cant remember the reason for that…

I hope I didnt butcher the terminology too much since its pretty late right now :sweat_smile:

Anyways here is what Im doing right now:

{
    jassert (m_editorView);
    juce::Array<GapAudioSource*> sources;

    /*
     * First, try to get the associated playback regions from the connected plugin instances (editor and playback renderer).
     */
    if (processor->isPlaybackRenderer())
    {
        auto regions = processor->getPlaybackRenderer()->getPlaybackRegions();
        for (auto region : regions)
        {
            auto newAudioSource = region->getAudioModification()->getAudioSource<GapAraAudioSource>();
            if (newAudioSource)
                sources.addIfNotAlreadyThere (newAudioSource);
        }
        return sources;
    }

    auto addToSources = [&] (auto regions) {
        for (auto region : regions)
        {
            auto newAudioSource = region->getAudioModification()->template getAudioSource<GapAraAudioSource>();
            if (newAudioSource)
                sources.addIfNotAlreadyThere (newAudioSource);
        }
    };
    addToSources (m_editorView->getViewSelection().getPlaybackRegions());

    if (sources.size() > 0)
        return sources;

    addToSources (m_editorView->getViewSelection().getEffectivePlaybackRegions());

    if (sources.size() > 0)
        return sources;

    //use selected tracks?
    //use selected time range?

    return sources;
}

This is WIP so if somebody has a better way to handle this please let me know!

1 Like

In my ARA plugins, I offer 3 display modes:

  1. Only the regions corresponding to the plugin instance
  2. Only the selected regions (corresponding to a plugin instance)
  3. All the regions of the document (corresponding to a plugin instance)

On my side, solution 1 works with the editor renderer but this is not supported by Cubase. Something like that:

if(auto* editorRenderer = processor.getEditorRenderer())
{
    auto sequences = editorRenderer->getRegionSequences()
}
1 Like