const Envelope = ({ trigger, gate, output, attack, decay, sustain, release }) => {
  const processEnvelope = useEnvelope();
  output.set(processEnvelope(
    trigger,
    gate,
    attack,
    decay,
    sustain,
    release,
  ));
}

this.constructDevice = () => constructPerChannelDevice({
  implementation: Envelope,
  inputs: {
    trigger: expose(zeroOneSetting('Trigger')),
    gate: expose(zeroOneSetting('Gate')),
    attack: adsrTimeSetting('Attack', 1),
    decay: adsrTimeSetting('Decay', 100),
    sustain: zeroOneSetting('Sustain', 0.5),
    release: adsrTimeSetting('Release', 300),
  },
  outputs: {
    output: { ...mono('Out'), min: 0 },
  }
});
