Introduction to Building Blocks

Building blocks are the basic unit of programming in ControllerMate. Each type of building block performs a small function, then triggers other building blocks. Building blocks can be joined together to create complex functions.

Listed below are the various types of building blocks available in ControllerMate. Each type is described in detail in the Programming Reference section. In addition, the Programming Examples section contains examples of how several types of building blocks can be used.

Device Building Blocks represent a device, individual controls on a device (buttons, axes, sliders), or messages from a MIDI source:

Controller — Indicates whether a particular device is attached

Button — Responds to one button on a controller

Button Group — Responds to a collection of buttons on a controller

Axis — Responds to one axis on a controller

Hatswitch — Responds to one hatswitch on a controller

LED — Turns a controller LED on or off

Virtual Button — Represents a button on a virtual device

Virtual Axis — Represents an axis on a virtual device

Virtual Hatswitch — Represents a hatswitch on a virtual device

MIDI Note — Responds to a Note message from a MIDI source

MIDI Note Velocity — Responds to the velocity value of a Note message from a MIDI source

MIDI Controller — Responds to a Control Change message from a MIDI source

MIDI After Touch — Responds to an After Touch message from a MIDI source

MIDI Program Change — Responds to Program Change messages from a MIDI source

MIDI Channel Pressure — Responds to Channel Pressure messages from a MIDI source

MIDI Pitch Wheel — Responds to Pitch Wheel messages from a MIDI source

Output Building Blocks trigger activity on ControllerMate’s internal keyboard or mouse, or play a system sound:

Text — Generates simple text

Single Key — Generates a single keyboard key or key combination

Keystrokes — Generates a series of individual keyboard keystrokes

Cursor — Generates cursor movements

Mouse Button — Generates mouse button clicks

Scroll Wheel — Generates mouse scroll wheel turns

Beep — Plays a system sound

AppleScript Building Blocks perform an AppleScript:

AppleScript — Performs an AppleScript and ignores any result

AppleScript (ON/OFF) — Performs an AppleScript and interprets the result as an ON/OFF value

AppleScript (Number) — Performs an AppleScript and interprets the result as a number value

Logic Building Blocks combine ON/OFF values using standard logic functions:

AND — Combines ON/OFF values using AND logic

NOT — Changes an ON/OFF value to the opposite value

OR — Combines ON/OFF values using OR logic

XOR — Combines ON/OFF values using eXclusive OR logic

Toggle — Inverts an ON/OFF value each time its input turns ON

ON/OFF Gate — Allows or prevents an ON/OFF value from passing through

ON/OFF Latch — Retains an ON/OFF value

1:2 Selector — Select one of two ON/OFF values

Basic Math Building Blocks perform basic mathematical functions:

Addition — Adds two or more number values

Subtraction — Subtracts one number value from another

Multiplication — Multiplies two or more number values

Division — Divides one number value by another

Division — Reports the remainder obtained by dividing one number value by another

Comparator — Compares two number values to each other

Calculation Building Blocks perform more complex functions with number values:

Accumulator — Maintains a running total of number values

Axis Calibration — Interpolates number values from one range into another range

Constant Number — Creates constant number values

Counter — Counts ON/OFF changes

Delta (Number) — Calculates the amount by which a number value changes

Delta (Strobe) — Indicates when a number value has changed by a predetermined amount

Number Exchange — Replaces certain number values with another value

Number Gate — Allows or prevents a number value from passing through

Random Number — Generates a random number value

Range — Indicates when a number value is between two predetermined limits

1:2 Selector — Selects one of two number values

Value Selector — Indicates when a number value is equal to one of a predetermined set of values

View Hatswitch Setup — Combines individual ON/OFF values into a single value appropriate for use with a view hatswitch

Timer Building Blocks perform time-related functions:

Auto-Repeater — Creates an ON/OFF value that alternates at a predetermined rate

Delay — Turns ON after a certain amount of time

Dwell — Remains ON for a certain amount of time

Pulse — Turns ON for a predetermined amount of time

Pulse Count — Counts the number of ON/OFF changes within a certain time interval

Rate — Creates an ON/OFF value that alternates at a variable rate

Strobe — Creates an ON/OFF value that alternates a variable number of times

MIDI Output Building Blocks send MIDI messages through a virtual MIDI device:

MIDI Note Output — Generates a predetermined MIDI Note message

MIDI Variable Note Output — Generates a MIDI Note message that has variable note and velocity values

MIDI Variable Controller Output — Generates a MIDI Control Change message that has a variable control value

MIDI After Touch Output — Generates a predetermined MIDI After Touch message

MIDI Variable After Touch Output — Generates a MIDI After Touch message that has a variable note number and pressure value

MIDI Program Change Output — Generates a predetermined MIDI Program Change message

MIDI Variable Program Change Output — Generates a MIDI Program Change message that has a variable program number

MIDI Channel Pressure Output — Generates a MIDI Pressure Change message that has a variable pressure value

MIDI Pitch Wheel Output — Generates a MIDI Pitch Wheel message that has a variable wheel position value

"Extra" Building Blocks perform functions that do not match one of the categories above:

Application — Indicates when a particular application is running

Finder Item — Instructs the Finder to open a file or folder

Modifier — Alters the behavior of building blocks based on the value of other building blocks

Properties — Enables or disables portions of ControllerMate’s programming

Safety — Disables ControllerMate’s programming or resets its internal keyboard or mouse

More info on using Building Blocks