Vamp Plugins Forum
February 09, 2012, 06:19:27 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: ::initialise and ::setParameters in Sonic Visualizer  (Read 1557 times)
yli
Newbie
*
Posts: 1


View Profile
« on: December 18, 2009, 23:54:50 »

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
Logged
cannam
Administrator
Full Member
*****
Posts: 189


View Profile
« Reply #1 on: January 06, 2010, 14:24:44 »


(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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.14 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!