(Needed: Example Video)
In lesson #1, we use the Vizzie subsystem to allow people to quickly become familiar with the basic functionality of a visual programming language, and to learn some of the functionality of the Max environment. For this to be useful, a current version of Max - along with the Vizzie components (automatically installed with Max) - should be installed on the user's systems.
Max takes a different approach to programming: it provides a visual, rather than textual, view of the code-creating process. There are some advantages to vusion programming:
The basic workflow of Max programming (and other visual programming tools) is:
Visual programming works well with an iterative development process, where you create a small working section of code, then add new pieces as required. An important part of this is to create reusable subsystems; for example, it is typical to create a working Microsoft Kinect subsystem, then reuse it every time you need to work with a Kinect. These subsystems are built using Max itself, and are easily made available for future projects.
In this set of lessons, we use a subsystem called "Vizzie" (automatically installed with Max) that is used to manipulate visuals (movies, images and live video). This system is meant to provide an easy introduction to visual programming, and to provide a "fun" way to get started. There are some limits to the Vizzie subsystem:
Some people wonder if working with Vizzie is actually working with Max. We consider it to be so, since it works within the Max environment, can interface with lower-level Max code, it uses standard Max messaging, and the user and programming interfaces are the same.
We are going to start our programming experiments by creating a basic movie player. But first, we have to understand how to instantiate Vizzie objects. Vizzie objects aren't standard Max objects - rather, they are small, self-contained patches that we can include into our patches. There are two places to retrieve Vizzie objects:
- You can get them from the Vizzie search sections in the file browser (which is opened from the File menu in the Max application) and drag them into your patch. - You can paste them directly from the contextual menu (right-click/control-click in the patcher window, then select Paste From->VIZZIE-CLIPPINGS).
In either case, you are confronted with four named subsections - none of which are all that revealing (from a name standpoint). Right now, we are going to focus on the VIZZIE PVR section, where PVR stands for Players-Viewers-Recorders. This is the section of Vizzie modules that give us things like movie players, webcam input and windowed displays.
Using either selection method, create an instance of the PLAYR module. You'll notice that all of the modules are rather oddly named - they seem to have "action" names, but they never end in a proper "er". This is because a limitation of Max is that you cannot have multiple modules with the same name, and many people have already created modules named "Player", so by dropping the "e" we are able to avoid conflicts.
With a PLAYR modules in your patcher, we are ready to see how this operates. Drag a movie file (either from a file folder or from the "movies" section of the File Browser) onto the blank square that says "Drop a Movie Here". You will see the movie in the mini-screen, and it will automatically start playing. You've created your first functional patch! In order to learn more about the PLAYR module, let's make some adjustments to the controls.
If you try to move one of the controls, you will find that you just select the whole PLAYR module. This is because you are in Edit Mode, where you lay out the contents of the patch. In order to interact with the modules, you will need to 'lock the patch'. You can lock the patch by clicking on the little lock icon at the bottom left of the patcher, or you can use a keyboard shortcut (Control-E on Windows, Command-E on Mac). In either case, you will cause the patch to change into Performance Mode, and you can now move the controls on the PLAYR module.
The PLAYR has a number of controls, and many of them require different gestures to use them effectively. The speed/direction control determines how fast the video plays; when you move the slider to the left of center, it reverses the movie playback (because it is working at a "negative" speed). To the right of this control you find two push-buttons: one labeled "hi", and one with a flower icon in the center. Clicking on the flower will "refresh" the control to its default state, while switching on the "hi" control will cause the speed/direction slider to control a larger range of values - you can now increase the speed to 5x its normal speed.
Below the speed controls are the preview screen (which doubles as a drop zone for movie files), and the play/pause button for movie playback. Both of these are pretty easy to understand. One useful thing to note is that you can turn off the preview by clicking on the video display.
Below the preview screen, there is the playback/loop control. While it looks similar to a slider, it is actually a range control; you set the starting and ending points of the loop by clicking on a starting point in the range, then dragging the mouse to select an ending point. As with the speed control, you can reset the value by clicking on the connected refresh (flower) button.
If you want more information about any Vizzie module, you can hover your mouse cursor over the name of the module - it will give you a nice description. You can also hover over any control in order to get a description of that control.
This is a work in progress...
(Needed: text and links)
(Needed: text and exercises)
by Darwin Grosse and Cory Metcalf