Releases: sertansenturk/tomato
tomato v0.14.0
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Table of contents
- Introduction
- tomato in a nutshell
- Installation
- Documentation
- License
- FAQ
- Authors
- Acknowledgments
- References
1. Introduction
tomato
is a comprehensive and easy-to-use toolbox in Python for the analysis of audio recordings and music scores of Turkish-Ottoman makam music. The toolbox includes the state of art methodologies applied to this music tradition. The analysis tasks include:
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section, and phrase analysis
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, pitch distribution computation, tuning analysis, melodic progression analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note modeling
The toolbox aims to facilitate the analysis of large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies designed for the culture-specific characteristics 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.
If you are using tomato
in your work, please cite the dissertation:
Şentürk, S. (2016). Computational Analysis of Audio Recordings and Music Scores for the Description and Discovery of Ottoman-Turkish Makam Music. Ph.D. thesis, Universitat Pompeu Fabra, Barcelona, Spain.
For the sake of reproducibility, please also state the version you used as indexed at Zenodo.
For the descriptions of the methodologies in the toolbox, please refer to the papers listed in the References.
tomato v0.14.0
- Added docker support (Pull request #107)
- Improved
tomato
setup (Pull request #118) - Dropped Python 2 support; users must to switch to Python 3.5 to 3.7 (Pull request #110)
- Stopped active Mac OSX support; users are encouraged to switch to
tomato
docker (Pull request #108) - Introduced code linting (Pull request #117)
- Introduced
Makefile
(Pull request #121) - Created end-to-end tests for completeanalyzer and scoreconverter classes, running on docker environment (Pull request #120)
- Moved package to
src/tomato/
and data tosample-data/
(Pull request #122) - Added Github issue templates (Pull request #101)
2. tomato in a nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '11111111-1111-1111-1111-11111111111' # MusicBrainz Recording Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the Jupyter notebooks in demos folder for detailed, interactive examples.
3. Installation
3.1. Prequisites
tomato
may require several packages before installation, depending on your operating system. For example, in Ubuntu 16.04 using Python 3.5, you have to install the python 3, libxml2, libxslt1, freetype, and png development packages. You can install them by:
sudo apt-get install python3 python3.5-dev python3-pip libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
3.2. Install tomato using GNU make
You can install tomato
and all its dependencies by running in the terminal:
cd path/to/tomato
make
The above command installs tomato
to a virtual environment called ./venv
, as well as LilyPond and MATLAB Compiler Runtime.
If you want to install tomato
in editable mode with the extra Python requirements (i.e., demo
and development
), you can run:
make all-editable
For more options, please refer to the help by running:
make help
3.3. Running tomato using docker
For the reproducibility and maintability's sake, tomato
comes with docker
support.
To build the docker image simply go to the base folder of the repository and run:
docker build . -t sertansenturk/tomato:latest
You may interact with the docker image in many different ways. Below, we run a container by mounting the demos
folder in tomato and start an interactive bash
session:
docker run -v "$PWD/demos/":/home/tomato_user/demos/ -it sertansenturk/tomato bash
Then, you can work on the command line, like you are on your local machine. Any changes you make to the demos
folder will be reflected back to your local folder.
For more information on working with docker
, please refer to the official documentation.
3.4. Step-by-step installation
If the above options do not work for you, you need to complete the steps below:
3.4.1. Installing tomato
It is recommended to install tomato
and its dependencies into a virtualenv. In the terminal, do the following:
virtualenv -p python3 venv
Activate the virtual environment:
source venv/bin/activate
Then, change the current directory to the repository folder and install by:
cd path/to/tomato
python -m pip install .
If you want to edit files in the package and have the changes reflected, instead, you can call:
python -m pip install -e .
If you want to run the demo Jupyter notebooks and/or make development, you may include the extras to the installation by:
python -m pip install -e .[demo,development]
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements.txt
3.4.2. Installing MATLAB runtime
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 for R2015a (8.5) to run. You must download and install this specific version (Linux installer).
We recommend you to install MATLAB Runtime in the default installation path, as tomato
searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
3.4.3. Installing LilyPond
tomato
uses LilyPond under the hood to convert the music scores to SVG format.
In most Linux distributions, you can install LilyPond from the software repository of your distribution (e.g., sudo apt install lilypond
in Debian-based distributions).
tomato
requires LilyPond version 2.18.2 or above. If your distribution comes with an older version, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you might need to e...
tomato v0.13.0
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Introduction
tomato is a comprehensive and easy-to-use toolbox in Python for the analysis of audio recordings and music scores of Turkish-Ottoman makam music. The toolbox includes the state of art methodologies applied to this music tradition. The analysis tasks include:
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section, and phrase analysis
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, pitch distribution computation, tuning analysis, melodic progression analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note modeling
The toolbox aims to facilitate the analysis of large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies specifically designed for the culture-specific characteristics 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.
If you are using tomato in your work, please cite the dissertation:
Şentürk, S. (2016). Computational Analysis of Audio Recordings and Music Scores for the Description and Discovery of Ottoman-Turkish Makam Music. Ph.D. thesis, Universitat Pompeu Fabra, Barcelona, Spain.
For the sake of reproducibility, please also state the version you used as indexed at Zenodo.
For the descriptions of the methodologies in the toolbox, please refer to the papers listed in the References.
tomato v0.13.0
- Refactored the code (in particular metadata and score processing), which was previously ported from different makam analysis libraries in v0.11.0: Pull requests #84 and #94
Tomato in a Nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '11111111-1111-1111-1111-11111111111' # MusicBrainz Recording Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the jupyter notebooks in demos folder for detailed, interactive examples.
Installation
There are four steps in the installation:
Installing tomato
tomato requires several packages to be installed. In Linux, you have to install the python3 (or python 2.7, depending on your Python choice), libxml2, libxslt1, freetype and png development packages. The package names might vary in different Linux distributions. In Ubuntu 16.04, you can install these packages by:
sudo apt-get install python-dev libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
It is recommended to install tomato and its 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
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements.txt
If you want to edit files in the package and want the changes reflected, you should call:
cd path/to/tomato
pip install -e .
Installing Essentia
tomato uses several modules in Essentia. Follow the instructions to install the library.
If you are using Python 2.7, then you should link the python bindings of Essentia in the virtual environment:
ln -s path_to_essentia_bindings path_to_env/lib/python2.7/site-packages
Don't forget to change the path_to_essentia_bindings
and path_to_env
with the actual path of the installed Essentia Python bindings and the path of your virtualenv, respectively. Depending on the Essentia version, the default installation path of the Essentia bindings is either /usr/local/lib/python2.7/dist-packages/essentia
or /usr/local/lib/python2.7/site-packages/essentia
.
Installing MATLAB Runtime
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 for R2015a (8.5) to run. You should download and install this specific version (links for Linux and Mac OSX).
We recommend you to install MATLAB Runtime in the default installation path, as tomato searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
Installing LilyPond
If you want to convert the music scores to SVG format, LilyPond is a good choice, because it adds a mapping between each musical element in the LilyPond file and in the related SVG.
To install LilyPond in Mac OSX, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.
In most Linux distributions, you can install LilyPond from the software repository of your distribution. However, the version might be outdated. If the version is below 2.18.2, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond
).
Documentation
Coming soon...
License
The source code hosted in this repository is licensed under Affero GPL version 3.
Any data (the music scores, extracted features, training models, figures, outputs etc.) are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
FAQ
-
The notes aligned by
JointAnalyzer.align_audio_score(...)
seems shifted. What is the problem?Your audio input is probably a compressed format such as mp3. There are typically shifts between different decoders (and even different versions of the same decoder) when they decode the same compressed audio file. In the predominant melody extraction step (
AudioAnalyzer.extract_pitch(...)
), Essentia has to decode the recording for processing. You observe a shift when the application you use another decoder.These shifts are typically small (e.g. 50 samples ~1ms), so they are not very problematic. Nevertheless, there is no guarantee that the shift will be bigger. If you need "perfect" synchronization, you should use an uncompressed format such as wav as the audio input.
Note: In demos, we use mp3, because it would be too bulky to host a wav file.
-
Which operating systems are supported?
The algorithms, which are written purely in Python, are platform-independent. However, [compiling Essentia in Windows](http://essentia.upf.edu/docume...
tomato v0.12.3
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Introduction
tomato is a comprehensive and easy-to-use toolbox in Python for the analysis of audio recordings and music scores of Turkish-Ottoman makam music. The toolbox includes the state of art methodologies applied to this music tradition. The analysis tasks include:
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section, and phrase analysis
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, pitch distribution computation, tuning analysis, melodic progression analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note modeling
The aim of the toolbox is to facilitate the analysis of large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies specifically designed for the culture-specific characteristics 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.
If you are using tomato in your work, please cite the dissertation:
Şentürk, S. (2016). Computational Analysis of Audio Recordings and Music Scores for the Description and Discovery of Ottoman-Turkish Makam Music. Ph.D. thesis, Universitat Pompeu Fabra, Barcelona, Spain.
For the sake of reproducibility, please also state the version you used as indexed at Zenodo.
For the descriptions of the methodologies in the toolbox, please refer to the papers listed in the References.
tomato v0.12.3
- Solved the problem with loading the makam/tonic estimation model from pickle (removed
morty
dependency): Pull request #91
Tomato in a Nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '11111111-1111-1111-1111-11111111111' # MusicBrainz Recording Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the jupyter notebooks in demos folder for detailed, interactive examples.
Installation
There are four steps in the installation:
Installing tomato
tomato require several packages to be installed. In Linux, you have to install the python3 (or python 2.7, depending on your Python choice), libxml2, libxslt1, freetype and png development packages. The package names might vary in different Linux distributions. In Ubuntu 16.04, you can install these packages by:
sudo apt-get install python-dev libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
It is recommended to install tomato and its 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
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements.txt
If you want to edit files in the package and want the changes reflected, you should call:
cd path/to/tomato
pip install -e .
Installing Essentia
tomato uses several modules in Essentia. Follow the instructions to install the library.
If you are using Python 2.7, then you should link the python bindings of Essentia in the virtual environment:
ln -s path_to_essentia_bindings path_to_env/lib/python2.7/site-packages
Don't forget to change the path_to_essentia_bindings
and path_to_env
with the actual path of the installed Essentia Python bindings and the path of your virtualenv, respectively. Depending on the Essentia version, the default installation path of the Essentia bindings is either /usr/local/lib/python2.7/dist-packages/essentia
or /usr/local/lib/python2.7/site-packages/essentia
.
Installing MATLAB Runtime
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 for R2015a (8.5) to run. You should download and install this specific version (links for Linux and Mac OSX).
We recommend you to install MATLAB Runtime in the default installation path, as tomato searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
Installing LilyPond
If you want to convert the music scores to SVG format, LilyPond is a good choice, because it adds a mapping between each musical element in the LilyPond file and in the related SVG.
To install LilyPond in Mac OSX, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.
In most Linux distributions, you can install LilyPond from the software repository of your distribution. However, the version might be outdated. If the version is below 2.18.2, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond
).
Documentation
Coming soon...
License
The source code hosted in this repository is licensed under Affero GPL version 3.
Any data (the music scores, extracted features, training models, figures, outputs etc.) are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
FAQ
-
The notes aligned by
JointAnalyzer.align_audio_score(...)
seems shifted. What is the problem?Your audio input is probably a compressed format such as mp3. There are typically shifts between different decoders (and even different versions of the same decoder) when they decode the same compressed audio file. In the predominant melody extraction step (
AudioAnalyzer.extract_pitch(...)
), Essentia has to decode the recording for processing. You observe a shift when the application you use another decoder.These shifts are typically small (e.g. 50 samples ~1ms), so they are not very problematic. Nevertheless, there is no guarantee that the shift will be bigger. If you need "perfect" synchronization, you should use an uncompressed format such as wav as the audio input.
Note: In demos, we use mp3, because it would be too bulky to host a wav file.
-
Which operating systems are supported?
The algorithms, which are written purely in Python, are platform independent. However, compiling Essentia in Windows is not straightforward yet. Therefore...
tomato v0.12.2
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Introduction
tomato is a comprehensive and easy-to-use toolbox in Python for the analysis of audio recordings and music scores of Turkish-Ottoman makam music. The toolbox includes the state of art methodologies applied to this music tradition. The analysis tasks include:
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, histogram analysis, tuning analysis, melodic progression analysis
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section, and phrase analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note models, (usul tracking is coming soon)
The aim of the toolbox is to facilitate the analysis of large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies specifically designed for the culture-specific characteristics 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.
If you are using tomato in your work, please cite the dissertation:
Şentürk, S. (2016). Computational Analysis of Audio Recordings and Music Scores for the Description and Discovery of Ottoman-Turkish Makam Music. Ph.D. thesis, Universitat Pompeu Fabra, Barcelona, Spain.
For the methodologies and their implementations in the toolbox, please refer to the References.
tomato v0.12.2
- Solved the pool error occurring in Essentia version 2.1-beta5-dev: Pull request #86 (by Miguel García Casado)
Tomato in a Nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '11111111-1111-1111-1111-11111111111' # MusicBrainz Recording Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the jupyter notebooks in demos folder for detailed, interactive examples.
Installation
There are four steps in the installation:
Installing tomato
tomato require several packages to be installed. In Linux, you have to install the python 2.7, libxml2, libxslt1, freetype and png development packages. The package names might vary in different Linux distributions. In Ubuntu 16.04, you can install these packages by:
sudo apt-get install python-dev libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
It is recommended to install tomato and its 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
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements.txt
If you want to edit files in the package and want the changes reflected, you should call:
cd path/to/tomato
pip install -e .
Installing Essentia
tomato 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 path_to_essentia_bindings path_to_env/lib/python2.7/site-packages
Don't forget to change the path_to_essentia_bindings
and path_to_env
with the actual path of the installed Essentia Python bindings and the path of your virtualenv, respectively. Depending on the Essentia version, the default installation path of the Essentia bindings is either /usr/local/lib/python2.7/dist-packages/essentia
or /usr/local/lib/python2.7/site-packages/essentia
.
Installing MATLAB Runtime
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 for R2015a (8.5) to run. You should download and install this specific version (links for Linux and Mac OSX).
We recommend you to install MATLAB Runtime in the default installation path, as tomato searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
Installing LilyPond
If you want to convert the music scores to SVG format, LilyPond is a good choice, because it adds a mapping between each musical element in the LilyPond file and in the related SVG.
To install LilyPond in Mac OSX, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.
In most Linux distributions, you can install LilyPond from the software repository of your distribution. However, the version might be outdated. If the version is below 2.18.2, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond
).
Documentation
Coming soon...
License
The source code hosted in this repository is licensed under Affero GPL version 3.
Any data (the music scores, extracted features, training models, figures, outputs etc.) are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
FAQ
-
The notes aligned by
JointAnalyzer.align_audio_score(...)
seems shifted. What is the problem?Your audio input is probably a compressed format such as mp3. There are typically shifts between different decoders (and even different versions of the same decoder) when they decode the same compressed audio file. In the predominant melody extraction step (
AudioAnalyzer.extract_pitch(...)
), Essentia has to decode the recording for processing. You observe a shift when the application you use another decoder.These shifts are typically small (e.g. 50 samples ~1ms), so they are not very problematic. Nevertheless, there is no guarantee that the shift will be bigger. If you need "perfect" synchronization, you should use an uncompressed format such as wav as the audio input.
Note: In demos, we use mp3, because it would be too bulky to host a wav file.
-
Which operating systems are supported?
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 let us know by submitting an issue. -
**What are the suppo...
tomato v0.12.1
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Introduction
tomato is a comprehensive and easy-to-use toolbox in Python for the analysis of audio recordings and music scores of Turkish-Ottoman makam music. The toolbox includes the state of art methodologies applied to this music tradition. The analysis tasks include:
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, histogram analysis, tuning analysis, melodic progression analysis
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section, and phrase analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note models, (usul tracking is coming soon)
The aim of the toolbox is to facilitate the analysis of large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies specifically designed for the culture-specific characteristics 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.
If you are using tomato in your work, please cite the dissertation:
Şentürk, S. (2016). Computational Analysis of Audio Recordings and Music Scores for the Description and Discovery of Ottoman-Turkish Makam Music. Ph.D. thesis, Universitat Pompeu Fabra, Barcelona, Spain.
For the methodologies and their implementations in the toolbox, please refer to the References.
tomato v0.12.1
- Added missing makam & tonic estimation model: Pull request #86
Tomato in a Nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '11111111-1111-1111-1111-11111111111' # MusicBrainz Recording Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the jupyter notebooks in demos folder for detailed, interactive examples.
Installation
There are four steps in the installation:
Installing tomato
tomato require several packages to be installed. In Linux, you have to install the python 2.7, libxml2, libxslt1, freetype and png development packages. The package names might vary in different Linux distributions. In Ubuntu 16.04, you can install these packages by:
sudo apt-get install python-dev libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
It is recommended to install tomato and its 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
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements.txt
If you want to edit files in the package and want the changes reflected, you should call:
cd path/to/tomato
pip install -e .
Installing Essentia
tomato 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 path_to_essentia_bindings path_to_env/lib/python2.7/site-packages
Don't forget to change the path_to_essentia_bindings
and path_to_env
with the actual path of the installed Essentia Python bindings and the path of your virtualenv, respectively. Depending on the Essentia version, the default installation path of the Essentia bindings is either /usr/local/lib/python2.7/dist-packages/essentia
or /usr/local/lib/python2.7/site-packages/essentia
.
Installing MATLAB Runtime
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 for R2015a (8.5) to run. You should download and install this specific version (links for Linux and Mac OSX).
We recommend you to install MATLAB Runtime in the default installation path, as tomato searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
Installing LilyPond
If you want to convert the music scores to SVG format, LilyPond is a good choice, because it adds a mapping between each musical element in the LilyPond file and in the related SVG.
To install LilyPond in Mac OSX, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.
In most Linux distributions, you can install LilyPond from the software repository of your distribution. However, the version might be outdated. If the version is below 2.18.2, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond
).
Documentation
Coming soon...
License
The source code hosted in this repository is licensed under Affero GPL version 3.
Any data (the music scores, extracted features, training models, figures, outputs etc.) are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
FAQ
-
The notes aligned by
JointAnalyzer.align_audio_score(...)
seems shifted. What is the problem?Your audio input is probably a compressed format such as mp3. There are typically shifts between different decoders (and even different versions of the same decoder) when they decode the same compressed audio file. In the predominant melody extraction step (
AudioAnalyzer.extract_pitch(...)
), Essentia has to decode the recording for processing. You observe a shift when the application you use another decoder.These shifts are typically small (e.g. 50 samples ~1ms), so they are not very problematic. Nevertheless, there is no guarantee that the shift will be bigger. If you need "perfect" synchronization, you should use an uncompressed format such as wav as the audio input.
Note: In demos, we use mp3, because it would be too bulky to host a wav file.
-
Which operating systems are supported?
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 let us know by submitting an issue. -
What are the supported Python versions?
tomato supports both Python 2.7 and Python 3.
...
tomato v0.12.0
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Introduction
tomato is a comprehensive and easy-to-use toolbox in Python for the analysis of audio recordings and music scores of Turkish-Ottoman makam music. The toolbox includes the state of art methodologies applied to this music tradition. The analysis tasks include:
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, histogram analysis, tuning analysis, melodic progression analysis
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section, and phrase analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note models, (usul tracking is coming soon)
The aim of the toolbox is to facilitate the analysis of large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies specifically designed for the culture-specific characteristics 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.
If you are using tomato in your work, please cite the dissertation:
Şentürk, S. (2016). Computational Analysis of Audio Recordings and Music Scores for the Description and Discovery of Ottoman-Turkish Makam Music. Ph.D. thesis, Universitat Pompeu Fabra, Barcelona, Spain.
For the methodologies and their implementations in the toolbox, please refer to the References.
tomato v0.12.0
- Made the package Python 3 compatible: Pull request #78
Tomato in a Nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '11111111-1111-1111-1111-11111111111' # MusicBrainz Recording Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the jupyter notebooks in demos folder for detailed, interactive examples.
Installation
There are four steps in the installation:
Installing tomato
tomato require several packages to be installed. In Linux, you have to install the python 2.7, libxml2, libxslt1, freetype and png development packages. The package names might vary in different Linux distributions. In Ubuntu 16.04, you can install these packages by:
sudo apt-get install python-dev libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
It is recommended to install tomato and its 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
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements.txt
If you want to edit files in the package and want the changes reflected, you should call:
cd path/to/tomato
pip install -e .
Installing Essentia
tomato 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 path_to_essentia_bindings path_to_env/lib/python2.7/site-packages
Don't forget to change the path_to_essentia_bindings
and path_to_env
with the actual path of the installed Essentia Python bindings and the path of your virtualenv, respectively. Depending on the Essentia version, the default installation path of the Essentia bindings is either /usr/local/lib/python2.7/dist-packages/essentia
or /usr/local/lib/python2.7/site-packages/essentia
.
Installing MATLAB Runtime
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 for R2015a (8.5) to run. You should download and install this specific version (links for Linux and Mac OSX).
We recommend you to install MATLAB Runtime in the default installation path, as tomato searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
Installing LilyPond
If you want to convert the music scores to SVG format, LilyPond is a good choice, because it adds a mapping between each musical element in the LilyPond file and in the related SVG.
To install LilyPond in Mac OSX, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.
In most Linux distributions, you can install LilyPond from the software repository of your distribution. However, the version might be outdated. If the version is below 2.18.2, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond
).
Documentation
Coming soon...
License
The source code hosted in this repository is licensed under Affero GPL version 3.
Any data (the music scores, extracted features, training models, figures, outputs etc.) are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
FAQ
-
The notes aligned by
JointAnalyzer.align_audio_score(...)
seems shifted. What is the problem?Your audio input is probably a compressed format such as mp3. There are typically shifts between different decoders (and even different versions of the same decoder) when they decode the same compressed audio file. In the predominant melody extraction step (
AudioAnalyzer.extract_pitch(...)
), Essentia has to decode the recording for processing. You observe a shift when the application you use another decoder.These shifts are typically small (e.g. 50 samples ~1ms), so they are not very problematic. Nevertheless, there is no guarantee that the shift will be bigger. If you need "perfect" synchronization, you should use an uncompressed format such as wav as the audio input.
Note: In demos, we use mp3, because it would be too bulky to host a wav file.
-
Which operating systems are supported?
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 let us know by submitting an issue. -
What are the supported Python versions?
tomato supports both Python 2.7 and Python 3.
-
Where are the MATLAB binaries?
The binaries...
tomato v0.11.0
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Introduction
tomato is a comprehensive and easy-to-use toolbox in Python for the analysis of audio recordings and music scores of Turkish-Ottoman makam music. The toolbox includes the state of art methodologies applied to this music tradition. The analysis tasks include:
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, histogram analysis, tuning analysis, melodic progression analysis
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section, and phrase analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note models, (usul tracking is coming soon)
The aim of the toolbox is to facilitate the analysis of large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies specifically designed for the culture-specific characteristics 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.
If you are using tomato in your work, please cite the dissertation:
Şentürk, S. (2016). Computational Analysis of Audio Recordings and Music Scores for the Description and Discovery of Ottoman-Turkish Makam Music. Ph.D. thesis, Universitat Pompeu Fabra, Barcelona, Spain.
For the methodologies and their implementations in the toolbox, please refer to the References.
Changelog
- Ported all makam analysis libraries into tomato (Pull request #77)
Tomato in a Nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '11111111-1111-1111-1111-11111111111' # MusicBrainz Recording Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the jupyter notebooks in demos folder for detailed, interactive examples.
Installation
There are four steps in the installation:
Installing tomato
tomato require several packages to be installed. In Linux, you have to install the python 2.7, libxml2, libxslt1, freetype and png development packages. The package names might vary in different Linux distributions. In Ubuntu 16.04, you can install these packages by:
sudo apt-get install python-dev libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
It is recommended to install tomato and its 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
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements.txt
If you want to edit files in the package and want the changes reflected, you should call:
cd path/to/tomato
pip install -e .
Installing Essentia
tomato 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 path_to_essentia_bindings path_to_env/lib/python2.7/site-packages
Don't forget to change the path_to_essentia_bindings
and path_to_env
with the actual path of the installed Essentia Python bindings and the path of your virtualenv, respectively. Depending on the Essentia version, the default installation path of the Essentia bindings is either /usr/local/lib/python2.7/dist-packages/essentia
or /usr/local/lib/python2.7/site-packages/essentia
.
Installing MATLAB Runtime
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 for R2015a (8.5) to run. You should download and install this specific version (links for Linux and Mac OSX).
We recommend you to install MATLAB Runtime in the default installation path, as tomato searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
Installing LilyPond
If you want to convert the music scores to SVG format, LilyPond is a good choice, because it adds a mapping between each musical element in the LilyPond file and in the related SVG.
To install LilyPond in Mac OSX, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.
In most Linux distributions, you can install LilyPond from the software repository of your distribution. However, the version might be outdated. If the version is below 2.18.2, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond
).
Documentation
Coming soon...
License
The source code hosted in this repository is licensed under Affero GPL version 3.
Any data (the music scores, extracted features, training models, figures, outputs etc.) are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
FAQ
-
The notes aligned by
JointAnalyzer.align_audio_score(...)
seems shifted. What is the problem?Your audio input is probably a compressed format such as mp3. There are typically shifts between different decoders (and even different versions of the same decoder) when they decode the same compressed audio file. In the predominant melody extraction step (
AudioAnalyzer.extract_pitch(...)
), Essentia has to decode the recording for processing. You observe a shift when the application you use another decoder.These shifts are typically small (e.g. 50 samples ~1ms), so they are not very problematic. Nevertheless, there is no guarantee that the shift will be bigger. If you need "perfect" synchronization, you should use an uncompressed format such as wav as the audio input.
Note: In demos, we use mp3, because it would be too bulky to host a wav file.
-
Which operating systems are supported?
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 let us know by submitting an issue. -
What are the supported Python versions?
Even though the code in the tomato package is compliant with both Python 3+ and Python 2.7, most ...
tomato v0.10.1
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Introduction
tomato is a comprehensive and easy-to-use toolbox in Python 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 include:
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, histogram analysis, tuning analysis, melodic progression analysis
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section and phrase analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note models, (usul tracking is coming soon)
The aim of the toolbox is to facilitate the analysis of large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies specifically designed for the culture-specific characteristics 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.
If you are using tomato in your work, please cite the dissertation:
Şentürk, S. (2016). Computational Analysis of Audio Recordings and Music Scores for the Description and Discovery of Ottoman-Turkish Makam Music. PhD thesis, Universitat Pompeu Fabra, Barcelona, Spain.
For the methodologies and their implementations in the toolbox, please refer to the References.
Changelog
- Updated SymbTr-extras to the latest version (v0.4.0)
- Corrected a bug when
flags
input is not passed toScoreConversion.mu2_to_musicxml
Tomato in a Nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '11111111-1111-1111-1111-11111111111' # MusicBrainz Recording Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the jupyter notebooks in demos folder for detailed, interactive examples.
Installation
There are four steps in the installation:
Installing tomato
tomato require several packages to be installed. In Linux, you have to install the python 2.7, libxml2, libxslt1, freetype and png development packages. The package names might vary in different Linux distributions. In Ubuntu 16.04, you can install these packages by:
sudo apt-get install python-dev libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
It is recommended to install tomato and its 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
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements
If you want to edit files in the package and want the changes reflected, you should call:
cd path/to/tomato
pip install -e .
To run the demos, you need to install Jupyter Notebook:
pip install jupyter
Installing Essentia
tomato 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 path_to_essentia_bindings path_to_env/lib/python2.7/site-packages
Don't forget to change the path_to_essentia_bindings
and path_to_env
with the actual path of the installed Essentia Python bindings and the path of your virtualenv, respectively. Depending on the Essentia version, the default installation path of the Essentia bindings is either /usr/local/lib/python2.7/dist-packages/essentia
or /usr/local/lib/python2.7/site-packages/essentia
.
Installing MATLAB Runtime
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 for R2015a (8.5) to run. You should download and install this specific version (links for Linux and Mac OSX).
We recommend you to install MATLAB Runtime in the default installation path, as tomato searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
Installing LilyPond
If you want to convert the music scores to SVG format, LilyPond is a good choice, because it adds a mapping between each musical element in the LilyPond file and in the related SVG.
To install LilyPond in Mac OSX, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.
In most Linux distributions, you can install LilyPond from the software repository of your distribution. However, the version might be outdated. If the version is below 2.18.2, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond
).
Documentation
Coming soon...
License
The source code hosted in this repository is licensed under Affero GPL version 3.
Any data (the music scores, extracted features, training models, figures, outputs etc.) are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
FAQ
-
The notes aligned by
JointAnalyzer.align_audio_score(...)
seems shifted. What is the problem?Your audio input is probably a compressed format such as mp3. There are typically shifts between different decoders (and even different versions of the same decoder), when they decode the same compressed audio file. In the predominant melody extraction step (
AudioAnalyzer.extract_pitch(...)
), Essentia has to decode the recording for processing. You observe a shift when the application you use another decoder.These shifts are typically small (e.g. 50 samples ~1ms), so they are not very problematic. Nevertheless, there is no guarantee that the shift will be bigger. If you need "perfect" synchronization, you should use an uncompressed format such as wav as the audio input.
Note: In demos, we use mp3, because it would be too bulky to host a wav file.
-
Which operating systems are supported?
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 let us know by submitting an [issue](https://github.com/sertansenturk/tomato/...
tomato v0.10.0
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Introduction
tomato is a comprehensive and easy-to-use toolbox in Python 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 include:
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, histogram analysis, tuning analysis, melodic progression analysis
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section and phrase analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note models, (usul tracking is coming soon)
The aim of the toolbox is to facilitate the analysis of large-scale audio recording and music score collections of Turkish-Ottoman makam music, using the state of the art methodologies specifically designed for the culture-specific characteristics 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.
If you are using tomato in your work, please cite the dissertation:
Şentürk, S. (2016). Computational Analysis of Audio Recordings and Music Scores for the Description and Discovery of Ottoman-Turkish Makam Music. PhD thesis, Universitat Pompeu Fabra, Barcelona, Spain.
For the methodologies and their implementations in the toolbox, please refer to the References.
Changelog
- Integrated mu2 to MusicXML conversion (courtesy of Mogens Lundholm)
- Updated seyiranalyzer to the latest version (v1.2.0)
- Updated predominantmelodymakam to the latest version (v1.2.1)
Tomato in a Nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '11111111-1111-1111-1111-11111111111' # MusicBrainz Recording Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the jupyter notebooks in demos folder for detailed, interactive examples.
Installation
There are four steps in the installation:
Installing tomato
tomato require several packages to be installed. In Linux, you have to install the python 2.7, libxml2, libxslt1, freetype and png development packages. The package names might vary in different Linux distributions. In Ubuntu 16.04, you can install these packages by:
sudo apt-get install python-dev libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
It is recommended to install tomato and its 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
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements
If you want to edit files in the package and want the changes reflected, you should call:
cd path/to/tomato
pip install -e .
To run the demos, you need to install Jupyter Notebook:
pip install jupyter
Installing Essentia
tomato 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 path_to_essentia_bindings path_to_env/lib/python2.7/site-packages
Don't forget to change the path_to_essentia_bindings
and path_to_env
with the actual path of the installed Essentia Python bindings and the path of your virtualenv, respectively. Depending on the Essentia version, the default installation path of the Essentia bindings is either /usr/local/lib/python2.7/dist-packages/essentia
or /usr/local/lib/python2.7/site-packages/essentia
.
Installing MATLAB Runtime
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 for R2015a (8.5) to run. You should download and install this specific version (links for Linux and Mac OSX).
We recommend you to install MATLAB Runtime in the default installation path, as tomato searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
Installing LilyPond
If you want to convert the music scores to SVG format, LilyPond is a good choice, because it adds a mapping between each musical element in the LilyPond file and in the related SVG.
To install LilyPond in Mac OSX, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.
In most Linux distributions, you can install LilyPond from the software repository of your distribution. However, the version might be outdated. If the version is below 2.18.2, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond
).
Documentation
Coming soon...
License
The source code hosted in this repository is licensed under Affero GPL version 3.
Any data (the music scores, extracted features, training models, figures, outputs etc.) are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
FAQ
-
The notes aligned by
JointAnalyzer.align_audio_score(...)
seems shifted. What is the problem?Your audio input is probably a compressed format such as mp3. There are typically shifts between different decoders (and even different versions of the same decoder), when they decode the same compressed audio file. In the predominant melody extraction step (
AudioAnalyzer.extract_pitch(...)
), Essentia has to decode the recording for processing. You observe a shift when the application you use another decoder.These shifts are typically small (e.g. 50 samples ~1ms), so they are not very problematic. Nevertheless, there is no guarantee that the shift will be bigger. If you need "perfect" synchronization, you should use an uncompressed format such as wav as the audio input.
Note: In demos, we use mp3, because it would be too bulky to host a wav file.
-
Which operating systems are supported?
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 let us know by submitting an [issue](...
tomato v0.9.1
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 include:
- Audio Analysis: audio metadata crawling, predominant melody extraction, tonic and transposition identification, makam recognition, histogram analysis, tuning analysis, melodic progression analysis
- Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section and phrase analysis
- Joint Analysis: score-informed tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note models, (usul tracking is coming soon)
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 culture-specific characteristics 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.
For the methodologies and their implementations in the toolbox, please refer to the References.
Changelog
- Added DOI
- Added Contributors
- Moved package version to tomato init file
- Minor changes in setup to fetch the version automatically from
tomato.__version__
Tomato in a Nutshell
# import ...
from tomato.joint.completeanalyzer import CompleteAnalyzer
from matplotlib import pyplot as plt
# score input
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filename = 'path/to/txt_score'
mu2_score_filename = 'path/to/mu2_score'
# audio input
audio_filename = 'path/to/audio'
audio_mbid = '9244b2e0-6327-4ae3-9e8d-c0da54d39140' # MusicBrainz Identifier
# instantiate analyzer object
completeAnalyzer = CompleteAnalyzer()
# Apply the complete analysis. The resulting tuple will have
# (summarized_features, score_features, audio_features,
# score_informed_audio_features, joint_features) in order
results = completeAnalyzer.analyze(
symbtr_name=symbtr_name, symbtr_txt_filename=txt_score_filepath,
symbtr_mu2_filename=mu2_score_filepath, audio_filename=audio_filepath,
audio_metadata=audio_mbid)
# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
plt.show()
You can refer to the jupyter notebooks in demos folder for detailed, interactive examples.
Installation
There are four steps in the installation:
Installing tomato
The requirements of tomato require several packages to be installed. In Linux, you have to install the python 2.7, libxml2, libxslt1, freetype and png development packages packages. The package names might vary in different Linux distributions. In Ubuntu 16.04, you can install these packages by:
sudo apt-get install python-dev libxml2-dev libxslt1-dev libfreetype6-dev libpng12-dev
It is recommended to install tomato and its 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
The requirements are installed during the setup. If that step does not work for some reason, you can install the requirements by calling:
pip install -r requirements
If you want to edit files in the package and want the changes reflected, you should call:
cd path/to/tomato
pip install -e .
To run the demos, you need to install Jupyter Notebook:
pip install jupyter
Installing Essentia
tomato 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 path_to_essentia_bindings path_to_env/lib/python2.7/site-packages
Don't forget to change the path_to_essentia_bindings
and path_to_env
with the actual path of the installed Essentia Python bindings and the path of your virtualenv, respectively. Depending on the Essentia version, the default installation path of the Essentia bindings is either /usr/local/lib/python2.7/dist-packages/essentia
or /usr/local/lib/python2.7/site-packages/essentia
.
Installing MATLAB Runtime
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 for R2015a (8.5) to run. You should download and install this specific version (links for Linux and Mac OSX).
We recommend you to install MATLAB Runtime in the default installation path, as tomato searches them automatically. Otherwise, you have to specify your own path in the MATLAB Runtime configuration file, tomato/config/mcr_path.cfg.
Installing LilyPond
If you want to convert the music scores to svg format, LilyPond is a good choice, because it adds a mapping between each musical element in the LilyPond file and in the related svg.
To install LilyPond in Mac OSX, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.
In most Linux distributions, you can install LilyPond from the software repository of your distribution. However, the version might be outdated. If the version is below 2.18.2, we recommend you to download the latest stable version from the LilyPond website. If you had to install LilyPond this way, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond
).
Documentation
Coming soon...
License
The source code hosted in this repository is licenced under Affero GPL version 3. Any data (the audio recordings, music scores, extracted features, training models, figures, outputs etc.) are licenced under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
FAQ
-
The notes aligned by
JointAnalyzer.align_audio_score(...)
seems shifted. What is the problem?Your audio input is probably a compressed format such as mp3. There are typically shifts between different decoders (and even different versions of the same decoder), when they decode the same compressed audio file. In the predominant melody extraction step (
AudioAnalyzer.extract_pitch(...)
), Essentia has to decode the recording for processing. You observe a shift, when the application you use another decoder.These shifts are typically small (e.g. 50 samples ~1ms), so they are not very problematic. Nevertheless, there is no guarantee that the shift will be bigger. If you need "perfect" synchronization, you should use an uncompressed format such as wav as the audio input.
Note: In demos, we use mp3, because it would be too bulky to host a wav file.
-
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 let us know by submitting an issue. -
What are the supported Python versions?
Even though the code in the tomato package is compilant with both Python 3+ and Python 2.7, most of the requirements runs only in Python 2.7. We will start working on Python 3+ support, as soon as the Essentia bindings for Python 3 are available.
-
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...