Skip to content

Releases: sertansenturk/tomato

tomato v0.9.0

24 Aug 07:58
Compare
Choose a tag to compare

Build Status GitHub version Code Climate

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

  • Integrated makam recognition
  • Added training models precomputed from otmm_makam_recognition_dataset for tonic identification and makam recognition
  • Fizes a bug where method parameters setters of pitch distribution and makam recognizer (stored in tow dictionaries) are failed to be set
  • Incremented the version of morty in requirements

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:

  1. Installing tomato
  2. Installing Essentia
  3. Installing MATLAB Runtime
  4. Installing LilyPond (optional)

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

  1. 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.

  2. 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.

  3. 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.

  4. 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 binar...

Read more

tomato v0.8.1

02 Aug 19:39
Compare
Choose a tag to compare

Build Status GitHub version Code Climate

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, histogram analysis, tuning analysis, (makam recognition is coming soon)
  • 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

  • Input and output filepaths are forced to UTF-8
  • Plotter._plot_stable_pitches skips uncalculated stable pitches
  • Carried get_lilypond_bin_path from scoreconverter to bin_caller
  • Added licence info to the README

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:

  1. Installing tomato
  2. Installing Essentia
  3. Installing MATLAB Runtime
  4. Installing LilyPond (optional)

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

  1. 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.

  2. 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.

  3. 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.

  4. 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.
    ...

Read more

tomato v0.8.0

02 Jun 10:56
Compare
Choose a tag to compare

Build Status GitHub version Code Climate

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, histogram analysis, tuning analysis, (makam recognition is coming soon)
  • 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.

Documentation

Coming soon...

License

Coming soon...

Installation

There are four steps in the installation:

  1. Installing tomato
  2. Installing Essentia
  3. Installing MATLAB Runtime
  4. Installing LilyPond (optional)

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. After installing Lilypond, you should enter the LilyPond binary path to the "custom" field in tomato/config/lilypond.cfg (the default location is $HOME/bin/lilypond).

Tomato in a Nutshell

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.

