const MasterSum = ({ inputs, output }) => {
  const inputArray = Object.values(inputs);

  output.fill(0);

  for (let i = 0; i < inputArray.length; i++) {
    const inputChannel = inputArray[i];
    for (let s = 0; s < inputChannel.length; s++) {
      output[s] += inputChannel[s];
    }
  }
}

this.constructDevice = () => constructPerChannelDevice({
  implementation: MasterSum,
  outputs: {
    output: stereo('Out')
  },
  hidden: {
    inputs: { type: 'Stereo', name: 'In #', repeatable: true }
  }
});
