For example, striking a key causes ONE random number to be sent to an
input of a particular patch.
But Random seems to output a continuous stream of numbers. How to
hold its value after the first number is output?
I'd use a javascript patch like this:
if(inputs[0]) {outputs[0] = Math.random()};
if you connect your keyboard patch (and nothing else) to that node's
input, it will only change when you hit the corresponding key.
Even better would be if the event that triggered this could be the
start of the composition running. Is there some kind of "start" event
I can make use of?
check if the patch time equals zero (conditional + patch time)