mtg / essentia Goto Github PK
View Code? Open in Web Editor NEWC++ library for audio and music analysis, description and synthesis, including Python bindings
Home Page: http://essentia.upf.edu
License: GNU Affero General Public License v3.0
C++ library for audio and music analysis, description and synthesis, including Python bindings
Home Page: http://essentia.upf.edu
License: GNU Affero General Public License v3.0
On OSX 10.8 compilation fails at atomic.h because it tries to find atomicity.h as <bits/atomicity.h>. It looks like it may be a problem with ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED
Add support for arrays with negative values. CentralMoments algorithm is suited for computation of central moments of the non-negative array only because it considers array values as a probability distribution function. If negative values are present, negative variance is output which further leads to NaN errors in the output of DistributionShape algorithm, when the two are connected in a chain.
$ python
Python 2.7.5 |Anaconda 1.8.0 (x86_64)| (default, Oct 24 2013, 07:02:20)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
import essentia
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named essentia
I had essentia compiled but in python I still got importError, how to check if essentia is in my pythonpath (Python 2.7.5)? (I on 10.8 and have python 2.6 and 2.7)
Hi,
I was having a lot of problems trying to compile essentia on Linux.
Errors were related with libavformat.a.
Finally I could compile Essentia succesfully by removing ffmpeg, as sugested somewhere on the internet.
Is there any way to go around this compatibility problem?
I am implementing an extension of the streaming RingBufferInput algorithm that will create a JACK client and copy it's data into essentia through a ring buffer.
When I use RingBufferInput as the base class though, an empty entry is generated in the Registrar. essentia_algorithms_reg.cpp contains a line like AlgorithmFactory::Registrar<>;
When I use Algorithm directly it seems to work, but obviously this isn't really the right thing to do.
Am I missing something, or is this the way the registrar is implemented?
Looking at the examples like the rhythm extractor:
https://github.com/MTG/essentia/blob/master/src/examples/streaming_rhythmextractor_multifeature.cpp
in the essentia architecture an extractor is used in pipe with an audio input node:
Algorithm* mono = factory.create("MonoMixer");
Algorithm* rhythmextractor = factory.create("RhythmExtractor2013");
rhythmextractor->configure("method", "multifeature");
connect(audioloader->output("audio"), mono->input("audio"));
connect(audioloader->output("numberChannels"), mono->input("numberChannels"));
connect(audioloader->output("sampleRate"), pool, "metadata.sampleRate");
connect(mono->output("audio"), rhythmextractor->input("signal"));
and then connected to the ouput:
connect(mono->output("audio"), rhythmextractor->input("signal"));
Finally the network run the nodes:
Network network(audioloader);
network.run();
Is it possible to run the extractor directly i.e. using the constructor class:
essentia::init();
essentia::streaming::RhythmExtractor2013 *rythmExt =
new essentia::streaming::RhythmExtractor2013();
/// pass the pcm input signal
rythmExt->process();
HarmonicPeaks algorithm is selecting only those peaks that are octaves of the fundamental frequency (F0 * 2^harmonic_number) while it should select any peak multiple of F0 (F0 * harmonic_number).
See picture with the wrong behaviour (detected peaks in red, selected harmonic peaks in green):
We could port the standard solution used in the literature (from DAFX book, download matlab code for chapter 10, file: harmonicmodel.m). However, this algorithm still presents a problem (that you can also see on the previous picture for the peak around 7kHz) for which it may select more than one peak for a harmonic position.
Last year I implemented a more complete algorithm (also in matlab) that could be ported.
Anyway, I'd like to list the complete requirements I think this algorithm should comply with so that anybody can add or change ideas (just answering to this).
HarmonicPeaks requirements:
We can discuss other methodologies out there to define harmonics' deviation tolerance:
From my point of view, it is intuitively more reasonable to use a fixed tolerance because the harmonics distance is also fixed, instead of using something linear or logarithmic, but it would be great to hear more opinions!
Hi!
i would create a simple application in C/C++ that takes as input my voice from microphone in real time and send in output (speakers of my PC) what I say.
Can You help me, please?
thanks!
It would be nice to also output the start and end time of the LogAttackTime algorithm.
Those times are already detected, it is just a matter of outputting them.
streaming_extractor_archive music will fail occasionally produce segfault on some audio files
[ WARNING ] No more output for FrameCutter. Scheduler needs to do something or we're toast...
[ WARNING ] No more output for FrameCutter. Scheduler needs to do something or we're toast...
[ WARNING ] No more output for FrameCutter. Scheduler needs to do something or we're toast...
Segmentation fault
Program received signal SIGSEGV, Segmentation fault.
#0 0x081aa67d in essentia::streaming::PhantomBuffer<float>::acquireForWrite (this=0x86b4328, requested=8192) at /home/dbogdanov/essentia/src/essentia/streaming/phantombuffer_impl.h:101
#1 0x081ab413 in essentia::streaming::Source<float>::acquire (this=0x86b42c4, n=8192) at /home/dbogdanov/essentia/src/essentia/streaming/source.h:86
#2 0x08105528 in essentia::streaming::StreamConnector::acquire (this=0x86b42cc) at ../src/essentia/streaming/../streamconnector.h:49
#3 0x08104b0a in essentia::streaming::Algorithm::acquireData (this=0x86b41b0) at ../src/essentia/streaming/streamingalgorithm.cpp:208
#4 0x0832eef6 in essentia::streaming::StreamingAlgorithmWrapper::process (this=0x86b41b0) at ../src/essentia/streaming/streamingalgorithmwrapper.cpp:136
#5 0x0832fde9 in essentia::streaming::StreamingAlgorithmWrapper::process (this=0x86b41b0) at ../src/essentia/streaming/streamingalgorithmwrapper.cpp:205
#6 0x0832fde9 in essentia::streaming::StreamingAlgorithmWrapper::process (this=0x86b41b0) at ../src/essentia/streaming/streamingalgorithmwrapper.cpp:205
....
#2994 0x0832fde9 in essentia::streaming::StreamingAlgorithmWrapper::process (this=0x86b41b0) at ../src/essentia/streaming/streamingalgorithmwrapper.cpp:205
#2995 0x0832fde9 in essentia::streaming::StreamingAlgorithmWrapper::process (this=0x86b41b0) at ../src/essentia/streaming/streamingalgorithmwrapper.cpp:205
#2996 0x0832fde9 in essentia::streaming::StreamingAlgorithmWrapper::process (this=0x86b41b0) at ../src/essentia/streaming/streamingalgorithmwrapper.cpp:205
#2997 0x0832fde9 in essentia::streaming::StreamingAlgorithmWrapper::process (this=0x86b41b0) at ../src/essentia/streaming/streamingalgorithmwrapper.cpp:205
#2998 0x080ccb85 in essentia::scheduler::Network::run (this=0xbfffeda0) at ../src/essentia/scheduler/network.cpp:274
#2999 0x08072c2e in computeStep2 (audioFilename=..., pool=..., options=..., startTime=0, endTime=77.9864883) at ../src/examples/streaming_extractor_archivemusic.cpp:309
#3000 0x0806ff68 in compute (audioFilename=..., outputFilename=..., pool=..., options=...) at ../src/examples/streaming_extractor_archivemusic.cpp:115
#3001 0x0806fba2 in main (argc=3, argv=0xbffff664) at ../src/examples/streaming_extractor_archivemusic.cpp:87
streaming_extractor fails on the same example with exception:
terminate called after throwing an instance of 'essentia::EssentiaException'
what(): acquireForWrite: Requested number of tokens (266240) > phantom size (131072) in EqualLoudness::signal
Hi,
I have been trying out a few algorithms in essentia package. While trying out the predominant melody algorithm, I gave a song sang by me without any instrumental background as the input to the algorithm. I observed that the output pitch values have some abnormalities with some sudden overshoots to frequency ranges of 800- 1400Hz at several portions, and for the rest it seems very reasonable with average pitch values around 150-280. The same repeated for many songs. I believe the overshoot frequencies(800- 1400Hz) are beyond normal ranges while singing and I am suspecting the predominant melody extraction fails. I tried out changing the input parameter values, but it didn't improve. :-(
Am I missing some initialization of the parameters here? Or is it having anything to do inside the predominant melody algorithm.
Following is a snapshot of my output.
On OSX the latest ffmpeg version installed by homebrew (1.1.3) produces a crash when trying an example extractor. Version 0.8 worked for me. The latest supported version should be in the documentation.
import essentia.standard as es
loader = es.EasyLoader(filename='01.wav')
lowLevelSpectralExtractor = es.LowLevelSpectralExtractor(frameSize=2048, hopSize=1024, sampleRate=44100)
audio = loader()
features = lowLevelSpectralExtractor(audio)
...
produces
RuntimeError: In LowLevelSpectralExtractor.compute: VectorInput: internal error: output buffer full
the problem is the bug in the streaming scheduler
MonoWriter(filename = 'onsets_complex.mp3', format = 'mp3')(marker(audio))
libc++abi.dylib: terminate called throwing an exception
Abort trap: 6
I was following this example under python 2.7.6:
http://essentia.upf.edu/documentation/_downloads/onsetdetection_example.py
any idea what might be the cause? thx
Hey there,
This is a general question and I must admit I feel pretty stupid for not being able to figure it out myself -- perhaps someone can shed some light on this for me?
I'm writing a simple extractor in C++ in standard mode. My question is: How would you go about setting a parameter on one algorithm based on the output of another algorithm?
To get a bit more specific: I'm attempting to use the ticks
output of RhythmExtractor2013
for the beats
parameter of BeatsLoudness
. I've got this working fine in Python, but for some reason my C++ isn't working at all. Specifically, my loudness
vector isn't filling up with data. Would the answer to my question above even help me with this problem?
A truncated version of my code is as follows:
#include <iostream>
#include <fstream>
#include "algorithmfactory.h"
#include "essentiamath.h"
#include "pool.h"
using namespace std;
using namespace essentia;
using namespace essentia::standard;
int main(int argc, const char * argv[])
{
if (argc != 2) {
cout << "ERROR: incorrect number of arguments." << endl;
cout << "Usage: " << argv[0] << " audio_input" << endl;
exit(1);
}
string audioFilename = argv[1];
essentia::init();
Pool pool;
/////// PARAMS //////////////
int sampleRate = 44100;
int maxTempo = 208;
string method = "multifeature";
int minTempo = 40;
AlgorithmFactory& factory = standard::AlgorithmFactory::instance();
Algorithm* audio = factory.create("MonoLoader",
"filename", audioFilename,
"sampleRate", sampleRate);
Algorithm* re2013 = factory.create("RhythmExtractor2013",
"maxTempo", maxTempo,
"method", method,
"minTempo", minTempo);
/////////// CONNECTING THE ALGORITHMS ////////////////
vector<Real> audioBuffer;
audio->output("audio").set(audioBuffer);
re2013->input("signal").set(audioBuffer);
Real bpm, confidence;
vector<Real> ticks, estimates, bpmIntervals;
re2013->output("bpm").set(bpm);
re2013->output("confidence").set(confidence);
re2013->output("ticks").set(ticks);
re2013->output("estimates").set(estimates);
re2013->output("bpmIntervals").set(bpmIntervals);
Algorithm* bl = factory.create("BeatsLoudness",
"beats", ticks);
bl->input("signal").set(audioBuffer);
audio->compute();
re2013->compute();
vector<Real> loudness;
vector<vector<Real>> loudnessBandRatio;
bl->output("loudness").set(loudness);
bl->output("loudnessBandRatio").set(loudnessBandRatio);
bl->compute();
cout << endl;
cout << "Ticks size: " << ticks.size() << endl;
cout << "Loudness size: " << loudness.size() << endl;
cout << endl;
delete audio;
delete re2013;
delete bl;
essentia::shutdown();
return 0;
}
To reproduce:
./build/src/examples/streaming_extractor test/audio/recorded/cat_purrrr.wav /tmp/foo.sig
Album/artist/comment/genre/title will look completely corrupted.
The error seems to be in the code loading metadata via TagLib
_title.get() = formatString(f.tag()->title());
_artist.get() = formatString(f.tag()->artist());
_album.get() = formatString(f.tag()->album());
_comment.get() = formatString(f.tag()->comment());
_genre.get() = formatString(f.tag()->genre());
This issue does not happen on Linux (tested with the same version of TagLib).
Has anyone managed to compile a 32 bits i386 or universal version of the library for OS X?
I have compiled universal versions of all the dependent libraries (libyaml fftw ffmpeg libsamplerate lib tag)
and added in the configure section of the wscript
ctx.env.append_value('CXXFLAGS', '-arch')
ctx.env.append_value('CXXFLAGS', 'i386')
ctx.env.append_value('CXXFLAGS', '-arch')
ctx.env.append_value('CXXFLAGS', 'x86_64')
ctx.env.append_value('LINKFLAGS', '-arch')
ctx.env.append_value('LINKFLAGS', 'i386')
ctx.env.append_value('LINKFLAGS', '-arch')
ctx.env.append_value('LINKFLAGS', 'x86_64')
Everything compiles fine, yet the final libessentia library is x86_64 and not universal.
Any idea what I might have missed?
Thanks
For some sounds, ChordsDetection throws the following:
While trying to push item into source ChordsDetection::chords:
ChordsDetection::chords: Could not push 1 value, output buffer is full
stderr: terminate called after throwing an instance of 'essentia::EssentiaException'
what(): While trying to push item into source ChordsDetection::chords:
ChordsDetection::chords: Could not push 1 value, output buffer is full
A workaround seems to be increasing the frame size to 8192.
Example (without chords):
http://www.freesound.org/people/Yacob_l/sounds/194802/
AudioLoader chokes with some MP3 files. The following exception is thrown:
acquireForWrite: Requested number of tokens (192000) > phantom size (131072) in AudioLoader::audio
Example:
http://www.freesound.org/people/plagasul/sounds/367/
On Linux, I could only install python dependencies with sudo.
Similarly, ./waf install must be sudo ./waf install
Similar to this report:
#40
I am trying to open and analyze multiple files using the MonoLoader algorithm, but this results in a memory leak that keeps growing as more and more files are loaded. Here's the code I was using to get the durations of the audio files in my music library: (please correct me if there's a better way to do this, but I couldn't find anything in the documentation about 'unloading' a file once it's been loaded, or a way to open a different file with the same instance of MonoLoader/AudioLoader)
import os
import essentia
import essentia.standard
import essentia.streaming
from os.path import join, getsize
extensions = dict()
durations = []
with open('durations.txt', 'wb') as f:
for root, dirs, files in os.walk('/path/to/music/library'):
if 'CVS' in dirs:
dirs.remove('CVS') # don't visit CVS directories
#print sum(getsize(join(root, name)) for name in files),
print 'album: {0}\n'.format(root)
for name in files:
if name.endswith(('.wav', '.aif', 'aiff', '.flac', '.mp3', '.m4a')):
#print root
# and then we actually perform the loading:
try:
loader = essentia.standard.MonoLoader(filename = join(root, name))
audio = loader()
duration_in_seconds = len(audio)/44100.
f.write('{0}, '.format(duration_in_seconds))
print '{0},'.format(duration_in_seconds),
#del loader #making these calls has no effect
#del audio #...
#gc.collect() #...
except (RuntimeError, TypeError, NameError):
#print 'could not parse file $s\n' % name
continue
I tried to run the python tests after the install and there were a few errors.
Traceback (most recent call last):
File "/home/marius/Documents/Software/essentia-master/test/src/unittest/rhythm/test_bpmhistogramdescriptors.py", line 58, in testAbnormalValues
bpm1, weight1, spread1, bpm2, weight2, spread2 = BPMHistogramDescriptors()(intervals)
NameError: global name 'BPMHistogramDescriptors' is not defined
Traceback (most recent call last):
File "/home/marius/Documents/Software/essentia-master/test/src/unittest/io/test_audioloader_streaming.py", line 159, in testResetStandard
audio1, sr1, nChannels1 = loader();
File "test/src/unittest/all_tests.py", line 105, in computeResetCompute
File "/usr/local/lib/python2.7/dist-packages/essentia/standard.py", line 85, in compute
results = self.compute(*convertedArgs)
RuntimeError: In AudioLoader.compute: std::bad_alloc
I am on a 32 bits Ubuntu 12.04. Everything went well during compilation and I guess that during the install too.
BpmHistogram is missing the implementation for the standard mode. It is an outdated algorithm, however.
Hi,
I get the following error message when using the examples (tried nearly all of them):
libc++abi.dylib: terminating with uncaught exception of type essentia::EssentiaException: Could not initialize swresample context
I guess this somehow comes from the audio loader. I tried different audio files in 44.1 kHz and 48kHz. Any ideas?
In order to have a more consistent API and to remove the RogueVector hack also.
Should look into Eigen: http://eigen.tuxfamily.org/
Started some work in the vector_refactor branch.
Hi,
I'm trying to have a remote collaborator install essentia on his machine, and the compilation fails (I think at the python bindings step). Here's the first error :
In file included from ../src/python/pytypes/boolean.cpp:20:
/Users/jspindell/Desktop/essentia/src/python/typedefs.h:26:10: fatal error: 'numpy/ndarrayobject.h' file not found
^
We located the numpy core headers folder on his machine and tried to export CFGLAGS :
export CFLAGS=-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/
export CPPFLAGS=-I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/
but that didn't help. Do your have any suggestion?
The machine is running macosx with mountain lion.
Thank you!
I am unable to run the python tests:
The installed GLIBC is 2.17
ptnx@ptnx-TA970:~/Documents/Code/essentia-master$ ./waf run_python_testsTraceback (most recent call last):
File "test/src/unittest/all_tests.py", line 27, in
import essentia
File "/home/ptnx/anaconda/lib/python2.7/site-packages/essentia/init.py", line 1, in
import _essentia
ImportError: /home/ptnx/anaconda/bin/../lib/libm.so.6: version `GLIBC_2.15' not found (required by /usr/lib/x86_64-linux-gnu/libvorbis.so.0)
Python test for RhythmExtractor fails on synthetic test input (testImpulseTrain) when running RhythmExtractor algorithm without tempoHints. Results ticks and bpm intervals do not correspond to the expected ones, although BPM estimates are correct.
Probably this was a normal behavior when running without tempoHits. The RhythmExtractor algorithm itself is outdated.
$ python onsetdetection_example.py
usage: onsetdetection_example.py
$ python onsetdetection_example.py noise.wav
Loading audio file...
Computing onset detection functions...
Computing onset times...
Writing audio files to disk with onsets marked...
Traceback (most recent call last):
File "onsetdetection_example.py", line 98, in
MonoWriter(filename = 'onsets_complex.mp3', format = 'mp3')(marker(audio))
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/essentia/standard.py", line 96, in call
return self.compute(_args)
File "/usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/essentia/standard.py", line 85, in compute
results = self.compute(_convertedArgs)
RuntimeError: In MonoWriter.compute: Error encoding last frames
libc++abi.dylib: terminating with uncaught exception of type essentia::EssentiaException: Error encoding last frames
Abort trap: 6
However, there is an output file with onset annotation with beep. Any idea how to to resolve error? thanks.
I tried to configure essentia on my mac and wondered how to proceed? how should i resolve this "taglib" and "yaml" not found? Thanks.
here is my configuration line:
$ ./waf configure --mode=release --with-python --with-cpptests --with-examples --with-vamp
here is the log i got:
Setting top to : .../essentia_solution/essentia-2.0
Setting out to : .../essentia_solution/essentia-2.0/build
→ configuring the project in .../essentia_solution/essentia-2.0
→ Building in release mode
Checking for 'g++' (c++ compiler) : clang++
Checking for 'gcc' (c compiler) : clang
Checking for program pkg-config : /opt/local/bin/pkg-config
Checking for 'libavcodec' : yes
Checking for 'libavformat' : yes
Checking for 'libavutil' : yes
Checking for 'libswresample' : yes
Checking for 'taglib' : not found
Checking for 'yaml-0.1' : not found
The configuration failed
(complete log in .../essentia-2.0/build/config.log)
After
./waf configure --mode=release --with-python --with-cpptests --with-examples --with-vamp
python executable ... differs from system...
...
Checking for library python2.7 in LIBPATH_PYEMBED: not found
Checking for library python2.7 in LIBDIR: not found
Checking for library python2.7 in python_LIBPL: not found
Checking for library python2.7 in $prefix/libs: not found
...
Getting pyembed flags from python-config: Could not build a python embedded interpreter
...
any pointer on how to resolve this? thanks.
Hi,
I've installed Gaia2 at first.
Then, the configuration for Essentia is done.
$ ./waf configure --mode=release --with-python --with-cpptests --with-examples
Checking for 'g++' (c++ compiler) : /usr/bin/g++
Checking for 'gcc' (c compiler) : /usr/bin/gcc
Checking for program pkg-config : /usr/bin/pkg-config
Checking for 'libavcodec' : yes
Checking for 'libavformat' : yes
Checking for 'libavutil' : yes
Checking for 'libswresample' : yes
Checking for 'taglib' : yes
Checking for 'yaml-0.1' : yes
Checking for 'fftw3f' : yes
Checking for 'samplerate' : yes
Checking for 'gaia2' : yes
Checking for program python : /usr/local/python-2.6.4/bin/python
Checking for python version : (2, 6, 4, 'final', 0)
Checking for library python2.6 in LIBDIR : yes
Checking for program /usr/local/python-2.6.4/bin/python-config,python2.6-config,python-config-2.6,python2.6m-config : /usr/local/python-2.6.4/bin/python-config
Checking for header Python.h : yes
================================ CONFIGURATION SUMMARY ================================
- FFmpeg / libav detected!
The following algorithms will be included: ['AudioLoader', 'MonoLoader', 'EqloudLoader', 'EasyLoader', 'MonoWriter', 'AudioWriter']
- libsamplerate (SRC) detected!
The following algorithms will be included: ['Resample']
- TagLib detected!
The following algorithms will be included: ['MetadataReader']
- Gaia2 detected!
The following algorithms will be included: ['GaiaTransform']
=======================================================================================
'configure' finished successfully (0.326s)
But, building for Essentia is failed with following errors
$ ./waf
....
....
[ 44/279] cxx: src/algorithms/standard/noiseadder.cpp -> build/src/algorithms/standard/noiseadder.cpp.1.o
[ 45/279] cxx: src/algorithms/io/monowriter.cpp -> build/src/algorithms/io/monowriter.cpp.1.o
../src/algorithms/highlevel/gaiatransform.h:37: error: ‘TransfoChain’ in namespace ‘gaia2’ does not name a type
../src/algorithms/highlevel/gaiatransform.h: In constructor ‘essentia::standard::GaiaTransform::GaiaTransform()’:
../src/algorithms/highlevel/gaiatransform.h:47: error: ‘init’ is not a member of ‘gaia2’
../src/essentia/scheduler/network.cpp: In function ‘bool isExcludedFromInfo(const std::string&)’:
../src/essentia/scheduler/network.cpp:923: warning: comparison between signed and unsigned integer expressions
Is there anyone who knows the solution?
ChordsDetection does not perform well according to some user report.
The algorithm is very simplistic. It estimates chords for a window sliding accors HPCP frames. The frame size is arbitrary. The hop size is set to 1 HPCP frame. Maybe it could be a smart idea to jump from 1 beat to another or from 1 onset to another instead using sliced based on fixed amount a time.
For the PeakDetection function I'm feeding a numpy.ndarray type of float64 and get the following error:
TypeError('essentia can currently only accept one-dimensional numpy arrays of dtype '
TypeError: essentia can currently only accept one-dimensional numpy arrays of dtype {"single", "int", "complex64"}
If it is not supported it would be a good enhancement because it is a very common data type.
From the installation pages :
"We’re sorry, but you’re pretty much on your own if you want to develop on Windows..."
Has someone tried it successfully anyways? Is there hope to actually compile the library on windows, or do you see a major obstacle for that?
Any pointers would help.
Thanks.
Following the official installation instructions for OSX 10.6 Snow Leopard provided good results.
In OSX 10.8 Mountain Lion they still worked, with the exception of having to install matplotlib with homebrew (preferably numpy and scipy also).
In OSX 10.9 Mavericks the compilation fails with the following error:
[ 29/307] cxx: src/algorithms/spectral/hpcp.cpp -> build/src/algorithms/spectral/hpcp.cpp.1.o
In file included from ../src/algorithms/rhythm/rhythmextractor2013.cpp:21:
In file included from ../src/algorithms/rhythm/rhythmextractor2013.h:23:
In file included from /Users/hector/.installers/essentia/src/essentia/streaming/streamingalgorithmcomposite.h:23:
In file included from /Users/hector/.installers/essentia/src/essentia/streaming/streamingalgorithm.h:271:
In file included from /Users/hector/.installers/essentia/src/essentia/streaming/source.h:138:
In file included from /Users/hector/.installers/essentia/src/essentia/streaming/phantombuffer.h:25:
/Users/hector/.installers/essentia/src/essentia/streaming/../roguevector.h:127:40: error: no member named '_M_impl' in 'essentia::RogueVector<std::__1::vector<float, std::__1::allocator > >'
inline void setData(T* data) { this->_M_impl._M_start = data; }
~~~~ ^
Waf is using the clang and clang++ compiler provided by OSX which seems to have some incompatibility issues.
For now a workaround is to install the latest gcc (tested with 4.7 and 4.8) with homebrew, for example. And after the configuration step (waf configure [...]) replace manually in the file 'build/c4che/_cache.py' all the occurrences of:
I don't know if it should be fixed by updating essentia code to play nice with clang compiler or force OSX users to install the regular gcc and make waf detect and select it.
Running a python script from matlab using a system() call produces a segfault on the stage of importing essentia.standard module.
Any project to run the whole library on mobile iOS ?
FFWT
TagLib
LibYAML
should be compilable on iOS easily.
An idea could be to make a lightweight release of the library without the Python wrappers.
I have a feature extractor in a python which uses essentia in streaming mode. For a specific file I get the following warnings:
[ WARNING ] AudioLoader: more than 1 frame in packet, dropping remaining bytes...
[ WARNING ] at sample index: 0
[ WARNING ] decoded samples: 1024
[ WARNING ] packet size: 4096
[ WARNING ] AudioLoader: more than 1 frame in packet, dropping remaining bytes...
[ WARNING ] at sample index: 2036
[ WARNING ] decoded samples: 1024
[ WARNING ] packet size: 4096
[ WARNING ] AudioLoader: more than 1 frame in packet, dropping remaining bytes...
[ WARNING ] at sample index: 4072
[ WARNING ] decoded samples: 1024
[ WARNING ] packet size: 4096
[ INFO ] MelBands: input spectrum size (513) does not correspond to the "inputSize" parameter (1025). Recomputing the filter bank.
[ WARNING ] AudioLoader: more than 1 frame in packet, dropping remaining bytes...
[ WARNING ] at sample index: 6108
[ WARNING ] decoded samples: 1024
[ WARNING ] packet size: 4096
[ WARNING ] AudioLoader: more than 1 frame in packet, dropping remaining bytes...
[ WARNING ] at sample index: 8144
[ WARNING ] decoded samples: 1024
[ WARNING ] packet size: 4096
[ WARNING ] AudioLoader: more than 1 frame in packet, dropping remaining bytes...
[ WARNING ] at sample index: 10180
[ WARNING ] decoded samples: 1024
[ WARNING ] packet size: 4096
[ WARNING ] AudioLoader: more than 1 frame in packet, dropping remaining bytes...
[ WARNING ] at sample index: 12216
[ WARNING ] decoded samples: 1024
[ WARNING ] packet size: 4096
[ WARNING ] AudioLoader: more than 1 frame in packet, dropping remaining bytes...
[ WARNING ] at sample index: 14252
[ WARNING ] decoded samples: 1024
[ WARNING ] packet size: 4096
[ WARNING ] AudioLoader: more than 1 frame in packet, dropping remaining bytes...
[ WARNING ] at sample index: 16288
[ WARNING ] decoded samples: 1024
[ WARNING ] packet size: 4096
I had a quick look at the source code for the audio loader and found this comment:
if (len != _packet.size) {
// FIXME: investigate why this happens and whether it is a big issue
// (looks like it only loses silent samples at the end of files)
// more than 1 frame in a packet, happens a lot with flac for instance...
E_WARNING("AudioLoader: more than 1 frame in packet, dropping remaining bytes...");
E_WARNING("at sample index: " << output("audio").totalProduced());
E_WARNING("decoded samples: " << len);
E_WARNING("packet size: " << _packet.size);
}
Here's the sound that gives these warnings: http://www.freesound.org/people/davidou/sounds/88466/
check that it works on all platforms, and is as correct/optimized as can be. The current implementation looks a bit flaky:
https://github.com/MTG/essentia/blob/2.0.1/src/essentia/essentiamath.h#L705
Some relevant links:
http://stackoverflow.com/questions/2487653/avoiding-denormal-values-in-c
https://en.wikipedia.org/wiki/Denormal_number
current implementation comes from:
e.g.
audio = essentia.standard.MonoLoader(filename=fname)()
causes
/home/alastair/code/dunya/env/local/lib/python2.7/site-packages/essentia/standard.py in configure(self, **kwargs)
56 kwargs[name] = convertedVal
57
---> 58 self.__configure__(**kwargs)
59
60 def compute(self, *args):
RuntimeError: Error while parsing parameters: String::fromPythonCopy: input not a PyString: <type 'unicode'>
The following seems to appear always when using Envelope in streaming mode:
[ INFO ] On source Envelope::signal:
[ INFO ] BUFFER SIZE MISMATCH: max=0 - asked for write size 4096
[ INFO ] resizing buffer to 36040/4505
Creating an instance of AudioLoader (streaming) on python allocates memory that is never collected.
Test:
from essentia.streaming import AudioLoader
f = "test/audio/recorded/musicbox.wav"
for i in range(1,1000): a= AudioLoader(filename=f)
I'm not sure if anyone can help with this problem, but here I go --
I'm trying to use Essentia in a C++ project I'm developing with Xcode. I was able to use the Python bindings to great effect to quickly prototype the collection of algorithms I'd like to use and plot my data with Python and matplotlib. I'm now trying to translate the same extractor into a C++ project.
Does anyone have any advice on setting up a blank new Xcode project that will successfully compile a command line C++ project that uses Essentia?
Note: For now, it is enough for me to be able to compile a simple standard extractor that runs on the command line, but eventually I'd like to be able to include/use Essentia in a larger application that runs a GUI / OpenGL / etc.
I'm afraid I'm just not familiar enough with compiling/linking this level of code in Xcode.
Any help will be greatly appreciated. Thanks!
I had a heck of a time getting waf to detect and build with gaia2 within a virtualenv, so figured I'd note some of the things I had to do in case it helps anyone smarter than me make the process more seamless for future users.
After running gaia2's waf configure (with --prefix=$VIRTUAL_ENV), build, and install within my virtualenv, the first problem was that essentia's waf configure (again with --prefix=$VIRTUAL_ENV) couldn't find my gaia2 installation. I figured out that this was because pkg-config couldn't find gaia2 when it got installed to $VIRTUAL_ENV/lib/pkgconfig. The only quick way I could see to get things to work was to modify my virtualenv's activate script to update/reset the $PKG_CONFIG_PATH appropriately upon activate/deactivate.
essentia's waf could then detect gaia2, but was running into compilation errors:
In file included from ../src/algorithms/essentia_algorithms_reg.cpp:117:0:
/home/njhwang/Documents/my-dev/essentia/src/algorithms/highlevel/gaiatransform.h:23:34: fatal error: gaia2/transformation.h: No such file or directory
compilation terminated.
The g++ invocation had the following flag to include the gaia2 headers that were installed in my virtualenv, which definitely contained transformation.h:
-I/home/njhwang/Documents/pyenvs/sirenuse/include/gaia2
Since transformation.h was executing "#include <gaia2/transformation.h>", I thought perhaps it was looking for another gaia2 folder within the included directory mentioned above.
I modified the gaia2.pc file in my $VIRTUAL_ENV/lib/pkgconfig directory to make sure that the following got included to the g++ flags:
-I/home/njhwang/Documents/pyenvs/sirenuse/include
I was then able to completely build and install essentia from a virtualenv.
I successfully installed the dependent libraries via:
brew install libyaml fftw ffmpeg libsamplerate libtag
however when I try to compile none of these relevant libraries are found and Essentia will not compile.
I have completely deinstalled macports and deleted associated files, so I am relatively sure that that isn't the problem. I suspect it might be because I don't have the right version of the libraries??
Here is the log:
→ Building in release mode
Checking for 'g++' (c++ compiler) : clang++
Checking for 'gcc' (c compiler) : clang
Checking for program pkg-config : /usr/bin/pkg-config
Checking for 'libavcodec' : not found
Checking for 'libavformat' : not found
Checking for 'libavutil' : not found
Checking for 'libswresample' : not found
Checking for 'taglib' : not found
Checking for 'yaml-0.1' : not found
The configuration failed
(complete log in /Users/caroline/Desktop/school/abbyWork/essentia/essentia-2.0/build/config.log)
cmu-414606:essentia-2.0 caroline$ brew install libyaml fftw ffmpeg libsamplerate libtag
Warning: Your Xcode (4.6.3) is outdated
Please update to Xcode 5.0.1.
Xcode can be updated from the App Store.
Warning: libyaml-0.1.5 already installed
Warning: fftw-3.3.3 already installed
Warning: ffmpeg-2.1.3 already installed
Warning: libsamplerate-0.1.8 already installed
Warning: taglib-1.9.1 already installed
cmu-414606:essentia-2.0 caroline$ ```
Hey there,
I've been having a great time working with this excellent library. I'm currently trying to incorporate it into a C++ project I need to build with libc++. Can someone point me in the right direction for compiling the libessentia binary against libc++ (and not libstdc++)?
I've compiled/installed all the dependencies for Essentia via Homebrew as instructed in the documentation. Would I need to recompile the dependencies with clang++/libc++ as well?
Sorry for what might be a basic question - this is my first time getting this involved with the compile/link process.
Thanks so much,
S
Hey guys,
Exciting looking library - can't wait to fully play with it.
Just going through the beginner's Python tutorial on the website, and I'm experiencing a segmentation fault on the audio = loader()
step. I've tried with several different mp3s (always using MonoLoader), and it happens every time.
Any ideas?
S
Was just trying to run the python key extractor example: http://essentia.upf.edu/documentation/_downloads/streaming_extractor_keyextractor_by_steps.py
But it kept computing indefinitely without terminating. After some investigation the culprit was found to be the orderBy parameter in SpectralPeaks. Whilst orderBy="frequency" works fine, orderBy="magnitude" doesn't terminate.
(python bindings, streaming mode, OSX 10.9)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.