Ardour  9.0-pre0-582-g084a23a80d
ARDOUR::LuaAPI::Vamp Class Reference

#include <lua_api.h>

Public Member Functions

 Vamp (const std::string &, float sample_rate)
 
 ~Vamp ()
 
::Vamp::Plugin * plugin ()
 
int analyze (std::shared_ptr< ARDOUR::AudioReadable > r, uint32_t channel, luabridge::LuaRef fn)
 
void reset ()
 
bool initialize ()
 
bool initialized () const
 
::Vamp::Plugin::FeatureSet process (const std::vector< float * > &d, ::Vamp::RealTime rt)
 

Static Public Member Functions

static std::vector< std::string > list_plugins ()
 

Private Attributes

::Vamp::Plugin * _plugin
 
float _sample_rate
 
samplecnt_t _bufsize
 
samplecnt_t _stepsize
 
bool _initialized
 

Detailed Description

Definition at line 303 of file lua_api.h.

Constructor & Destructor Documentation

◆ Vamp()

ARDOUR::LuaAPI::Vamp::Vamp ( const std::string &  ,
float  sample_rate 
)

Vamp Plugin Interface

Vamp is an audio processing plugin system for plugins that extract descriptive information from audio data - typically referred to as audio analysis plugins or audio feature extraction plugins.

This interface allows to load a plugins and directly access it using the Vamp Plugin API.

A convenience method is provided to analyze Ardour::AudioReadable objects (Regions).

◆ ~Vamp()

ARDOUR::LuaAPI::Vamp::~Vamp ( )

Member Function Documentation

◆ analyze()

int ARDOUR::LuaAPI::Vamp::analyze ( std::shared_ptr< ARDOUR::AudioReadable r,
uint32_t  channel,
luabridge::LuaRef  fn 
)

high-level abstraction to process a single channel of the given AudioReadable.

If the plugin is not yet initialized, initialize() is called.

if fn is not nil, it is called with the immediate Vamp::Plugin::Features on every process call.

Parameters
rreadable
channelchannel to process
fnlua callback function or nil
Returns
0 on success

◆ initialize()

bool ARDOUR::LuaAPI::Vamp::initialize ( )

initialize the plugin for use with analyze().

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.

vamp:reset ()
vamp:initialize ()
vamp:plugin():setParameter (0, 1.5, nil)
vamp:analyze (r, 0)
int analyze(std::shared_ptr< ARDOUR::AudioReadable > r, uint32_t channel, luabridge::LuaRef fn)
::Vamp::Plugin * plugin()
Definition: lua_api.h:323

◆ initialized()

bool ARDOUR::LuaAPI::Vamp::initialized ( ) const
inline

Definition at line 361 of file lua_api.h.

◆ list_plugins()

static std::vector<std::string> ARDOUR::LuaAPI::Vamp::list_plugins ( )
static

Search for all available available Vamp plugins.

Returns
list of plugin-keys

◆ plugin()

::Vamp::Plugin* ARDOUR::LuaAPI::Vamp::plugin ( )
inline

Definition at line 323 of file lua_api.h.

◆ process()

::Vamp::Plugin::FeatureSet ARDOUR::LuaAPI::Vamp::process ( const std::vector< float * > &  d,
::Vamp::RealTime  rt 
)

process given array of audio-samples.

This is a lua-binding for vamp:plugin():process ()

Parameters
daudio-data, the vector must match the configured channel count and hold a complete buffer for every channel as set during plugin():initialise()
rttimestamp matching the provided buffer.
Returns
features extracted from that data (if the plugin is causal)

◆ reset()

void ARDOUR::LuaAPI::Vamp::reset ( )

call plugin():reset() and clear initialization flag

Member Data Documentation

◆ _bufsize

samplecnt_t ARDOUR::LuaAPI::Vamp::_bufsize
private

Definition at line 378 of file lua_api.h.

◆ _initialized

bool ARDOUR::LuaAPI::Vamp::_initialized
private

Definition at line 380 of file lua_api.h.

◆ _plugin

::Vamp::Plugin* ARDOUR::LuaAPI::Vamp::_plugin
private

Definition at line 376 of file lua_api.h.

◆ _sample_rate

float ARDOUR::LuaAPI::Vamp::_sample_rate
private

Definition at line 377 of file lua_api.h.

◆ _stepsize

samplecnt_t ARDOUR::LuaAPI::Vamp::_stepsize
private

Definition at line 379 of file lua_api.h.


The documentation for this class was generated from the following file: