How to use the ddsp.synth.SynthModule 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 / ddsp / effects.py View on Github external
# -*- coding: utf-8 -*-

import torch
import torch.nn as nn
from ddsp.synth import SynthModule
    
class Effects(SynthModule):
    """
    Generic class for effects
    """
    
    def __init__(self):
        super(Effects, self).__init__()
        self.apply(self.init_parameters)
    
    def n_parameters(self):
        """ Return number of parameters in the module """
        return 0

    def forward(self, z):
        z, conditions = z
        return z
github acids-ircam / ddsp_pytorch / code / ddsp / filters.py View on Github external
# -*- coding: utf-8 -*-

import torch
import torch.nn as nn
from modules import ResConv1d
from ddsp.synth import SynthModule
    
class Filter(nn.Module, SynthModule):
    """
    Generic class for trainable signal filters.
    """
    
    def __init__(self):
        super(Filter, self).__init__()
        self.apply(self.init_parameters)
    
    def init_parameters(self, m):
        pass

    def forward(self, z):
        z, conditions = z
        return z

"""
github acids-ircam / ddsp_pytorch / code / ddsp / oscillators.py View on Github external
# -*- coding: utf-8 -*-

import torch
import torch.nn as nn
import numpy as np
from ddsp.synth import SynthModule
    
class Oscillator(SynthModule):
    
    def __init__(self):
        super(Oscillator, self).__init__()
        self.apply(self.init_parameters)
    
    def init_parameters(self, m):
        pass

    def forward(self, z):
        pass
    
class HarmonicOscillators(Oscillator):
    
    def __init__(self, n_partial, sample_rate, block_size):
        super(Oscillator, self).__init__()
        self.apply(self.init_parameters)
github acids-ircam / ddsp_pytorch / code / ddsp / generators.py View on Github external
# -*- coding: utf-8 -*-

import torch
import torch.nn as nn
from ddsp.synth import SynthModule
    
class Generator(SynthModule):
    """
    Generic class for trainable signal generators.
    """
    
    def __init__(self):
        super(Generator, self).__init__()
        self.apply(self.init_parameters)
    
    def init_parameters(self, m):
        pass

    def forward(self, z):
        z, conditions = z
        return z

class FilteredNoise(Generator):

ddsp

Differentiable Digital Signal Processing

Apache-2.0
Latest version published 12 months ago

Package Health Score

68 / 100
Full package analysis