HW 1 Part 1 - Timbres
My moving timbres are based on static timbres, so I’ve kept them in the same file. (You can look in this directory if you want to see the original files.)
- fmfm.ck
Low pass filtered cascade of three oscillators (sin->tri->tri) so that the tones purity (spectral width) is changes slowly with time.
The “static” version leaves out the pitch_control() and formant_control() functions which use the autonomous update every 50msec.
- breathy.ck
Noise => Array of four hi-Q BPF => ADSR
Pitch control changes the center frequency of the BPF filters in a harmonic ratio that tracks a target harmonic frequency with some wobble.
Note-on randomizes the starting position to create a big transient.
- tone.ck
A pair of triosc pumped into a ADSR.
The frequency of the triOsc is very close so you get some nice rich beating effects.
HW 1 Part 2 - Computer Music of Changes
I spent a great deal of time trying to get automatic generation of songs using generative grammars. This directory contains a Makefile that you need. Here are the basic concepts:
- Voice.ck - a general wrapper class to make many stk instruments and the timbres generated
- Band.ck - a collection of voices with shared reverb, mix and pan controls
- Measure.ck and Feel.ck - a way of generating random measures of notes based on abstract parameters like note density, syncopation
- Progression.ck - a collection of measures with different progressions
- Verse.ck - a collection of random progressions
- Song.ck - a collection of random verses
The verses can be quite different, but many sound quite alien. Here are a few examples:
HW 2 - Generative Clouds
I really think of HW2 as an extension of my efforts in HW1, with the introduction of a live element.
See the files in the hwk directory
I can provide a zip file on request.
The basic change in hwk 2 is the introduction of a video controller based on some code I got from Visda. The processing code is in the cameraone/ directory.
To run the program:
- Start processing and run the cameraone sketch. You should see a small camera window pop up with a line chart showing the total motion in the scene.
- Start chuck by typing “make”. This will generate a random song. Progress through the song will be driven by “beats” which correspond to peaks in the camera motion.
On my PC the sampling rate of the camera is about 10-20Hz, so timing accuracy is not great. You do definitely get a feeling of driving the music though, so I think I now have the kernel of a decent idea. For example:
hw2.wav
For the final project I want to try the following extensions:
- Right now the tones are selected against a randomly generated scale with a limited concept of a “chord” in that random scale. Refine this so we alternate between random scales and more familiar scales and progressions.
- Add the following camera inputs:
- Have the music keep driving more like a PLL than a simple trigger
- Total motion maps to measure note density or intensity
- Map colors to chords or tones
- Simple blob tracking for melody
This week in Ge’s class we’re asked to create three audio files, one based on cellular automata and two “ChuckKus”.
For the cellular automata part I created an instrument which is a linear bank of sin oscillators with gains controlled by the state bits in a cyclic linear cellular automata (CA). The state update for the CA is done every 100msec or so, which causes a timbral shift for the instrument. Since some CAs get stuck in repetetive cycles, this can result in a vibrato type effect, or even notes simply extinguishing early.
In the piece, I play first a few chords and then have a random melody played over a static bass line. There are a couple lines of code to make sure that the two pieces end together.
Some interesting points:
- A parameter controls the randomness of the oscillators from their ideal frequency, which creates a little more richness and ambiguity in the tone.
- The initial value of the CAM is seeded randomly.
- Although the rule 110 CA is universal, there are many others with different timbral possibilities to explore. The note generator choses a different rule for each note, so they all sound a bit different.
Listen to cell.wav
Read cell.ck…
Inevitable
The first chuck-ku plays with frequency modulation of triangleOsc. In the first case, we generate a low rumbling tone by chosing a random frequency in the 0-60Hz range. The melodic element is caused by moving the second oscillator on a random walk with a slight upward bias. The result is a feeling of increasing unresolved tension as the pitch slowly climbs. Note the perceived shift in volume as this oscillator slews.
Gain g=>JCRev r=>WvOut w=>dac; 0.1=>g.gain; TriOsc t=>g; TriOsc t2=>g;
while (10::ms => now) { Std.rand2f(0,60) => t.freq;
t2.freq() * Std.rand2f(0.998,1.00205) => t2.freq; }
Listen to
Inevitable.wav
Chase
A second example uses the same techniques, but this time one oscillator does the random walk while the other pursues “in a statistical sense”.
Gain g=>JCRev r=>WvOut w=>dac; 0.1=>g.gain; TriOsc t=>g; TriOsc t2=>g;
while (t2.freq()>30) {Math.max(30,t2.freq()*Std.rand2f(0.9,1.1)) => t2.freq;
t.freq()+Std.rand2f(-0.01,0.02)*(t2.freq()-t.freq()) => t.freq; 20::ms=>now;
<<< t.freq() >>>;
}
Listen to chase1.wav
Okay baby is due in about 1 minute and we still dont have a name just yet. Here are our top candidates:
- tycho
- sky
- rain
- kai
- river
- jude
- galileo
- ding dong
- oui
- ao
- hunter
- misha
The figure below is the Map of the Market for 2008. Winners are shown in green while losers are in black.

