Skip to main content

Automatic Chord Recognition library

Project description

autochord

Automatic Chord Recognition tools

About

autochord is:

✔ a [Python library] for automatic chord recognition (using TensorFlow)

✔ a Javascript app for visualization of chord transcriptions:

Library Usage

To install library, run:

$ pip install autochord

autochord provides a very simple API for performing chord recognition:

import autochord
autochord.recognize('audio.wav', lab_fn='chords.lab')
# This gives out a list of tuples in the format:
#  (chord start, chord end, chord name)
# e.g.
# [(0.0, 5.944308390022676, 'D:maj'),
#  (5.944308390022676, 7.476825396825397, 'C:maj'),
#  (7.476825396825397, 18.250884353741498, 'D:maj'),
#  (18.250884353741498, 19.736961451247165, 'C:maj')
#  ...
#  (160.49632653061224, 162.30748299319728, 'N')]

Under the hood autochord.recognize() runs the NNLS-Chroma VAMP plugin to extract chroma features from the audio, and feeds it to a Bi-LSTM-CRF model in TensorFlow to recognize the chords. Currently, the model can recognize 25 chord classes: the 12 major triads, 12 minor triads, and no-chord ('N').

OPTIONALLY, you may dump the chords in a .lab file by using the lab_fn parameter. The output file follows the MIREX chord label format.

Upon import autochord takes care of setting up the VAMP plugin and downloading the pre-trained chord recognition model.

The measured test accuracy of the TensorFlow model is 67.33%. That may be enough for some songs, but we can explore in the future how to further improve this.

App Usage

The app is pretty straightforward. First, you need to load the song you wish to visualize the chords of, then you can upload the LAB file for its chord labels. You may use the autochord Python library for this. Optionally, you may load another LAB file for comparison (e.g. ground-truth labels, LAB file from another model's prediction).

Future Improvements

  • Integrate everything into a full chord recognition app! For that we need to:
    • convert VAMP plugin to JS module
    • model conversion to TensorFlow.js (as of writing, some CRF operations are not supported by TFJS yet)
    • converting all other Python functions to JS equivalent
  • Experimenting with other approaches to improve chord recognition accuracy

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autochord-0.1.2.tar.gz (344.9 kB view details)

Uploaded Source

Built Distributions

autochord-0.1.2-py3.6.egg (348.0 kB view details)

Uploaded Source

autochord-0.1.2-py3-none-any.whl (350.2 kB view details)

Uploaded Python 3

File details

Details for the file autochord-0.1.2.tar.gz.

File metadata

  • Download URL: autochord-0.1.2.tar.gz
  • Upload date:
  • Size: 344.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.6

File hashes

Hashes for autochord-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e4c74788fa875d7b493300e78e1e0df1e595eeb25f3108a305419fbcc85745a9
MD5 2f95af0b1965f7896d7e6727abe17aac
BLAKE2b-256 402b328779826d0c8f88749bdc790a55d1b52f6a6113ccd3e9895dfd97cf16f5

See more details on using hashes here.

File details

Details for the file autochord-0.1.2-py3.6.egg.

File metadata

  • Download URL: autochord-0.1.2-py3.6.egg
  • Upload date:
  • Size: 348.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.6

File hashes

Hashes for autochord-0.1.2-py3.6.egg
Algorithm Hash digest
SHA256 8dea4f641ba2ce508a6296513c4df9b30f87c5649f7db822262e6c6aa19dbd62
MD5 e71e879fd7003da65c289ccb0548e201
BLAKE2b-256 8bd147a00fe477745e78bbd783c05762e6dffb111a2f76dd7613d4fc83846b9b

See more details on using hashes here.

File details

Details for the file autochord-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: autochord-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 350.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.49.0 CPython/3.6.6

File hashes

Hashes for autochord-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ee5a92625ad0a0786f884e7038784b29f8416a1781e7b46674c1281fa6db344
MD5 ff6474c4f88e536d63730d84b7dfbbe2
BLAKE2b-256 951991d5d3c9876fa53f28e4b0af2f4e77eea4991e962a916bddfb95612693e8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page