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
632 stars 41 forks source link

High-level JS API to essentia.js #14

Closed albincorreya closed 4 years ago

albincorreya commented 4 years ago

Issue

In current embind JS bindings for essentia algorithms, the user needs to specify all the required value for all the parameters. This can be irritating since a lot of essentia Algorithms has more than 10 parameters such as PredominantPitchMelodia, MultiPitchKlapurietc. The current way of binding the class EssentiaJS using embind is not binding the default parameter values specified in the class.

Proposed Fix

A possible solution for this issue on CPP side is to overload every method inside the class EssentiaJS as detailed in the embind documentation. But, comes at the cost of redundancy and bad code readability.

On the other hand, on JS side we could automatically generate a JS interface by extending the existing python code generation script. This could also benefit in generating automated documentation for essentia.js using tools such as jsdoc.

albincorreya commented 4 years ago

Typescript, was chosen to generate JS API due to it's flexibity in generating JS for various targets and considering maintainability. https://github.com/MTG/essentia.js/blob/dev/src/typescript/essentia.js.core.ts