In [1]:
# Ignore a bunch of deprecation warnings
import sys
sys.path.append('../..')
import warnings
warnings.filterwarnings("ignore")

import copy
import os
import time
from tqdm import tqdm
import math

import ddsp
import ddsp.training

from data_handling.ddspdataset import DDSPDataset
from utils.training_utils import print_hparams, set_seed, save_results, str2bool
from hparams_midiae_interp_cond import hparams as hp
from midiae_interp_cond.get_model import get_model, get_fake_data

import librosa
import matplotlib.pyplot as plt
import numpy as np
import tensorflow.compat.v2 as tf
import tensorflow_datasets as tfds
import pandas as pd

from notebook_utils import *

set_seed(1234)

# Helper Functions
sample_rate = 16000


print('Done!')

from utils.audio_io import load_audio
Done!

Guitar Tone Transfer Results

Below contains the result of guitar tone transfer from saxophone and violin in the solo-inst dataset. The note-expression based tone transfer is compared with the original DDSP ld+f0 tone transfer.

TLDR: For instruments that have similar strong attack as guitar, such as saxophone, the DDSP ld+f0 tone transfer actually works fine. But for instruments with dissimilar attack and decay such as violin, the DDSP ld+f0 tone transfer performs poorly and the note-expression based tone transfer can have good and idiomatic results.

Saxophone -> Guitar

Source

In [2]:
wav = r'/data/ddsp-experiment/logs/tone_transfer_comparison/sax_to_gtr/source/4.wav'
plot_spec(load_audio(wav, sample_rate), sample_rate, title='source')

DDSP ld+f0 tone transfer

In [3]:
wav = r'/data/ddsp-experiment/logs/tone_transfer_comparison/sax_to_gtr/transfer_ddsp/4.wav'
plot_spec(load_audio(wav, sample_rate), sample_rate, title='DDSP ld+f0 tone transfer')