What are the best options for a JUCE plug-in or external process to control a host transport?
- Set host’s tempo
- Set host’s locator (playhead position)
- Start, Stop host playback
ReWire worked fine for this while it was still supported. Now that it’s deprecated, there don’t seem to be many options left. MIDI sync works but is cumbersome to setup.
Does ARA implement any of these?
Does Ableton Link?
I checked both APIs but may have missed something.
afaik you’re out of luck, the common plugin standards don’t provide interfaces for taking over host control. But there may be vendor specific extensions, for example the Reaper VST extensions allow very deep integration (but only work for Reaper).
Yes, you can control the playback, the play-head position, and the loop. And you can analyze the tempo.
Thanks. I’ll have a deeper look at the ARA API, although setting the (global default) tempo is quite important. Reading it isn’t enough.
I already pondered using a combination of multiple protocols and APIs (Ableton Link, MTC, MMC, scripting, keyboard injection) and implement a specific configuration per each individual DAW host, but that comes with a long term maintenance burden I want to avoid. Relying on undocumented stuff is never a good idea.
I meant that your ARA plugin can analyze the tempo of the audio regions and/or audio tracks and I think that you can notify the host of this.
Ah great, will check if that notification actually changes a host’s tempo.
ARA requires major reworking of the plugin, though. You have to implement several ARA-specific classes, and if you’re loading as an ARA plugin, users are likely to expect a lot of ARA-specific bells and whistles that are not generally seen in non-ARA plugins. It’s not just something you can plop into your plugin and grab this one feature.
I would imagine that changing the hosts tempo is not as trivial as it sounds. In Cubase/Nuendo, you can automate tempo and signature. Tempo can even be ramped. This even has bugs: A plugin with latency will receive wrong bpm information (meaning that BPM and the other data you get in ProcessBlock, like MIDI and Audio, are offsync, ruining DAW synchronization schemes). It’s also obvious that a playhead state at process block start is insufficient if tempo is automated continuously. Same problem as with non-sample-accurate automation in general, but more problematic overall since you can’t easily smooth it all away.
Given that, how would setting the play position and tempo work in case all of it is automated in the DAW? Theoretically, you’d need to know the whole tempo/signature automation timeline of the project, and produce edits. You’d at least need to catch the case that it did not work because it’s overruled by the DAW. Feels like a rabbit hole.
Have another Cubase-related case where behaviour is undefined to the point of being random: Offline processing. In Reaper the equivalent System is TakeFX, in Protools it’s Audiosuite. You can “bake” plugin processing into a clip/part/mediaitem.
In the case of cubase, if you do that, the plugins playhead will be set to whatever the locator position in the project is once you apply the plugin. I’d expect it to be either the items start in the project, or at least 0, but as it turns out this is not defined by the VST standard, and thus it’s impossible to say what would be correct behavior. I haven’t looked into how Reaper and Protools handle it.
The plugin can’t know via the normal APIs.
The whole idea of interacting with the project is absurd in this situation, but you’d definitely need to handle it in some fashion.
ARA provides a solution for this kind of scenario as far as I know, but as has been stated before, it’s quite complex, being a special mode of operation, and not something you can just slap on a plugin to extend it’s functionality.
Tempo sync is indeed pretty complex.
My use case is to remote-control a DAW transport over a network connection as a preparation for subsequent playback synchronized with another application. Constant tempo is a prerequisite.
So the plug-in is merely supposed to be a device that brings “remote control” capability into the DAW. If synch could be achieved by other means, that would be fine too.
Tempo synch could be achieved by Ableton Link. Unfortunately Ableton Link lacks support for absolute positioning. Extending its API may be ideal, but I have my doubts that Ableton is very responsive to feature suggestions.
Hey @PierreGuillot ,
Yes, you can control the playback, the play-head position, and the loop.
Would you mind shedding some light on how to do that with the ARA API?
I can read all the playback state info just fine from the different renderers, but is there really a way to control the host playback? I can’t find any documentation regarding that and the examples also don’t seem to implement it, as far as I can tell
It’s worth noting, that this might be achievable by MIDI over Mackie MCU protocol.
You can look at the class ARA::PlugIn::HostPlaybackController and the methods requestStop/StartPlayback(), requestSetCycleRange(), requestEnableCycle().
For controlling host transport without ReWire, MIDI sync remains your best bet, despite its setup complexities. ARA is more about audio editing, not transport control. Ableton Link is great for tempo sync across devices but doesn’t control playhead or transport.
No idea, why I was not able to find that class myself, but for anyone else searching for this have a look in
You won’t need to create your own instance of this, but rather your document controller already has one (and you also can’t run two instances concurrently it seems).
ARA::DocumentController::getHostPlaybackController () to get a pointer to the active HostPlaybackController
Thanks for your help @PierreGuillot, works exactly as intended!
(P.S. i know that for OP MIDI control is probably the best bet and it would be for most users… Implementing ARA just for host control doesn’t make sense. I am however writing an ARA plugin and hence am asking for ARA functionality, because this thread is the best thing, I could find through google regarding the topic… Anyone who’s looking just for host control in a regular old plugin: ARA is not the way for you, go with MIDI as commenters above suggest… but if you have an ARA plugin and want to control the host, i hope this thread can now help you find these very well hidden classes )