All Projects → YuriyGuts → dechorder

YuriyGuts / dechorder

Licence: BSD-3-Clause license
Automatic chord recognition application powered by machine learning

Programming Languages

python
139335 projects - #7 most used programming language
swift
15916 projects
shell
77523 projects
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to dechorder

ElectricPy
Electrical Engineering Python Module
Stars: ✭ 35 (-16.67%)
Mutual labels:  digital-signal-processing
CNN-VAD
A Convolutional Neural Network based Voice Activity Detector for Smartphones
Stars: ✭ 60 (+42.86%)
Mutual labels:  digital-signal-processing
mtg-jamendo-dataset
Metadata, scripts and baselines for the MTG-Jamendo dataset
Stars: ✭ 140 (+233.33%)
Mutual labels:  music-information-retrieval
dsp-kit
A digital signal processing library in Javascript
Stars: ✭ 32 (-23.81%)
Mutual labels:  digital-signal-processing
vamp-aubio-plugins
aubio plugins for Vamp
Stars: ✭ 38 (-9.52%)
Mutual labels:  music-information-retrieval
MidiTok
A convenient MIDI / symbolic music tokenizer for Deep Learning networks, with multiple strategies 🎶
Stars: ✭ 180 (+328.57%)
Mutual labels:  music-information-retrieval
EmiyaEngine
只要蘊藏著想成為真物的意志,偽物就比真物還要來得真實。
Stars: ✭ 27 (-35.71%)
Mutual labels:  digital-signal-processing
Audio Signal Processing
Audio or speech signal processing guide.
Stars: ✭ 45 (+7.14%)
Mutual labels:  digital-signal-processing
nowplaying-RS-Music-Reco-FM
#nowplaying-RS: Music Recommendation using Factorization Machines
Stars: ✭ 23 (-45.24%)
Mutual labels:  music-information-retrieval
Music-Genre-Classification
Genre Classification using Convolutional Neural Networks
Stars: ✭ 27 (-35.71%)
Mutual labels:  music-information-retrieval
audio to midi
A CNN which converts piano audio to a simplified MIDI format
Stars: ✭ 29 (-30.95%)
Mutual labels:  music-information-retrieval
arranger
An AI for Automatic Instrumentation
Stars: ✭ 37 (-11.9%)
Mutual labels:  music-information-retrieval
DTW Digital Voice Recognition
基于DTW与MFCC特征进行数字0-9的语音识别,DTW,MFCC,语音识别,中英数据,端点检测,Digital Voice Recognition。
Stars: ✭ 28 (-33.33%)
Mutual labels:  digital-signal-processing
essentia-tutorial
A tutorial for using Essentia in Python
Stars: ✭ 16 (-61.9%)
Mutual labels:  music-information-retrieval
SymbTr
Turkish Makam Music Symbolic Data Collection
Stars: ✭ 55 (+30.95%)
Mutual labels:  music-information-retrieval
dsp
Header only C++14 library containing various digital signal processing utilities.
Stars: ✭ 30 (-28.57%)
Mutual labels:  digital-signal-processing
tomato
Turkish-Ottoman Makam (M)usic Analysis TOolbox
Stars: ✭ 30 (-28.57%)
Mutual labels:  music-information-retrieval
sampleCNN-pytorch
Pytorch implementation of "Sample-level Deep Convolutional Neural Networks for Music Auto-tagging Using Raw Waveforms"
Stars: ✭ 45 (+7.14%)
Mutual labels:  music-information-retrieval
dsp-theory
Theory of digital signal processing (DSP): signals, filtration (IIR, FIR, CIC, MAF), transforms (FFT, DFT, Hilbert, Z-transform) etc.
Stars: ✭ 643 (+1430.95%)
Mutual labels:  digital-signal-processing
oscimpDigital
OscillatorIMP ecosystem for the digital characterization of ultrastable oscillators and Software Defined Radio (SDR) frontend processing
Stars: ✭ 41 (-2.38%)
Mutual labels:  digital-signal-processing

Dechorder

Automatic chord recognition application powered by machine learning.

Demo video on YouTube

image

