Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# -*- 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
# -*- 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
"""
# -*- 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)
# -*- 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):