MTG / essentia.js

JavaScript library for music/audio analysis and processing powered by Essentia WebAssembly
https://essentia.upf.edu/essentiajs
GNU Affero General Public License v3.0
627 stars 41 forks source link

Abstract and document creation and usage of VectorFloat and VectorVectorFloat types #109

Open jmarcosfer opened 1 year ago

jmarcosfer commented 1 year ago

What is the issue about?

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

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