random | [Pattern] |
Enumerates items in random order. The probability of an item being selected may be altered by weighting items relative to one another and by constraining the minimum and maximum number of times an item may be consecutively selected. By default, each item in the pattern has an equal probability of selection and may be repeated in direct succession any number of times. To qualify the behavior of an element, specify the item in a list together with its qualifying options:
({item} {option value}*) item is the element to return from the pattern. Following item comes zero or more options value pairs. Each option may be specified using either keyword or symbol form:
Example:
? (setf x (notes c4 d (e weight 3) f g in random)) #<RANDOM-NOTE-STREAM 140173561> ? (read-items x 10) (E4 D4 E4 D4 E4 G4 E4 E4 F4 E4)
See Also:
*cm-state*, Item Streams, *random-range*