const Effect = ({ input, output, min, max, curve }) => {
  for (let i = 0; i < input.length; i++) {
    output[i] = min[i] + (Math.pow(input[i], curve[i]) * (max[i] - min[i]));
  }
}

this.constructDevice = () => constructPerChannelDevice({
  implementation: Effect,
  inputs: {
    input: expose(zeroOneSetting('In')),
    curve: numberSetting('Curve', { defaultValue: 1, min: .5, max: 2, curve: Curve.Log2 }),
    min: zeroOneSetting('Min', 0),
    max: zeroOneSetting('Max', 1),
  },
  outputs: {
    output: expose(zeroOneSetting('Out')),
  },
  layout: row([
    titled.knob('min'),
    titled.knob('max'),
    titled.knob('curve'),
  ])
});
