class_docstr: Decodes MIDI notes (& velocities) to f0, amps, hd, noise.
class_docstr_tok: ["Decodes","MIDI","notes","(","&","velocities",")","to","f0",",","amps",",","hd",",","noise","."]
docstr: Constructor.
docstr_tok: ["Constructor","."]
code: def __init__(
      self,
      net=None,
      f0_residual=True,
      norm=True,
      output_splits=(
          ("f0_midi", 1),
          ("amplitudes", 1),
          ("harmonic_distribution", 60),
          ("magnitudes", 65),
      ),
      midi_zero_silence=True,
      **kwargs,
  ):
      """Constructor."""
      self.output_splits = output_splits
      self.n_out = sum([v[1] for v in output_splits])
      output_keys = [v[0] for v in output_splits] + ["f0_hz"]
      super().__init__(output_keys=output_keys, **kwargs)
  
      # Layers.
      self.net = net
      self.f0_residual = f0_residual
      self.dense_out = tfkl.Dense(self.n_out)
      self.norm = nn.Normalize("layer") if norm else None
      self.midi_zero_silence = midi_zero_silence
  
imports: from ddsp import core
  from ddsp.training import nn
  import gin
  import tensorflow
label_desc: Use image node_id 1 to create a new MidiToHarmonicDecoder object from inherited base classes: nn with example: obj = MidiToHarmonicDecoder(net, f0_residual, norm, output_splits, midi_zero_silence)