← Back

ofxAudioAnalyzer

github.com/leozimmerman/ofxAudioAnalyzer · @leozimmerman
OF 0.11 GUI Sound

openFrameworks wrapper for Essentia. Audio analysis algorithms in real-time

193 37 Last commit 5y ago Created 11y ago

Forks

Forks pushed to more recently than leozimmerman/ofxAudioAnalyzer itself, plus any admin-confirmed fork with commits of its own — worth checking if you're hitting issues with the original.

danoli3/ofxAudioAnalyzer by @danoli3 · ★ 0 · pushed 2y ago
roymacdonald/ofxAudioAnalyzer by @roymacdonald · ★ 3 · pushed 3y ago

Branches ahead of master

These branches have commits not yet on master — could be unmerged fixes or work in progress worth a look.

sonoscopio 12 commits ahead · last commit 7y ago
develop 12 commits ahead · last commit 7y ago
multiPitches 1 commit ahead · last commit 10y ago

README

ofxAudioAnalyzer



Description



openFrameworks addon for audio analysis. It provides the following algorithms : RMS, Instant power, Energy, Pitch frequency, Pitch Confidence, Pitch Salience, HFC, Centroid, Inharmonicity, Spectral Complexity, Dissonance, Roll Off, Odd To Even Harmonic Energy Ratio, Strong Peak, Strong Decay, Onsets, Spectrum, Mel Bands, MFCC, Harmonic Pitch Class Profile, Tristimulus

See AlgorithmsReference.md

This addon uses Essentia library.

Demo video: https://vimeo.com/129795472

Compatibility



OSX & Linux - OF 0.10.0

Tested with OSX 10.11.6 and Ubuntu 14.04

Compilation



Linux: Makefiles.

OSX: The best and easiest way is to use Xcode Projects. You can also use the makefiles, but in OSX you'll need to add ofxAudioDecoder to addons.make.

Dependencies



For playing and analyzing audio files (see Audio File Player),
ofxAudioDecoder addon is needed for OSX.

Usage



The examples included in the repository can be used to build new projects specially the empty ones. They can be compiled with Xcode or by Terminal using the Makefiles.

Creating a new project:

  • Create a new project using the Project Generator. Be sure to include ofxAudioAnalyzer and ofxAudioDecoder addons.
  • Include ofxAudioAnalyzer header into ofApp.h
    #include "ofxAudioAnalyzer.h"
  
  • Create an instance of ofxAudioAnalyzer into ofApp class:
  ofxAudioAnalyzer audioAnalyzer;
  
  • In the setup() function setup the audioAnalyzer's parameters (sampleRate, bufferSize, channels). Be sure that the parameters of the audioAnalyzer match the parameters of the ofSoundStream or the audio files you load to the sound player to avoid errors:
  audioAnalyzer.setup(44100, 512, 2);
  
  • Analyze the ofSoundBuffer in ofApp::audioIn() and ofApp::audioOut() when using ofSoundStream, or in the ofApp::update() if you are using audio file player, ofSoundBuffer parameters must always match audioAnalyzer's:
  audioAnalyzer.analyze(soundBuffer);
  


  float rms = audioAnalyzer.getValue(RMS, channel, smoothAmount, doNormalize);
  


Audio File player



This repository includes an extended version of ofBaseSoundPlayer taken and modified from: https://github.com/YCAMInterlab/ofxTimeline/tree/master/libs/ofOpenALSoundPlayer_TimelineAdditions/src.

This class [ofSoundPlayerExtended] lets you load, play and
analyze audiofiles (wav & mp3). See examples: allAlgorithms, audioFilePlayer and onsets* to understand how it works.

(!) ofSoundPlayerExtended is not really necessary for the addon to work. If you don't need or it's giving to much errors, just remove it from Xcode project or the addon's /src directory.

Issues

For any bug, help or feature request open an issue or check this OF Forum Thread.

License

Essentia library and this addon are distributed under Affero GPLv3 license. See License

Get this addon

HTTPS
SSH