Download the completed project file and sample plugin from this tutorial.
Though VDMX provides many plugins and built-in datasources to automate control of sliders, buttons and other interface controls, many people like to use their own algorithms to generate control information to use as part of their performance or installations.
One of the ways this can be accomplished is by making a custom plugin for VDMX using Quartz Composer or Vuo. Compositions placed in the VDMX assets folder under “plugins”.
In this tutorial we will look at using Quartz Composer to create a “Random Walk” value generator for VDMX. This composition can be downloaded and installed to be used as is, or as a starting point for your own more complex creations.
Tip: Check out related tutorial on making Color Mixer and Complimentary Color generator plugins with Quartz Composer.
Installing and Using The Random Walk Example
To begin, from within VDMX choose the “Open Assets Folder In Finder” and drag the “Random Walk” file into the plugins folder. compositions The composition will be available from the Workspace Inspector and any published outputs will be available as data-sources and video streams. As with other plugins, we can have multiple copies running at the same.
To control a parameter with the output from Random Walk works just like any other data-source. In most cases you can make this assignment by right-clicking on an interface control and selecting it from the appropriate sub-menu. The UI Inspector panel can also be used to configure an interface item to receive data from the composition and customize how it is applied.
The Random Walk plugin itself has two basic controls: Step Size (adjust the max amount the value can change) and the Wrap Mode (whether wrap around or bounce off the at the edges). Each of these can be set from the plugin control window
How The Random Walk Example Works
For those interested in how the Random Walk composition was created, in this second part we will open the file in the Quartz Composer Editor to take a closer look. When editing the composition, you can follow the provided notes for each section.
The process for a random walk involves four basic steps:
- Input maximum step size.
- Generate random numbers and accumulate.
- Apply wrapping function.
- Publish and visualize results.
The wrapping functions are used to convert the un-ranged random numbers into a 0 to 1 range that can be used by VDMX to control parameters. A sawtooth wave provides a wrap at edge, where as a triangle wave causes a reflection at the edge.
Additional parameters, such as adding a button to reset the accumulator back to its starting value, can be added using Input Splitter objects.