Is prepareToPlay triggered at the beginning of a session in a DAW?

#1

Scenario:

I have a saved session in ProTools, 8 tracks, each one with the same AAX plugin built using JUCE, i.e., 8 instances of the same plugin.

I want to know if when I open the saved ProTools session is the AudioProcessor constructor called once for each plugin instance. Is prepareToPlay called in each instance before clicking on Play button?

Best,
Paulo

#2

The constructor is obviously called at least once per plugin instance. The host may have special reasons to construct and destroy the plugin multiple times too, though. You will just have to be prepared for that and not do anything hugely time consuming when the plugin is constructed and then quickly destroyed.

prepareToPlay should be called for each plugin instance by the host at least once before the audio playback happens. It may call it later too, when stopping and restarting playback, seeking and so on. You will have to observe what happens and be prepared for “interesting” behaviors.

2 Likes