Development Topics > Plugin Development
::initialise and ::setParameters in Sonic Visualizer
(1/1)
yli:
Hi,
While debugging my plugin, I found the all the calls to ::setParameters happened before calls to ::initialise. This appears to be a bit awkward to me. Normally you would first initialize an object then start tweaking its parameters.
Anyone can shed some light?
Thanks
cannam:
(Sorry to take so long to reply!)
Yes, this is intentional. There is some rationale in the Vamp SDK programmer's guide at http://vamp-plugins.org/guide.pdf in the section entitled "What can depend on a parameter?" in chapter 6.
Remember that a Vamp plugin essentially gets a two-phase initialise -- first it is constructed, and only later is initialise() called. The meaning of initialise() essentially is "set up all the internal parameters for your signal processing engine"; since these may depend on parameters of the plugin, and those parameters are not allowed to change during use, it is reasonable to ask them to be all set completely before that initialisation happens.
So, the order is construct - configure - initialise, which is indeed different from a real-time audio plugin API.
The design is intended to support signal processing methods in which initialisation is expensive, and to support plugins in which the very structure of the returned features may depend on the plugin's parameters. (A constant-Q spectrogram with a parameterised bin count would be an example of both of these.)
Chris
Navigation
[0] Message Index
Go to full version