User Tools

Site Tools


cs276:spc.gem

CSci 276 Lab #10

The purpose of this lab is to gain experience working with the GEM library in Pure Data.

GEM deals with 2D and 3D graphics, and is based on the idea of a render chain. Each chain starts with the [gemhead] object and renders through objects that specify a series of transformations, ultimately applied to some 2D or 3D geometric object, or geo in GEM parlance.

You'll need the output~.pd abstraction file saved in the same directory you save this patch in.

Setup

Libraries like Gem are called externals in Pure Data. Like 3rd party libraries in Processing, externals can be downloaded and installed from within Pd:

  1. Select menu item Help→Find Externals
  2. In the text entry field, type Gem
  3. From the choices listed, select the first Linux version
  4. Confirm that you want it installed
  5. Once Gem is installed, select menu item Preferences→Startup
  6. Click New, then add Gem to the list (which may be initially empty) and click Ok. This makes Pure Data load Gem automatically. but we'll have to restart it to take effect.
  7. Quit Pd and start it up again. If everything worked okay, you'll see a Gem startup message along with a list of plugins loaded

Lab Exercises

  1. Start up pd
  2. Build the patch below in two stages. First, put in the render chain and test. Then add the controls (horizontal sliders and associated functions), then the digital audio components (the chain starting with [osc~]).
  3. Note! If you don't have a webcam (because you're using a lab machine) make the changes described here.
  4. Control-click (or right-click) the upper [Hslider] and under output-range set left range to 60 and right range to 420
  5. Control-click (or right-click) the lower [Hslider] and under output-range set left range to 0 and right range to 6

It can be hard to hear the audio unless the cube is very large. To fix this, make the modifications shown:

Modifications

  1. Change the creation arguments for the multiplication operator below the lower [Hslider] to [* 10], [+ 26]
  2. Change the creation arguments for the addition operator below that [+ 26]
  3. Test when audio becomes loud enough to hear
  4. We're rendering to a cube. If you have time, try working with another type of geo (you may have to change the way the controls are applied). Other geos include [square], [circle], [rectangle], [triangle], [sphere], and [cone]

The [square], [circle], [cube], and [triangle] objects have a right-hand inlet to set the size of the shape. The default size is 1.

Finally: save a screenshot of your patch to the wiki page.

cs276/spc.gem.txt · Last modified: 2019/11/25 19:03 by scarl