Digital
Multimedia

Fall 2006
course
navigation

nov 28

plugins

audacity

Lisp example
$ ssh cs $ clisp > (+ 1 2) 3 > (defun double (x) (* 2 x)) > (double 4) 8
Here's an example of an audacity Nyquist plugin, lowpass.ny
;nyquist plug-in ;version 1 ;type process ;name "Low Pass Filter..." ;action "Performing Low Pass Filter..." ;control f "Cutoff frequency" real "Hz" 1000 1 rate (lp s f)
Lines that start with ';' are comments in lisp; they don't 'do' anything to the sound. However, they are used to set things up.
The first two lines are required; don't change them.
;nyquist plug-in ;version 1
The next line puts this plug-in under either the 'Generate', 'Effect', or 'Analyze' menu; it must be 'generate', 'process', or 'analyze'. ;type process
The next two are just titles for the menu and dialogs ; name "Low Pass Filter..." ; action "Performing Low Pass Filter..."
The 'control' line defines a widget that goes in the dialog which lets the user input a value. The things on that line are
- the word 'control' - the variable that gets this value which can be used in the code later - the text the user sees describing this
The sound which is to be processes is in the variable 's'.
So this 'plugin' does its thing in one line:
(lp s f)
which is "apply a lowpass filter to sound s using cutoff frequency f.
The rest is looking at examples from the nyquist manual and playing around.
- the type of value, 'real' or 'int' - the units (a string to put after the control) - three numbers to give the default value, the minimum vaue, and the maximum value
In this case, 'rate' is pre-defined variable that represents the sampling rate.

gimp

blender

Here's a sample of some interactive playing around
# bring up a blender window. # Look in the 'outliner' window for the name of something, e.g. "Camera". # Make a new window, and change it to 'Scripts' mode. # Menu: Scripts > System > Interactive Console Type your code and hit 'Enter' to get it executed... >>> Blender.Object.Get() [[Object "Camera"], [Object "Cube"], [Object "Lamp"] >>> camera = Blender.Object.Get("Camera") >>> dir(camera) # show me all the stuff that this camera can do
Aside : perhaps it'd be worth describing python briefly, and the notion of 'objects'...

other blender notes

http://cs.marlboro.edu/ courses/ fall2006/multimedia/ notes/ nov_28
last modified Monday December 4 2006 10:34 pm EST