As we can see there are a few winners in an otherwise bad year:
- biotech stocks like Genentech and Amgen are up for the year (why?)
- Discounters like Walmart, McDonalds, Family Dollar Stores are up, along with other money savers like Autozone.
- Large consumer conglomerates like Exxon and Johnson and Johnson are also holding ground.
2009 will be an interesting year indeed.
Have you ever been stalked by someone and couldnt make them stop? On the other hand, have you ever been hammering at someone in a relationship only to be consistently turned away?
Of course you have. While these effects are most noticeable in strong emotional relationships, there is an emotional or relationship “distance” between any two people. We are continually updating this emotional distance with each interaction, moving closer or farther away from our partners in a kind of constant dance.
But what factors determine the equilibrium point in a relationship? The following figure provides some insight. Here we have a graph of happiness versus emotional distance for two people, blue and yellow. Where they wind up depends on their style of cooperation and the similarity or dissimilarity of their utility functions.

In the simplest case if Blue and Yellow don’t cooperate at all - Blue constantly pushes toward point “A”, while Yellow tries to reach its maximal happiness at “B”. The situation is constantly unstable with effort expended by Blue to move closer and by Yellow to move away. Typically Blue might wind up feeling rejected while Yellow may begin to feel harassed. How sad for Blue and Yellow!
If Blue and Yellow could cooperate they might choose to maximize their total happiness and wind up somewhere on the thin green line near “C”. This Utilitarian view is simple, but notice how Blue’s happiness has a much larger effect on the outcome. Also it requires knowledge of the complete utility curve of both individuals and way of “summing” happiness.
An alternative view due to Rawls would maximize the happiness of the least happy person, resulting in the equilibrium at the crossover point “D”. They are also equally happy at this point, which might make it easier to reach in practice since Blue and Yellow can compare their level of happiness (or sadness) directly.
A simple rule for cooperation emerges: compare notes and yield to the person who is most vulnerable.
(more…)
In case you’re tired of names that everyone knows, here is a little bit of javascript that makes up new names.

This is my cat Milo. He’s quite a bit older than this now and I had to take him to the vet last week because he had a wound from a catfight. Instead of his usually outdoorsy nature he’s been sulking in the garage behind my surfboard and some cans of paint.
Generally pets are considered to be a happy thing to have, and most kids are very eager to ask about cats and dogs. Of course they are fun to play with. Dogs have a profound degree of social empathy and cats at least like to share (steal?) body warmth.
Recently though I am starting to think that pets have another effect on the subconscious mind. Could it be that pets also provide us with the sense that we are “big”?
The existence of a pecking order is well established in primate societies, and even interactions between people in so-called egalitarian societies there is a constant subconcious stuggle for recognition, status and dominance. Dr. Richard Firebaugh has done studies that show that income contributes to happiness only if it is high relative to others in the same age and peer group. They claim that American are on a “hedonic treadmill” with people chasing the standard of living of those around them:
Our analysis indicates that Americans are on a hedonic treadmill for most of their working lives. We find, with and without controls for age, physical health, education and other correlates of happiness, that the higher the income of others in one’s age group, the lower one’s happiness.
This lends strength to the “big fish in a little pond” style of living. Pets are one way that people can construct safe social niches - in a way stacking the subconscious deck with those of even lower status.
Does this effect also underpin some of the desire to have children? How much of this dynamic exists between partners in a love relationship? And how much are love relationships set by patterns of dominance, submissiveness and rebellion?
While this is worth thinking about I don’t mean to suggest that this dominance relationship exists to serve an entirely cynical purpose. Having pets can also elicit nurturing responses which are part of our best nature. For example, mothers love for a helpless and needful infant is held as the standard against which all other forms of love are compared. It may be that some of the truest forms of love and compassion between people require some imbalance of power.
These days I’ve been working on vocal tone and texture. I have a handy little setup where I can play a passage about 15 seconds long and listen to the playback through a delay line.
Today’s efforts were pretty good considering I’ve been taking a break for a while. Pitch didnt seem to be an issue much of the time though there were a few things that I noticed:
- My consonants were disappearing totally. I really had to exaggerate them to get them across at all, to say nothing of providing the punch and energy that the vocals demand.
- I’m getting better at tone control, for example keeping the sound from rising above the soft palatte and channeling most of it through the mouth, which avoids the nasally tone. Today I was even able to direct the vibration into the jaw below by lower front teeth, which made it sound much rounder than before, though maybe a little too much.
- It’s tempting to adopt some kind of drawl to make a voice sound distincting or professional sounding. Got to watch out not to overdo it.
- Spent quite a bit of time today on whisper voice, which take a lot of air. On mic though it can sound pretty good. The trick is to get enough air and force behind it that it doesn’t sound weak. This needs more practice.
- Vowels are very important. In particular i notice if I bend my “ee”s a little to the “ay” sound they sound more pleasing.
Things are improving though I must say I still dont sound that great. I’m not yet sure what I’m not doing that separates me from Eddie Veder, but I’m pretty sure I’ll figure it out this year.
I decided to watch this video while procrastinating my cs229 homework. Basic idea is a system to hide tasks until the time needed to do them.
http://www.davidco.com/google.php
- Your ability to generate power is directly proportional to your ability to concentrate.
- Your mind is limited in its ability to remember and remind.
- Perspective is the most valuable commodity.
Some useful tidbits, though perhaps a bit overblown. (Or should I say “successfully marketed”?)
Of all the ideas, the means of pushing tasks and commitents out to a defined future date or disposing of them seems the most useful. I’ve had a lot of trouble managing contacts and calendars this year and it would be nice to get that problem solved.

Recently it’s been getting colder, though this year the summer has had a few faint afterthoughts. I’ve been thinking about the sensation of cold and why it is so unpleasant to me.
It’s well known that your arteries and capillaries restrict the flow of blood to the skin when there is cold. Lately I’ve started thinking that part of the unpleasantness of cold is the effort expended by all the tiny sheets of smooth muscle that have to tense up to make this happen. I’ve even started thinking that once the cold is removed this vascular tension doesnt really go away immediately.
Also consider the possibility that some capillaries are the size of a single blood cell. If the flow though them is constricted for long periods of time, there could be blood cells which dont make it back to the oxygen rich parts of the bloodstream for quite some time. It’s also possible that cellular waste products build up in tissues when this is happening.
The curious thing is that you can actually reverse this process with some focus. In a meditative position it’s possible to allow your skin and vasculature to relax and open up. This type of relaxation may even be more profound that simply relaxing skeletal muscle, especially if it could be extended to the inner organs, and brain.
When I really succeed at this I can feel parts of my body pulsing with the beat of my heart and almost feel the tissues being flushed out.