Homework assignment #4

Dynamical systems in Scheme and Pd

Homework 4:

Test out 220a/scm/dyn/dyn-notes.scm

Translate this code to Pd, creating a patch where you can fool around in real-time with the dynamical system (a much better way to learn its behaviors). Link a recording to the usual place as hw4.wav


This demonstrates a simple dynamical system (iterated map) used to control pitches played on an FM synth -- you'll see that the scheme code is derived from the earlier streaming example.


Start your work by creating a simple test patch (without synthesis, just printing values). In the scheme example, I've defined a procedure `tick' which iterates the system one time each call. Your test patch should behave the same. It should have a `bang' that iterates it once, and also a message box with a number in it to initalize the system. It should have a slider on the a0 parameter of the polynomial. Set it's min / max range to -0.3 / -0.7 (the same range traversed in the scheme code).


Once that's working, attach the dynamical system to FM synthesis by grafting it in onto our earlier streaming.pd example. Modify a copy of streaming.pd so that the dynamical system controls pitches.


The recording should be captured using Audacity via Jack. I'd like you to practice changing the value of the a0 slider so that the system plays in 3 different regimes: 1) boring 2-note pattern 2) crazy randomness 3) something in between where it seems to invent melodies. Then record a take where you visit each regime long enough to establish its behavior for the listener. The overall duration of the take should be not more than 120 seconds, maybe a whole lot shorter -- whatever it needs to really establish each regime.


As an example of the third part, have a listen to 220a/jukebox/dyn-fm-pd-fverb.wav which I created after hunting around with the slider for values of a0 where it settled on a regime with interesting melodies. What you hear in that recording is a constant value, but I won't tell you what it was -- find something like that. The other goodies I used were panning and reverb based on hw3 and the streaming fm from hw2. No need to do that for this assignment. In headphones, now that I listen to it, I think that for the fast tempo I used, the efx are obscuring the fact that it's a single (monophonic) line -- streaming is breaking it into multiple melodies and my panning rhythm makes it worse.

Important Pd concepts for this work

Pd parses and executes its graphs depth first. See

/usr/lib/pd/doc/2.control.examples/08.depthfirst.pd


You will need a variable like the x in the scheme code to hold system state which in Pd can be done with

a float object. See

/usr/lib/pd/doc/5.reference/help-float.pd


You can either wire up lots of ugly looking adds and multiplies to implement the polynomial, or you can do it all within a single expression which has an input for the changing system state (the x above) and an input for the a0 parameter. See

/usr/lib/pd/extra/help-expr.pd

I tested a version of this which looks like

expr $f2 + -0.7 * $f1 + 2 * $f1 * $f1


Further hints for your implementation

The scheme version limits frequencies by passing frequency values through min and max expressions. It also quantizes them to integer keynum values. In Pd, running it through ftom and mtof does the equivalent trick.


(digression: here's the good resource mentioned in class for downloading single instrument tones:

http://theremin.music.uiowa.edu/MIS.html

it's where I got oboe and clarinet samples in 220a/jukebox)