Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store

*.bak

*.pyc
build
Expand Down Expand Up @@ -89,3 +90,5 @@ packaging/win32_3rdparty/include
dist
essentia.egg-info
tmp
venv
stub_gen.py
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include Changelog
include COPYING.txt Essentia*Licensing.txt
include FAQ.md README.md
include VERSION
include essentia.pc.in
include waf
include wscript src/wscript src/python/wscript
recursive-include utils/ *.py
Expand Down
80 changes: 44 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,54 @@
Essentia
========
[![Build wheels status](https://github.com/MTG/essentia/actions/workflows/build-wheels-cibuildwheel.yml/badge.svg)](https://github.com/MTG/essentia/actions/workflows/build-wheels-cibuildwheel.yml)
[![License: AGPL v3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
[![PyPI downloads: essentia](https://img.shields.io/pypi/dm/essentia.svg?label=PyPI%20downloads:%20essentia)](https://pypi.org/project/essentia/)
[![PyPI downloads: essentia-tensorflow](https://img.shields.io/pypi/dm/essentia-tensorflow.svg?label=PyPI%20downloads:%20essentia-tensorflow)](https://pypi.org/project/essentia-tensorflow/)


Essentia is an open-source C++ library for audio analysis and audio-based music information retrieval released under the Affero GPLv3 license. It contains an extensive collection of reusable algorithms which implement audio input/output functionality, standard digital signal processing blocks, statistical characterization of data, and a large set of spectral, temporal, tonal and high-level music descriptors. The library is also wrapped in Python and includes a number of predefined executable extractors for the available music descriptors, which facilitates its use for fast prototyping and allows setting up research experiments very rapidly. Furthermore, it includes a Vamp plugin to be used with Sonic Visualiser for visualization purposes. Essentia is designed with a focus on the robustness of the provided music descriptors and is optimized in terms of the computational cost of the algorithms. The provided functionality, specifically the music descriptors included in-the-box and signal processing algorithms, is easily expandable and allows for both research experiments and development of large-scale industrial applications.

Documentation online: http://essentia.upf.edu


Installation
------------

The library is cross-platform and currently supports Linux, macOS, Windows, iOS and Android systems. Read installation instructions:
- http://essentia.upf.edu/documentation/installing.html
- [doc/sphinxdoc/installing.rst](doc/sphinxdoc/installing.rst)

Install from master for the latest updates.

To use in Python (Linux `x86_64`, `i686`): `pip install essentia` or `pip install essentia-tensorflow`.

Docker images: https://hub.docker.com/r/mtgupf/essentia/


You can download and use prebuilt static binaries for a number of Essentia's command-line music extractors instead of installing the complete library
- [doc/sphinxdoc/extractors_out_of_box.rst](doc/sphinxdoc/extractors_out_of_box.rst)
Why this fork
-------------
This repository does not contain actual improvements in respect to the original algorithms developed in the main repository, but it focuses on 2 main aspects:
- compatibility with `numpy2`
- an updated python packaging system
- development of python stubs

### How to create and install the essentia python package
#### Dependencies on MacOS
Install the main dependencies with [Brew](https://brew.sh/)
```zsh
% brew update
% brew install pkg-config gcc readline sqlite gdbm freetype libpng
% brew install eigen libsamplerate taglib libyaml fftw ffmpeg@4 numpy
```
It is then important to link `ffmpeg@4` manually
```zsh
% brew unlink ffmpeg && brew link --force ffmpeg@4
```
#### Dependencies on Linux (test on Debian Bookworm and in a WSL)
Install the requirements:
```bash
$ sudo apt install curl cmake yasm pkg-config
```
All the others library on which `essentia` depends will be installed by a script
#### Packaging and Usage

To create a python source distribution run:
```zsh
% python3 setup.py sdist
```
this command will create a `tar.gz` archive in the `dist` folder that can directly be compiled and installed with `pip`.

After creating/activating a virtual environment (or a conda environment) run:

**MacOS**
```zsh
(venv)% ESSENTIA_WHEEL_SKIP_3RDPARTY=1 pip install dist/essentia-2.1b6.dev0.tar.gz
```
**Linux**
```bash
(venv)$ pip install dist/essentia-2.1b6.dev0.tar.gz
```
You are ready to use `essentia` in python


Quick start
Expand All @@ -40,14 +62,6 @@ Command-line tools to compute common music descriptors:
- [doc/sphinxdoc/extractors_out_of_box.rst](doc/sphinxdoc/extractors_out_of_box.rst)


Asking for help
---------------

[Read frequently asked questions](FAQ.md).

[Create an issue on github](https://github.com/MTG/essentia/issues) or [open a new discussion](https://github.com/MTG/essentia/discussions) if your question was not answered before.


Versions
--------

Expand All @@ -58,9 +72,3 @@ Github branches:

If you use example extractors (located in src/examples), or your own code employing Essentia algorithms to compute descriptors, you should be aware of possible incompatibilities when using different versions of Essentia.

How to contribute
-----------------
We are more than happy to collaborate and receive your contributions to Essentia. The best practice of submitting your code is by creating pull requests to [our GitHub repository](https://github.com/MTG/essentia) following our contribution policy. By submitting your code you authorize that it complies with the Developer's Certificate of Origin. For more details see: http://essentia.upf.edu/documentation/contribute.html

You are also more than welcome to [suggest any improvements](https://github.com/MTG/essentia/issues/254), including proposals for new algorithms, etc.

4 changes: 2 additions & 2 deletions packaging/build_3rdparty_static_debian.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
BASEDIR=$(dirname $0)
cd $BASEDIR/debian_3rdparty
BASEDIR=$(dirname "$0")
cd "$BASEDIR/debian_3rdparty"
./build_eigen3.sh
./build_fftw3.sh
./build_lame.sh
Expand Down
62 changes: 44 additions & 18 deletions packaging/build_config.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
#!/bin/sh

# shellcheck disable=SC2034 # Unused variables left for readability

HOST=i686-w64-mingw32
if [ -z "${PREFIX}" ]; then
PREFIX=`pwd`
PREFIX=$(pwd)
fi
echo Installing to: $PREFIX

arch=$(uname -m)

echo Installing to: "$PREFIX"

#SHARED_OR_STATIC="
#--enable-shared \
Expand All @@ -17,12 +22,12 @@ SHARED_OR_STATIC="
"

EIGEN_VERSION=3.3.7
FFMPEG_VERSION=ffmpeg-2.8.12
FFMPEG_VERSION=ffmpeg-4.4.5
LAME_VERSION=3.100
TAGLIB_VERSION=taglib-1.11.1
ZLIB_VERSION=zlib-1.2.12
TAGLIB_VERSION=taglib-1.13.1
ZLIB_VERSION=zlib-1.3.1
FFTW_VERSION=fftw-3.3.2
LIBSAMPLERATE_VERSION=libsamplerate-0.1.8
LIBSAMPLERATE_VERSION=libsamplerate-0.1.9
LIBYAML_VERSION=yaml-0.1.5
CHROMAPRINT_VERSION=1.4.3
QT_SOURCE_URL=https://download.qt.io/archive/qt/4.8/4.8.4/qt-everywhere-opensource-src-4.8.4.tar.gz
Expand Down Expand Up @@ -58,7 +63,7 @@ FFMPEG_AUDIO_FLAGS="
--enable-protocol=file
--enable-protocol=pipe

--disable-sdl
--disable-sdl2
--disable-lzma
--disable-zlib
--disable-xlib
Expand Down Expand Up @@ -209,18 +214,39 @@ FFMPEG_AUDIO_FLAGS_MUXERS="
--enable-encoder=flac
"

# see http://www.fftw.org/install/windows.html
FFTW_FLAGS="
--enable-float \
--enable-sse2 \
--with-incoming-stack-boundary=2 \
--with-our-malloc16
"

LIBSAMPLERATE_FLAGS="
--disable-fftw \
--disable-sndfile
"
if [ "$arch" = "aarch64" ] || [ "$arch" = "arm64" ]
then
FFTW_FLAGS="
--enable-float \
--with-incoming-stack-boundary=2 \
--with-our-malloc16
"
else
# see http://www.fftw.org/install/windows.html
FFTW_FLAGS="
--enable-float \
--enable-sse2 \
--with-incoming-stack-boundary=2 \
--with-our-malloc16
"
fi

if [ "$arch" = "aarch64" ]
then
LIBSAMPLERATE_FLAGS="
--build=aarch64-unknown-linux-gnu \
--disable-fftw \
--disable-sndfile
"
else
LIBSAMPLERATE_FLAGS="
--disable-fftw \
--disable-sndfile
"
fi



QT_FLAGS="
-no-accessibility
Expand Down
Loading