How to use the ddsp.analysis.MultiscaleFFT function in ddsp

To help you get started, we’ve selected a few ddsp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github acids-ircam / ddsp_pytorch / code / data.py View on Github external
def __init__(self, datadir, args, transform=None, splits=[.8, .1, .1], shuffle_files=True, train='train'):
        self.args = args
        # Metadata and raw
        self.data_files = []
        # Spectral transforms
        self.features_files = []
        # Construct set of extractors
        self.construct_extractors(args)
        # Construct the FFT extractor
        self.multi_fft = MultiscaleFFT(args.scales)
        # Retrieve list of files
        tmp_files = sorted(glob.glob(datadir + '/raw/*.wav'))
        self.data_files.extend(tmp_files)
        if (not os.path.exists(datadir + '/data') or len(glob.glob(datadir + '/data/*.npy')) == 0):
            os.makedirs(datadir + '/data')
            self.preprocess_dataset(datadir)
        feat_files = sorted(glob.glob(datadir + '/data/*.npy'))
        self.features_files.extend(feat_files)
        # Analyze dataset
        self.analyze_dataset()
        # Create splits
        self.create_splits(splits, shuffle_files)
        # Compute mean and std of dataset
        self.compute_normalization()
        # Now we can create the normalization / augmentation transform
        self.transform = transform

ddsp

Differentiable Digital Signal Processing

Apache-2.0
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis

Similar packages