Overall Flow

  1. User records an audio sample using a microphone on an iOS device.
  2. The raw audio file is sent to the backend API (via HTTP file upload) for recognition.
  3. The backend extracts features from the uploaded audio file and predicts chords in the file. Either a built-in model or an external machine learning service like DataRobot can be used for predictions depending on the configuration.
  4. Chord annotations (time marker, chord name, confidence) are sent back from the API to the client.
  5. The client app provides the user with a playback interface and allows fast-forwarding to particular chords.

Deployment Options

  1. Client: iPhone/iPad application running iOS 12+.
  2. Server:
    • Python Flask application, or
    • AWS Lambda function running behind an AWS API Gateway

Development

Not all dependencies are required for all development tasks but the complete list of additional components is provided below:

  1. iOS App: CocoaPods + Swift packages from Podfile.
  2. Backend: FFmpeg + Python packages from requirements.txt.
  3. Data preparation tools: sox.
  4. AWS Lambda deployment: awscli.

Building

Client: iOS App

The initial version of the app was built using Swift 2 and XCode 7, then upgraded to Swift 5 and XCode 10, with up-to-date CocoaPods packages at the time of writing.

Server: AWS Lambda

An AWS Lambda deployment package for Dechorder is extremely tricky to build, due to multiple factors:

  1. Specific runtime environment. At the time of writing this, AWS Lambda execution environment includes the following:

    • Operating system – Amazon Linux.
    • AMI – amzn-ami-hvm-2018.03.0.20181129-x86_64-gp2
    • Linux kernel – 4.14.94-73.73.amzn1.x86_64
    • Python 3.7 SDK – boto3-1.9.42 botocore-1.12.42
  2. Binary dependencies. Scientific libraries used in feature engineering require low-level linear algebra libraries, binary utilities, and JIT compilation, tailored to the specific runtime mentioned above. For example:

    • numpy and scipy require ATLAS and LAPACK.
    • librosa requires numba, which requires an exact version of llvmlite, which requires static linking to LLVM, which needs to be custom-built from source.
      • Warning: at the time of writing, SVN repo for LLVM is being deprecated, so the sources and build steps might need to be changed in case of upgrading Dechorder infrastructure.
    • MP3/M4A audio backends for librosa require FFmpeg command-line binary which needs to be custom-built from source.
  3. Package size limitations. At the time of writing this, AWS Lambda requires the unpacked archive to be under 250 MB. At the same time, we have to bundle all binary dependencies mentioned above along with 15+ pip packages. As a result, we use the following tricks to reduce the package size:

    • LLVM is built only with X86 support and in minimum release size mode.
    • All installed pip packages are postprocessed: .so libraries are stripped of object/debug information, unit tests and example data are removed.
    • Static libraries (.a) are not included, only .so files.
    • The tricks above allow us to reach a deployment package size of ~160 MB.

Due to the factors above, the actual build is performed inside a Docker container running Amazon Linux with an environment similar to AWS Lambda runtime. When you run build.sh, it launches a Docker container and runs build-amazonlinux.sh inside it, mounting the host folder to store all artifacts.

Deploying

Server: AWS Lambda

  1. Install Docker.

  2. Run the following (might take a few hours to run):

    $ cd backend/aws_lambda
    $ ./build.sh
  3. If you're using Linux, you might have to run sudo chown -R $(whoami) build afterwards as well to get the ownership back.

  4. Run the following:

    $ cd backend/aws_lambda
    $ AWS_PROFILE=<your-awscli-profile-name> DECHORDER_S3_BUCKET=<your-bucket-name> ./deploy.sh
  5. Your code (lambda_function.zip) should now be uploaded to an S3 bucket and deployed to AWS Lambda.

  6. Configure the lambda function in AWS Management Console:

    • Customize the PATH environment variable to include the bin folder from the package:
      • PATH: /var/task/bin:/var/lang/bin:/usr/local/bin:/usr/bin/:/bin:/opt/bin
    • Customize the DECHORDER_PREDICTION_SERVICE environment variable:
      • For random predictions, specify DummyPredictionService
      • For using the built-in neural network classifier, specify EmbeddedPredictionService
      • For DataRobot Prediction API v1.0, specify DataRobotV1APIPredictionService
    • For using DataRobot Prediction API v1.0, you need a DataRobot account. Customize the following environment variables as well:
      • DATAROBOT_SERVER
      • DATAROBOT_SERVER_KEY
      • DATAROBOT_DEPLOYMENT_ID
      • DATAROBOT_USERNAME
      • DATAROBOT_API_TOKEN
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].