Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to object-oriented interface #64

Open
jmarcosfer opened this issue Aug 17, 2021 · 0 comments
Open

Switch to object-oriented interface #64

jmarcosfer opened this issue Aug 17, 2021 · 0 comments
Labels
api enhancement New feature or request
Projects

Comments

@jmarcosfer
Copy link
Collaborator

jmarcosfer commented Aug 17, 2021

Description

Change library's interface to object-oriented, where each algorithm consists of a class with a .compute() method.

// E.g.
const framecutter = new essentia.FrameCutter( {frameSize: 2048, hopSize: 512} );
const output = framecutter.compute(audioVector);

Why?

With the current interface, where each algorithm is a function, each call to a given algorithm involves creating an AlgorithmFactory, an instance of the algorithm, and deleting said instance at the end of the compute cycle (see here, for example).

An OO interface (class + compute method) would avoid such drawback, potentially making the library use resources more efficiently. Additionally, it would match the upstream Essentia Python bindings' interface that so many existing users are already be familiar with.

How?

This requires editing /src/python/code_generator.py to change how it generates the c++ wrapper around the upstream library's algorithms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api enhancement New feature or request
Projects
1.0 Roadmap
On Review
Development

No branches or pull requests

2 participants