FAQ

  1. 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 has 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.

  2. 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.

  3. 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.

  4. 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.

  5. ScoreConverter says that "The lilypond path is not found". How can I fix the error?
    There can be similar problems regarding this issue:

  6. The user-provided filepath does not exist.

    Check your input MusicXML path.

  • LilyPond is not installed.

    Download the latest stable verions for your OS.

    • The binary path exists but it is not used.

      The path is not searched by the defaults defined in `tomato/config/lilypond.cf...

Read more

tomato v0.7.1

20 Apr 15:21
Compare
Choose a tag to compare

Build Status GitHub version Code Climate

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, histogram analysis, tuning analysis, (makam recognition is coming soon)
  • 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.

Documentation

Coming soon...

License

Coming soon...

Installation

There are four steps in the installation:

  1. Installing tomato
  2. Installing Essentia
  3. Installing MATLAB Runtime
  4. Installing LilyPonf (optional)

Installing tomato

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

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 .

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, simply go to the Download page in the LilyPond website and follow the instructions for your operating system.

Note: The LilyPond version hosted in the Linux distributions might be outdated. We recommend you to download the latest stable version from the [LilyPond website]((http://lilypond.org/download.html).

Tomato in a Nutshell

from tomato.joint.completeanalyzer import CompleteAnalyzer

# 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_txt_filename=txt_score_filepath,
    symbtr_mu2_filename=mu2_score_filepath, symbtr_name=symbtr_name,
    audio_filename=audio_filepath, audio_metadata=audio_mbid)

# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
pylab.show()

You can refer to audio_analysis_demo.ipynb, score_analysis_demo.ipynb, joint_analysis_demo.ipynb and complete_analysis_demo.ipynb for interactive demos.

FAQ

  1. 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 has 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.

  2. 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.

  3. 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.

  4. 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.

  5. ScoreConverter says that "The lilypond path is not found". How can I fix the error?
    There can be similar problems regarding this issue:

  6. The user-provided filepath does not exist.

    Check your input MusicXML path.

  • LilyPond is not installed.

    Download the latest stable verions for your OS.

    • The binary path exists but it is not used.

      The path is not searched by the defaults defined in tomato/config/lilypond.cfg. Add the path of the LilyPond binary to the configuration file.

Changelog

  • Changed the mappings in the svg files from ly to SymbTr-txt indices
  • Refactored module and object names according to PEP8 conventions
  • Fixed the broken imports from refactored packages

Authors

Sertan Şentürk
[email protected]

References

Thesis

tomato v0.7.0

17 Apr 22:59
Compare
Choose a tag to compare

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, histogram analysis, tuning analysis, (makam recognition is coming soon)
  • 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.

Documentation

Coming soon...

License

Coming soon...

Installation

There are three steps in installation:

  1. Installing tomato
  2. Installing Essentia
  3. Installing MATLAB Runtime

Installing tomato

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

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 .

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, simply go to the Download page in the LilyPond website for your operating system.

Tomato in a Nutshell

from tomato.joint.CompleteAnalyzer import CompleteAnalyzer

# 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_txt_filename=txt_score_filepath,
    symbtr_mu2_filename=mu2_score_filepath, symbtr_name=symbtr_name,
    audio_filename=audio_filepath, audio_metadata=audio_mbid)

# plot the summarized features
fig, ax = completeAnalyzer.plot(results[0])
ax[0].set_ylim([50, 500])
pylab.show()

You can refer to audio_analysis_demo.ipynb, score_analysis_demo.ipynb, joint_analysis_demo.ipynb and complete_analysis_demo.ipynb for interactive demos.

Changelog

  • Added CompleteAnalyzer class

  • Refactored ParamSetter class to the abstract Analyzer class. It is
    inherited by all "Analyzer" classes.

  • Improved partial processing when calling the main "analyze" method of
    each analysis class.

  • "analyze" methods now have a (variable length) **kwargs input as the
    input features. These features are not computed and used in the subsequent
    analysis steps.

  • Added ScoreConverter class

  • Added input parsing to Plotter.plot_audio_features

  • Makam ,tonic, transposition and tempo information is annotated in

    Plotter.plot_audio_features

    • Improved code quality
    • All note indices in the outputs are fixed to 1-indexing according to
      the Symbtr-txt convention (not the pythonic 0-indexing).
    • Updated requirements
    • Improved verbosity and warnings
    • Execution time of each step is printed if the verbose is True.

    FAQ

    1. 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 has 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 will be too bulky to host a wav file.

    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.

    1. 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.

    1. 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

tomato v0.6.0

08 Apr 05:07
Compare
Choose a tag to compare

Build Status GitHub version Code Climate

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, histogram analysis, tuning analysis, (makam recognition is coming soon)
  • 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.

Documentation

Coming soon...

License

Coming soon...

Installation

There are three steps in installation:

  1. Installing tomato
  2. Installing Essentia
  3. Installing MATLAB Runtime

Installing tomato

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

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 .

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.

Basic Usage

from tomato.audio.AudioAnalyzer import AudioAnalyzer
from tomato.symbolic.SymbTrAnalyzer import SymbTrAnalyzer
from tomato.joint.JointAnalyzer import JointAnalyzer

# score filepaths
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filepath = 'path/to/txt_score'
mu2_score_filepath = 'path/to/mu2_score'

# audio filepath
audio_filepath = 'path/to/audio'

# instantiate analyzer objects
scoreAnalyzer = SymbTrAnalyzer(verbose=True)
audioAnalyzer = AudioAnalyzer(verbose=True)
jointAnalyzer = JointAnalyzer(verbose=True)

# score analysis
score_features = scoreAnalyzer.analyze(
    txt_score_filepath, mu2_score_filepath, symbtr_name=symbtr_name)

# audio analysis
audio_features = audioAnalyzer.analyze(
    audio_filepath, makam=score_features['makam']['symbtr_slug'])

# joint analysis
joint_features, score_informed_audio_features = jointAnalyzer.analyze(
    txt_score_filepath, score_features, audio_filepath, audio_features['pitch'])

# redo some steps in audio analysis
score_informed_audio_features = audioAnalyzer.update_analysis(
    score_informed_audio_features)

# summarize all the features extracted from all sources
summarized_features = jointAnalyzer.summarize(
    audio_features, score_features, joint_features, score_informed_audio_features)

You can refer to audio_analysis_demo.ipynb, score_analysis_demo.ipynb, joint_analysis_demo.ipynb and complete_analysis_demo.ipynb for interactive demos.

Changelog

FAQ

  1. 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 has 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 will be too bulky to host a wav file.

  2. 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.

  3. 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.

  4. 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

tomato v0.5.0

07 Apr 17:29
Compare
Choose a tag to compare

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: predominant melody extraction, tonic and transposition identification, histogram analysis, tuning analysis, (makam recognition is coming soon)
  • 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.

Documentation

Coming soon...

License

Coming soon...

Installation

There are three steps in installation:

  1. Installing tomato
  2. Installing Essentia
  3. Installing MATLAB Runtime

Installing tomato

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

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 .

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.

Basic Usage

from tomato.audio.AudioAnalyzer import AudioAnalyzer
from tomato.symbolic.SymbTrAnalyzer import SymbTrAnalyzer
from tomato.joint.JointAnalyzer import JointAnalyzer

# score filepaths
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filepath = 'path/to/txt_score'
mu2_score_filepath = 'path/to/mu2_score'

# audio filepath
audio_filepath = 'path/to/audio'

# instantiate analyzer objects
scoreAnalyzer = SymbTrAnalyzer(verbose=True)
audioAnalyzer = AudioAnalyzer(verbose=True)
jointAnalyzer = JointAnalyzer(verbose=True)

# score analysis
score_features = scoreAnalyzer.analyze(
    txt_score_filepath, mu2_score_filepath, symbtr_name=symbtr_name)

# audio analysis
audio_features = audioAnalyzer.analyze(
    audio_filepath, makam=score_features['makam']['symbtr_slug'])

# joint analysis
joint_features, score_informed_audio_features = jointAnalyzer.analyze(
    txt_score_filepath, score_features, audio_filepath, audio_features['pitch'])

# redo some steps in audio analysis
score_informed_audio_features = audioAnalyzer.update_analysis(
    score_informed_audio_features)

# summarize all the features extracted from all sources
summarized_features = jointAnalyzer.summarize(
    audio_features, score_features, joint_features, score_informed_audio_features)

You can refer to audio_analysis_demo.ipynb, score_analysis_demo.ipynb, joint_analysis_demo.ipynb and complete_analysis_demo.ipynb for interactive demos.

Changelog

  • Analysis can be run with partial success when some inputs are not available or some methods fails (Issue #24)

FAQ

  1. 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 has 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 will be too bulky to host a wav file.

  2. 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.

  3. 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.

  4. 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

tomato v0.4.0

07 Apr 17:17
Compare
Choose a tag to compare

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: predominant melody extraction, tonic and transposition identification, histogram analysis, tuning analysis, (makam recognition is coming soon)
  • 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.

Documentation

Coming soon...

License

Coming soon...

Installation

There are three steps in installation:

  1. Installing tomato
  2. Installing Essentia
  3. Installing MATLAB Runtime

Installing tomato

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

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 .

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.

Basic Usage

from tomato.audio.AudioAnalyzer import AudioAnalyzer
from tomato.symbolic.SymbTrAnalyzer import SymbTrAnalyzer
from tomato.joint.JointAnalyzer import JointAnalyzer

# score filepaths
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filepath = 'path/to/txt_score'
mu2_score_filepath = 'path/to/mu2_score'

# audio filepath
audio_filepath = 'path/to/audio'

# instantiate analyzer objects
scoreAnalyzer = SymbTrAnalyzer(verbose=True)
audioAnalyzer = AudioAnalyzer(verbose=True)
jointAnalyzer = JointAnalyzer(verbose=True)

# score analysis
score_features = scoreAnalyzer.analyze(
    txt_score_filepath, mu2_score_filepath, symbtr_name=symbtr_name)

# audio analysis
audio_features = audioAnalyzer.analyze(
    audio_filepath, makam=score_features['makam']['symbtr_slug'])

# joint analysis
joint_features, score_informed_audio_features = jointAnalyzer.analyze(
    txt_score_filepath, score_features, audio_filepath, audio_features['pitch'])

# redo some steps in audio analysis
score_informed_audio_features = audioAnalyzer.update_analysis(
    score_informed_audio_features)

# summarize all the features extracted from all sources
summarized_features = jointAnalyzer.summarize(
    audio_features, score_features, joint_features, score_informed_audio_features)

You can refer to audio_analysis_demo.ipynb, score_analysis_demo.ipynb, joint_analysis_demo.ipynb and complete_analysis_demo.ipynb for interactive demos.

Changelog

  • Created IO, Plotter and ParamSetter classes
  • Refactored the code to use the methods from above classes for shared processes
  • All output variables are now in snake_case
  • Better saving and loading
  • Improved code quality

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

tomato v0.3.0

07 Apr 17:15
Compare
Choose a tag to compare

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: predominant melody extraction, tonic and transposition identification, histogram analysis, tuning analysis, (makam recognition is coming soon)
  • Symbolic Analysis: score metadata extraction, score section extraction, score phrase segmentation, semiotic section and phrase analysis
  • Score-Informed Audio Analysis: (coming soon) partial audio-score alignment, joint tonic identification and tempo estimation, section linking, note-level audio-score alignment, predominant melody octave correction, note models, usul tracking

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.

For the methodologies and their implementations in the toolbox, please refer to the References (coming soon).

Documentation

Coming soon...

License

Coming soon...

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

from tomato.audio.AudioAnalyzer import AudioAnalyzer
from tomato.symbolic.SymbTrAnalyzer import SymbTrAnalyzer
from tomato.joint.JointAnalyzer import JointAnalyzer

# score filepaths
symbtr_name = 'makam--form--usul--name--composer'
txt_score_filepath = 'path/to/txt_score'
mu2_score_filepath = 'path/to/mu2_score'

# audio filepath
audio_filepath = 'path/to/audio'

# instantiate analyzer objects
scoreAnalyzer = SymbTrAnalyzer(verbose=True)
audioAnalyzer = AudioAnalyzer(verbose=True)
jointAnalyzer = JointAnalyzer(verbose=True)

# score analysis
score_features = scoreAnalyzer.analyze(
    txt_score_filepath, mu2_score_filepath, symbtr_name=symbtr_name)

# audio analysis
audio_features = audioAnalyzer.analyze(
    audio_filepath, makam=score_features['makam']['symbtr_slug'])

# joint analysis
joint_features, score_informed_audio_features = jointAnalyzer.analyze(
    txt_score_filepath, score_features, audio_filepath, audio_features['pitch'])

# redo some steps in audio analysis
score_informed_audio_features = audioAnalyzer.update_analysis(
    score_informed_audio_features)

# summarize all the features extracted from all sources
summarized_features = jointAnalyzer.summarize(
    audio_features, score_features, joint_features, score_informed_audio_features)

You can refer to audio_analysis_demo.ipynb, score_analysis_demo.ipynb, joint_analysis_demo.ipynb and complete_analysis_demo.ipynb for interactive demos.

Changelog

  • Added joint audio-score analysis
  • Minor improvement and bug fixes in SymbTrAnalyzer and AudioAnalyzer classes

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

tomato v0.2.0

07 Apr 17:14
Compare
Choose a tag to compare

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