Skip to content

tomato v0.2.0

Compare
Choose a tag to compare
@sertansenturk sertansenturk released this 07 Apr 17:14
· 857 commits to master since this release

tomato

Turkish-Ottoman Makam (M)usic Analysis TOolbox

Introduction

tomato is a comprehensive and easy-to-use toolbox for the analysis of audio recordings and music scores of Turkish-Ottoman makam music. The toolbox includes the state of art methodologies applied on this music tradition. The analysis tasks currently include:

  • Audio Analysis: predominant melody extraction, tonic and transposition identification, histogram analysis, tuning analysis
  • Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section and phrase analysis

The aim of the toolbox is to allow the user to easily analyze large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies specifically designed for the necessities of this tradition. The analysis results can then be further used for several tasks such as automatic content description, music discovery/recommendation and musicological analysis.

Installation

If you want to install tomato, it is recommended to install the package and dependencies into a virtualenv. In the terminal, do the following:

virtualenv env
source env/bin/activate

Then change the current directory to the repository folder and install by:

cd path/to/tomato
python setup.py install

If you want to be able to edit files and have the changes be reflected, you should then call:

pip install -e .

The requirements are also installed during the setup. If that step does not work for some reason, you can install the requirements by calling:

pip install -r requirements

The algorithm uses several modules in Essentia. Follow the instructions to install the library. Then you should link the python bindings of Essentia in the virtual environment:

ln -s /usr/local/lib/python2.7/dist-packages/essentia env/lib/python2.7/site-packages

The score phrase segmentation, score-informed joint tonic identification and tempo estimation, section linking and note-level audio-score alignment algorithms are implemented in MATLAB and compiled as binaries. They need MATLAB Runtime Compiler for R2015a (8.5) to run. You should download (links for Linux and Mac OSX) and install this specific version. We recommend you to install MCR in the default installation path as tomato searches them automatically. Otherwise, you have to specify your own path in the MCR configuration file, tomato/config/bin.cfg.

Basic Usage

Below you can find some basic calls:

Audio Analysis
from tomato.audio.AudioAnalyzer import AudioAnalyzer

audio_filepath = 'path/to/audio'
makam = 'makam_name'  # the makam slug. See the documentation for possible values

audioAnalyzer = AudioAnalyzer()
features = audioAnalyzer.analyze(audio_filepath, makam=makam)

# plot the features
import pylab
audioAnalyzer.plot(features)
pylab.show()

# save features to a json file
audioAnalyzer.save_features(features, 'save_filename.json')

You can refer to audio_analysis_demo.ipynb for an interactive demo.

Symbolic Analysis
from tomato.symbolic.SymbTrAnalyzer import SymbTrAnalyzer

txt_filepath = 'path/to/symbtr_txt_score'
mu2_filepath = 'path/to/symbtr_mu2_score'

# only needed if the filename is modified from the SymbTr naming convention
symbtr_name = 'makam--form--usul--name--composer'

scoreAnalyzer = SymbTrAnalyzer()
features, is_data_valid = scoreAnalyzer.analyze(
    txt_filepath, mu2_filepath, symbtr_name=symbtr_name)

# save features to a json file
scoreAnalyzer.save_features(features, 'save_filename.json')

You can refer to score_analysis_demo.ipynb for an interactive demo.

Changelog

  • Added SymbTr-score analysis
  • Simplified and improved the installation process

FAQ

  1. Which operating systems are suppported?

    The algorithms, which are written purely in Python are platform independent. However compiling Essentia in Windows is not straightforward yet. Therefore we have only compiled the MATLAB binaries for Mac OSX and Linux.
    If you have compiled Essentia for Windows somehow or if you have any OS specific problems, please submit an issue.

  2. What are the supported Python versions?

    Currently we only support 2.7. We will start working on Python 3+ support, as soon as Essentia bindings for Python 3+ are available.

  3. Where are the MATLAB binaries?

    The binaries are not stored in tomato, because they relatively big. It would take too much space to store them here, including the versions introduced in each modification. Instead the binaries are provided within the releases of the relevant packages. The binaries are downloaded to tomato/bin during the installation process of tomato.
    Please refer to tomato/config/bin.cfg for the relevant releases.

Authors

Sertan Şentürk
[email protected]

References

Thesis