Music 171 homework 5
More practice with abstractions: this assignment is to build an
additive synthesis instrument that can imitate the Hammond organ
sound. The Hammond organ had a set of eight "drawbars" that set the
amplitudes of the first eight partials (harmonics) of the output
tone. (There were lots of other features as well, but this is the
one of interest here.) Your patch need not be polyphonic (it should
be designed only to play one note at a time) but you should use the
abstraction mechanism to make the eight overtones (each copy of the
abstraction should make one of them).
The two novel features are, first, being able to use a "$" sign
inside an object box to differentiate between the harmonics; and
using the "moses" object (introduced here) to allow pitches below
10 (for example) to simply turn the sound off, so that you can make
sequences with rests in them.
Your successful patch should sound like this.
To make the patch:
- Make a main patch with two tables, "sequence" (as before, but
now try using 16 points instead of 8 with range set from 128 to 0
so you can store MIDI pitches in it conveniently. My numbers are 35
42 49 0 37 0 64 0 0 44 47 34 46 67 72 58.) and "drawbars", 8
values, ranging from 1 to 0. (Remember the range is set from the
top of the graph to the bottom, which is why the range is specified
backwards here). Make the usual counter arrangement to read through
he values of "sequence". To make it easy, you can just use a "send"
object to send the pitches into the abstraction. (In a later step,
you will want to insert a "moses" object before the send to split
off pitches that should be interpreted as "turn off" instead of a
real pitch.)
- Make an abstraction named, for instance, "partial", and invoke
eight of them, as "partial 1", ..., "partial 8". Then you can use
"$1" inside the abstraction to do things that depend on the partial
number. To start with, get the pitch (preferably in the simplest
possible way, using a "receive" object), convert to frequency,
multiply by "$", and use this as the frequency of an "osc~". This
will make a sinusoidal tone at the harmonic.
- Arrange to add up all the sounds (using outlet~, or by adding
them cumulatively as in the D07.additive.pd example) and multiply
the result by a line~ to turn it on and off. Just an attack and
release shape will be adequate for this example, and they may be
fixed messages "1 10" and "0 10".
- Insert a "moses 20" object between the sequencer and the "send"
that gets the pitches into the abstraction. When the pitch is >=
20 (right outlet of moses), send the pitch and turn on the line~.
When the pitch is < 20, just turn off the line~. You now should
have a sequencer that makes "rests" whenever the pitch is 0 or
close to 0.
- Inside the abstraction, arrange to read the amplitude from the
"drawbars" table. The easiest way to do this is to use "loadbang"
into "f $1" which will generate a message whose value is the number
of the partial, starting at one; then subtract 1 to make an input
to a tabread~ object. This can be multiplied directly by the output
of the osc~ to control its amplitude.
Make an on/off control (to start/stop the sequencer and the
usual output level control, and make a zip archive of the main
patch and the abstraction together in a directory as with last
week's assignment.
back to music 171 main page