MarkT:
Since you have many inputs use an array to store the input values?
Although, as it is a monophonic synth, only a single output value can be sent.
But yes, the code needs to work out what to do if multiple beams are broken simultaneously. The code as structured at the moment results in 'highest note wins' which is fairly reasonable.