This patch uses a rslider to set the minimum and maximum for random values of the brightness of red ouput by the jit.matrix and the frequency of an cycle~.
This example shows how to get the range of a rslider object. The right outlet of rslider outputs the max value, and the left outlet outputs the min value. In order to calculate the range, simply subtract the min from the max. However, one thing you should not overlook is that the max value comes out of rslider before the min value (because it’s farther to the right).
This patch shows several techniques relevant to granular synthesis, playing a stream of short excerpts of recorded sound. (The patch uses one abstraction, called pan~, that's provided in the example titled "Constant-intensity panning subpatch". You'll need to download that abstraction and save it with the name pan~ somewhere in Max's file search path.)