MTG/essentia.js

Abstract and document creation and usage of VectorFloat and VectorVectorFloat types

jmarcosfer opened this issue · 0 comments

What is the issue about?

  • Bug
  • Feature request
  • Usage question
  • Documentation
  • Contributing / Development

What part(s) of Essentia.js is involved?

  • essentia.js-core (vanilla algorithms)
  • essentia.js-model (machine learning algorithms)
  • essentia.js-plot (plotting utility module)
  • essentia.js-extractor (typical algorithm combinations utility)

Description

These two data types coming from C++ are extensively used throughout the library, and some algorithms expect them as input but can be used without the output of another algorithm with produces these types, so the users need to be able to create them themselves.

Steps to reproduce / Code snippets / Screenshots

Here is an example of the NoveltyCurve algorithm, which needs a VectorVectorFloat of framewise frequency bands as its input.

One approach could be to create utility functions like the existing arrayToVector and vectorToArray to create these two types, and document (and potentially also abstract to make it look like regular javascript Array methods) their available methods such as .size(), .get(index) and .push_back().

System info

Dell Inc. Vostro 5490, Ubuntu 21.10, Chrome 105.0.5195.125 64-bit