Coder Social home page Coder Social logo

medleydb's Introduction

medleydb

Python tools for using MedleyDB.

Created by Rachel Bittner rachel (dot) bittner (at) nyu (dot) edu and Justin Salamon justin (dot) salamon (at) nyu (dot) edu.

This code is released along with MedleyDB:

http://medleydb.weebly.com (or http://marl.smusic.nyu.edu/medleydb)

This code is a component of the work presented in the following publication:

R. Bittner, J. Salamon, M. Tierney, M. Mauch, C. Cannam and J. P. Bello, "MedleyDB: A Multitrack Dataset for Annotation-Intensive MIR Research", in 15th International Society for Music Information Retrieval Conference, Taipei, Taiwan, Oct. 2014.

Setup

First clone this repository:

git clone https://github.com/rabitt/medleydb.git

Next, set the environment variable MEDLEYDB_PATH to the local path where the MedleyDB directory (or MedleyDB_sample) lives:

export MEDLEYDB_PATH="path/to/your/copy/of/MedleyDB"

To avoid doing this step every time, copy the line above to .bash_profile or .bash_rc.

Dependencies

If you use pip and homebrew, you can install them by doing:

[sudo] pip install pyyaml
brew install sox

Usage and Examples

To load the module:

import medleydb as mdb

Loading and accessing the full dataset

Load the dataset to a list of MultiTrack objects:

mtrack_list = mdb.load_all_multitracks()

Some attributes of a multitrack:

multitrack_1 = next(mtrack_list)
multitrack_2 = next(mtrack_list)

multitrack_1.has_bleed
multitrack_2.has_bleed

multitrack_1.artist
multitrack_2.artist

multitrack_1.is_instrumental
multitrack_2.is_instrumental

multitrack_1.melody1_annotation

Some attributes of a particular stem:

example_stem = multitrack_1.stems[0]
example_stem.instrument
example_stem.pitch_annotation

Loading a subset of the dataset

A subset of the dataset can be loaded by passing a list of track folder paths:

import glob
import os
import medleydb as mdb

example_list = glob.glob(os.path.join(mdb.AUDIO_DIR, 'ClaraBerry_*'))
dataset_subset = mdb.load_multitracks(example_list)

Getting filepaths for audio of a chosen instrument

The following code will get a list of paths to stems that are labeled as a clarinet:

import medleydb as mdb

dataset = mdb.load_all_multitracks()
clarinet_files = mdb.get_files_for_instrument('clarinet')

To see a full list of possible instrument labels:

import medleydb as mdb

instruments = mdb.get_valid_instrument_labels()
print instruments

medleydb's People

Contributors

rabitt avatar nils-werner avatar

Watchers

James Cloos avatar Jake Zhao (Junbo) avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.