/** initialize the plugin for use with analyze().
*
- * This is equivalent to plugin():initialise (1, 512, 1024)
+ * This is equivalent to plugin():initialise (1, ssiz, bsiz)
* and prepares a plugin for analyze.
+ * (by preferred step and block sizes are used. if the plugin
+ * does not specify them or they're larger than 8K, both are set to 1024)
*
* Manual initialization is only required to set plugin-parameters
* which depend on prior initialization of the plugin.
: _plugin (0)
, _sample_rate (sample_rate)
, _bufsize (1024)
- , _stepsize (512)
+ , _stepsize (1024)
, _initialized (false)
{
using namespace ::Vamp::HostExt;
PBD::error << string_compose (_("VAMP Plugin \"%1\" could not be loaded"), key) << endmsg;
throw failed_constructor ();
}
+
+ size_t bs = _plugin->getPreferredBlockSize ();
+ size_t ss = _plugin->getPreferredStepSize ();
+
+ if (bs > 0 && ss > 0 && bs <= 8192 && ss <= 8192) {
+ _bufsize = bs;
+ _stepsize = bs;
+ }
}
LuaAPI::Vamp::~Vamp ()