Custom Macro patches
From QuartzCompositions.com the central source for Quartz Composer :: wiki
This page is intended to contain ideas, inventions and creations of macro patches that people have created that serve a specific purpose.
| Table of contents |
Common Questions
Why use Macro patches?
- They make your composition easier to understand.
- They take a complicated structure, and hide it within a single patch
- The Macro Patch can be named based on its purpose.
- You can reuse it anytime you have the need.
- There is no performance hit for using macros.
What is a signal?
A signal is when a boolean value changes from false to true, then back to false.
- Patches with signal inputs are typically activated during the change from false to true.
- Typically the length of the signal does not matter, but there are a few exceptions.
Why do some of the macros have extra Input Splitters?
Note: There is NO performance hit for using input splitters!
Input splitters have several uses:
- They can split an input (duh)
- They can be used to convert the type of a value
- They allow you to change the patches inside a macro without changing the published inputs
- They can be used as a label (making the macro easier to understand)
I include extra input splitters in my macros mainly for the third and fourth reasons. They make it easier for me to change the internals of my macro when I am still designing it, and later they provide useful labels for both myself and anyone else trying to figure out how it works.
What is the difference between a Multiplexer and a Fake Multiplexer?
A Multiplexer only evaluates the chosen input. This is usually a good thing, as it makes your composition run faster. There are however a few times when all inputs need to be evaluated. In these cases you can make a macro which behaves like a multiplexer, but without the optimization. I call it a Fake Multiplexer.
Math Patches
Switches
Signal Switches
- Signal Switch - Stays off until it receives an "On Signal", then stays on until it receives an "Off Signal"
- Toggle - Toggles output every time it receives a signal.
Data Switches
- Data Switch - Like the signal switch, lets data through when "On"
Timing
- Timed Signal - Emits signal for given amount of time... then stops
- Periodic Signal - Emits a signal at regular intervals
- Delayed Signal - Sends signal after given delay
- Random Delayed Signal - sends signal after random delay (between given min & max)
- Time Between Signals - outputs the time between the last two signals received
Memory
- Binary Store - Stores a binary value
- Number Store - Stores a number
- Number Store (Signaled) - Stores a number on signal
- Color Store - Stores a color
Points & Rectangles
Points
- Point - Create a point structure
- Point Info - Retrieve X & Y from point
Rectangles
- Rectangle - Create a rect structure from origin, height, width, & rotation
- Rectangle (Centered) - Create a rectangle centered about a given point
- Rectangle (Edges) - Create a rectangle structure by giving the coordinates of it's edges
- Rectangle Info - Get info from a rectangle structure
Point Manipulations
- Point Rotate - rotates point about a given origin
- Contain Point - contains point within rectangle
Rectangle Manipulations
- Rect Inset - Insets rectangle by given amount
- Rect Offset - Offsets (translates) rectangle by given amount
- Rect Scale - Scales rectangle by given factor
- Rect Rotate - Rotates rectangle by given # of degrees
- Rect Intersection - Finds intersection of two rectangles
- Rect Union - Gives smallest rectangle containing two rectangles
Tests
- Point in Rect - tests whether a given point is in a rectangle or not
- Rect in Rect - tests whether a given rectangle is completely contained by another
Interactivity
Mouse
- Last Click - Gives you location of last mouse down/up and the amount the mouse was dragged in between
Keyboard
Rectangle
- Mouse in Rect - tells you if the mouse is over the given rect, whether the button is down, & whether there was a double click
- Drag Rect - creates a rectangle which can be dragged around
Images
Image Manipulations
- Image Resize - Resizes the to a given pixel size.
Image Storage
- Two-Image Snapshots - Takes snapshots, storing the last two in order
