/AlignmentServer

API for alignment of singing voice to lyrics as used in www.voicemagix.com. Core Machine Learning Algorithms are MLP neural networks and hidden markov models. Based on Django Rest Framework

Primary LanguagePython

Introduciton

An API based on Hidden Markov models and MLP Neural Networks that accepts as inputs the voice and the text and extracts the time information for each word.

Focused on voice (singing and speech) recordings with music in the background.

The core research algorithm is described in the Alignment repository.

Implemented as a RESTful API with Django Rest Framwork.

Requirements

  • Python 3.6.3
  • Django 2.0.3
  • Django Rest Framework 3.7.7
  • Postgres

License

Copyright 2017-2019 Voice Magix

For requesting a license please contact info@voicemagix.com

Installation

Following are the steps to install this platform.

  • Set the env var DJANGO_SETTINGS_MODULE DJANGO_SETTINGS_MODULE=Magixbackend.setting.test or DJANGO_SETTINGS_MODULE=Magixbackend.setting.production. Default is test, being set in manage.py

  • Create Virtual Environment

$ virtualenv magixbackend-venv --python=python3
$ cd magixbackend-venv
$ source bin/activate
  • Install Requirements
$ pip install -r requirements.txt
  • Setting up the postgres Database
$ cd Magixbackend
$ pwd //It should display like this "/Users/(user)/Magixbackend/Magixbackend"
$ sudo vim local_settings.py
    //Add the code below and save the file
    DATABASES = {
        'default': {
            'ENGINE': 'django.db.backends.postgresql_psycopg2',
            'NAME': 'magix_backend',
            'USER': 'username',
            'PASSWORD': 'password',
            'HOST': 'localhost',
            'PORT': '',
        }
    }
    // Note: Settings are for POSTGRES SQL
$ cd ..
$ python manage.py migrate

Run

python3 ~/workspace/AlignmentServer/src/align/doit.py ~/Documents/VOICE_magix/Lyric_find/19-lyrics/ABBA\ -\ Knowing\ Me,\ Knowing\ You.wav ~/Downloads/Babe_2.lrc 2 0 test.lab

Steps to production

  • Uncomment authentication classes in model/alignment
  • Create super User
$ python manage.py createsuperuser --username=mirza123 --email=mirza@gmail.com // unique username
  • To add users login with superuser http://localhost:8000/admin/
  • Enter basic information about user including random password to create user. Uncheck the is_active of user so that when user change password then user will be active.
  • Give unique username to the concerned clients so that they can change password with given username at endpoint http://localhost:8000/auth/password/change
  • After changing old password to new one, users can sign in at endpoint http://localhost:8000/auth/signin
  • Token will be expire after 30 days from sign in by user.

Documentation

Lyric-Find Dataset

Cross-check audio from LF and annoation present from Mauch and Gracenote Case 1) separation with DeepConvSep Case 2) separation with Audionamix

  1. check that lyrics .lrc are the same as .wordonsets (and respectively .txt) or at least that they have same num tokens Load in beyond compare .txt and .lrc.

  2. Make sure that the annotation .wordonsets corresponds to the audio from LF

  • open in audacity
  • python ~/workspace/lakh_vocal_segments_dataset/scripts/shift_time_annotaion.py ~/Documents/VOICE_magix/Lyric_find/19-lyrics/ABBA\ -\ Knowing\ Me,\ Knowing\ You.wordonset.tsv Assume that the line-level annotation has no errors.
  1. Time shift audio of the vocal.wav version with same

  2. Align source ~/.virtualenvs/drf/bin/activate python3 ~/workspace/AlignmentServer/scripts/run_all_lyric_find.py 0 for case 1 and python3 ~/workspace/AlignmentServer/scripts/run_all_lyric_find.py 1 for case 2

  3. Eval case 1) python /Users/joro/workspace/AlignmentEvaluation/align_eval/eval.py "/Users/joro/Documents/VOICE_magix/Lyric_find/19-lyrics/" "/Users/joro/Documents/VOICE_magix/Lyric_find/19-lyrics/" . 0.5

case 2) python /Users/joro/workspace/AlignmentEvaluation/align_eval/eval.py "/Users/joro/Documents/VOICE_magix/Lyric_find/19-lyrics/" "/Users/joro/Documents/VOICE_magix/Lyric_find/19-lyrics/audionamix_separated/" . 0.5