GithubHelp home page GithubHelp logo

nojux-official / autochord Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cjbayron/autochord

0.0 1.0 0.0 3.41 MB

Automatic Chord Recognition tools

Home Page: https://cjbayron.github.io/autochord/

License: Apache License 2.0

Python 2.32% Jupyter Notebook 97.68%

autochord's Introduction

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: you need to load a song, then you can upload a LAB file to visualize its chord labels. You may use the autochord Python library for generating this file. 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

autochord's People

Contributors

cjbayron avatar

Watchers

 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.