Using matrixctrl values as weighted probability for gate

oxxi's icon

I’m trying to take the values from the third row of a matrixctrl (in dial mode) and use them as weighted probabilities to control how likely the gate opens on each step, but I haven’t been able to figure out which objects would be best for handling the probability logic. Basically the value of the dial for each step determines how likely the gate is open so it triggers the sound.

Max Patch
Copy patch and select New From Clipboard in Max.