Skip to content

Instantly share code, notes, and snippets.

@fredyjl
Created October 24, 2017 07:58
Show Gist options
  • Save fredyjl/528e09431b02fba9a1bfdb1106970549 to your computer and use it in GitHub Desktop.
Save fredyjl/528e09431b02fba9a1bfdb1106970549 to your computer and use it in GitHub Desktop.
This file has been truncated, but you can view the full file.
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Alignment-based pitch correction\n",
"### This is the demo page of aligning the following source-target pair:\n",
"1. Source: monophonic amateur singing\n",
"2. Target: polyphonic good or professional singing\n",
"\n",
"### To generalize the scenario, the PCA-reduced raw feature STFT is used for alingment\n",
"##### Fore more information, refer to the accompanying paper: Expressive Singing Voice Correction Using Canonical Time Warping"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import librosa\n",
"from IPython.display import display, Audio"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"SR = 16000\n",
"x1 = librosa.load('/Users/yjluo/Desktop/subjectivetest_2/demo_mp_stft/gentle_source.wav', sr=16000)[0]\n",
"y1 = librosa.load('/Users/yjluo/Desktop/subjectivetest_2/demo_mp_stft/gentle_target.wav', sr=16000)[0]\n",
"x1_re_ctw = librosa.load('/Users/yjluo/Desktop/subjectivetest_2/demo_mp_stft/gentle_mp_pcastft_ctw.wav', sr=16000)[0] \n",
"x1_re_dtw = librosa.load('/Users/yjluo/Desktop/subjectivetest_2/demo_mp_stft/gentle_mp_pcastft_dtw.wav', sr=16000)[0] "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Song #1"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Source\n"
]
},
{
"data": {
"text/html": [
"\n",
" <audio controls=\"controls\" >\n",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment