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

  • Abs - Absolute Value
  • Sin - Sin (takes degrees)
  • Cos - Cos (takes degrees)


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

Memory

Points & Rectangles

Points

Rectangles

Point Manipulations

Rectangle Manipulations

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 Storage