nov 28
plugins
- What are they?
- filters / transformations / etc added into editor
- usually written by 3rd party
- usually in well-known API or language such as python; often just a source (text) file
- many variations; common theme throughout multimedia applications
- depending on your needs and skills, you may be able to adopt someone else's plugin to do what you need...
- details vary with editor
- Typically two types
- compiled - object (binary) code
- interprted - source (text) code
- examples
- my plan is to walk through several, though this stuff can get pretty technical pretty fast.
- several that I've actually installed and/or written are attached
audacity
- http://audacity.sourceforge.net/download/plugins
- live in plug-ins/ folder in application folder
- audacity puts 'em in 3 menu categories :
- generate - create new track
- effect - modify selection
- analyze - add labels
- LADSPA
- VST
- Nyquist programming language
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
- plugins
- scripts
- http://www.gimp.org/docs/
- there's a built-in 'procedure browser' under Xtns menu to see what you can do
- use scheme (again, a lisp-like language)
- or python (if your gimp has been built with that option)
- typically get installed in a directory like /Applications/Gimp/Gimp.app/Contents/Resources/share/gimp/2.0/scripts
- or ~/.gimp*/scripts/*.scm
blender
- written in python
- scripts can 'register' themselves, so they're attached to menus (like Gimp)
- or you can find them in the scripts window
- a few 'pre-built' examples
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