4. How events and data travel through a composition

Events are what make things happen in a composition. As you get to know Vuo, you’ll be able to look at a composition and imagine how an event comes out of a trigger port, flows through a cable into a node’s input port, and either gets blocked or flows through the node’s output ports and into the next cables. The previous section gave an overview of how that works. This section describes the process in detail.

4.1. Where events come from

Each event is fired from a trigger port, a special kind of output port on a node.

Some trigger ports fire events in response to things happening in the world outside your composition. For example, the Receive Mouse Moves node’s trigger port fires an event each time the mouse is moved. The Play Movie node’s trigger port fires a rapid series of events (for example, 30 per second), so that you can display images in rapid sequence as a movie. Similarly, the Render Scene to Window node’s Requested Frame trigger port fires a rapid series of events, so that you can use these events to display scenes in rapid sequence as an animation.

Other trigger ports fire events in response to things happening within the composition. For example, the Fire on Start node’s trigger port fires an event when the composition starts. The Fire Periodically node’s trigger port fires events at a steady rate while the composition is running. A node’s trigger port can even fire in response to an event received by the node, as happens with the Spin Off Event node. (However, this is a different event than the one that was received by the node. For more information, see the section on Executing slow nodes in the background.)

In Vuo, events are generated from trigger ports and flow to other nodes to cause them to execute. You can think of events “pushing” output data to downstream nodes. Quartz Composer works differently. In Quartz Composer, if you connect a Wave Generator (LFO) patch to a Cube patch, the cube will respond. It is “pulling” data at a rate of 60 fps. This “pull” is inherent in Quartz Composer. If you set up a similar situation in Vuo, nothing would happen. To make an object respond to a Wave node, you have to explicitly provide a stream of events to “push” the changes caused by the Wave node to the object. In Vuo you get to choose the source of those events. It might be the trigger port of a Fire Periodically node, the trigger port of a Render Layers to Window node, or something else.

Some nodes block events until a certain condition is met. The node Became True, for example, only lets an event through when the condition changes from false to true. These nodes are not trigger nodes, since they don’t create events, but they control when events are output.