Music 171 homework 5
More practice with abstractions: this assignment is to build an additive
synthesis instrument that can imitate the Hammond organ sound. Hammond organs
have 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 overtones have frequencies of 1, 2, ..., 8 times
the desired fundamental frequency of the note being played.
Part of the classic Hammond sound in rock music from the 60s and 70s was
nonlinear distortion applied to the output of the organ (originally by
overdriving the amplifier). In modern times this can be achieved using
waveshaping, as was shown in class Feb. 8.
The novel Pd programming feature you will need to use is dollar sign
("$1", etc.) substitution in object boxes; this was introduced Feb. 1.
Your successful patch should sound like
this.
To make the patch:
- Make a main patch with a text object, named, for instance, "sequence".
(My numbers are 36 48 46 24 46 48
58 57 36 62 52 34 58 67 74 82). Make a repeating counter to read through the
values of "sequence". To make it easy, you can just use a "send" object to send
the pitches into the abstraction. Also make an array of "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 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 "$1", 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, or using a "throw~" object) and
collect the output.
- Inside the abstraction, arrange to read the amplitude from the "drawbars"
table. Each time you receive a new pitch, you will want to read an amplitude
from the "drawbars" array using "f $1" to get the partial number and subtracting
one before reading from the drawbar array (whose elements are indexed 0, .., 7
instead of 1, .., 8). This can be sent in the usual way to a line~ object to
avoid clicks and multiplied by the output of the oscillator.
- Now summing the outputs of all the eight (either explicitly, or by chaining
the abstractions, or (simplest) using a "catch~" object to correspond to the
"throw~" objects inside the abstraction), If the drawbar amplitudes range from
0 to 1, this sum can range from -8 to 8 but will often be smaller. Use another
gain stage (ranging from 0 to 10, say) as a waveshaping index. (If this value
is 10 and all the drawbars are up, the resulting signal is now too strong to
listen to directly, possibly having a peak amplitude of 80). Then for a
waveshaping function, apply a "clip -1 1" object as shown in class Feb. 8. Then
make a final amplitude control. This all follows the pattern of the example
5c.waveshaping.pd, but can be much more simple. There is no ADSR envelope
needed for the index setting stage (the first gain stage), and instead of the
*~, +~, and tabread4~ combination there is just one "clip" object.
As before, make a zip archive of the main patch and the abstraction together
in a directory as with last week's assignment. Remember not to make the patch
make sound right when it loads (i.e., no loadbang into "pd dsp~" messages please.)
back to music 171 main page