const LFO = ({ frequency, trigger, saw, sin, square, triangle, phase, noise }) => {
  const sawOsc = useOscillator(Waveform.Sawtooth);
  const sinOsc = useOscillator(Waveform.Sine);
  const squareOsc = useOscillator(Waveform.Square);
  const triangleOsc = useOscillator(Waveform.Triangle);
  const noiseOsc = useOscillator(Waveform.Noise);
  saw.set(sawOsc(frequency, phase, trigger));
  sin.set(sinOsc(frequency, phase, trigger));
  square.set(squareOsc(frequency, phase, trigger));
  triangle.set(triangleOsc(frequency, phase, trigger));
  noise.set(noiseOsc(frequency));
}

this.constructDevice = () => constructPerBufferDevice({
  implementation: LFO,
  inputs: {
    frequency: expose(numberSetting('Frequency', { defaultValue: 1, min: 0.001, max: 100, curve: Curve.Log2, unit: InterfaceUnit.Hz })),
    trigger: expose(zeroOneSetting('Trigger', 0)),
    phase: expose(numberSetting('Phase', { defaultValue: 0, min: -Math.PI, max: Math.PI }))
  },
  outputs: {
    saw: mono('Saw'),
    sin: mono('Sine'),
    square: mono('Square'),
    triangle: mono('Triangle'),
    noise: mono('Noise')
  }
});
