const FrequencySplitter = ({ input, low, high, q, frequency }) => {
  const filter = useBiQuadFilter();
  const filtered = filter(input, BiQuadFilterMode.LowPass, frequency, q, useConstantBuffer(0));
  low.set(filtered);

  for (let i = 0; i < input.length; i ++) {
    high[i] = input[i] - low[i];
  }
};

this.constructDevice = () => constructPerChannelDevice({
  implementation: FrequencySplitter,
  inputs: {
    input: stereo('In'),
    q: numberSetting('Q', { defaultValue: 1, min: 1/16, max: 8, curve: Curve.Log2 }),
    frequency: frequencySetting('Frequency', 1000),
  },
  outputs: {
    high: stereo('High'),
    low: stereo('Low'),
  }
});
