random

Delaying MIDI notes

There are many objects available for delaying events (i.e., for scheduling events to happen at a specific future moment). For timing and scheduling events, the most common object is the metro object (send bang periodically at a specified time interval), which can be used to trigger events, start/stop entire processes, or trigger a counter to step through a table or a coll or any sort of sequence of things.

Using timepoints for interactive sequencing

The timepoint object sends out a bang when the transport reaches a specified time position. This can be useful for causing something to happen—or for starting an entire process—at a particular instant during the transport's progress. A timepoint might, for example, even trigger a new time position value to be sent to the transport object itself, thus causing the transport to leap to a different time.

Display randomly chosen frames of a movie

When you open a movie file in jit.movie with a read message, the exact amount of time that that operation will take is unknowable, but jit.movie will send a read message out of its right outlet when the file-opening operation has been completed. When you read in a file, you should generally wait for that message to come out before proceeding. In that message, the word read is followed by the name of the file, followed by a success indicator, 1 or 0.

Pass a certain percentage of bangs

To make a random decision between two things, you can use the decide object. To make a probabilistic decision between two things, with one thing being more likely than the other, you can use the random object to choose randomly from a larger set of numbers, then assign a majority of those choices to mean one thing (and the remaining minority to mean the other thing). An easy way to do this is with the < object.

Random movie edits

This is a program for random editing of a video by periodically leaping to randomly-chosen times in the video and playing from there. The jit.qt.movie object here has its attributes initialized such that: a) it will adapt the dimensions of its matrix based on the dimensions of the movie that is read in, b) it will not automatically start, c) it will not loop, and d) it will only send out new frames of video without repeating a frame.

Random and urn

This patch demonstrates the two simplest objects for generating random numbers. Every time it receives a bang in its left inlet, the random object generates a random integer in the range from 0 to one less than its argument. (For example, if you tell it to generate one of 12 random numbers, it will choose a number from 0 through 11 inclusive.) Note that this includes the possibility that successive random choices may appear to generate what seem to be patterns, especially if it's choosing from among a small range of possibilities.