Tuesday, March 13, 2007

Supercollider Week 1 execise

After much trial and error and learning stuff, a couple of us have manged to get together a working prototype of the midi to frequency conversion in the infamos SUPERCOLLIDER!!!

Supercollider is the best. If you are in 2nd year I feel sorry cause you won't get to experience the pure joy just yet, but hold on. John Cage with you.


(
// build a table of note names

var table = ();

value
{
var semitones = [0, 2, 4, 5, 7, 9, 11];
var naturalNoteNames = ["c", "d", "e", "f", "g", "a", "b"];



(0..9).do
{
arg o;

naturalNoteNames.do
{

arg c, i;

var n = (o + 1) * 12 + semitones[i];

table[(c ++ o).asSymbol] = n;
table[(c ++ "s" ++ o).asSymbol] = n + 1;
table[(c ++ "ss" ++ o).asSymbol] = n + 2;
table[(c ++ "b" ++ o).asSymbol] = n - 1;
table[(c ++ "bb" ++ o).asSymbol] = n - 2;
};
};
};


a = table.atAll(#[c4]); // change the number where it says c4 to get frequency

a = 2**((a-69)/12) *440;

)

3 comments:

John said...

Johnny Cage, is it really you? Just wanted to say how deeply moved I am by your genius. 4'33 has me in tears every time.

http://johndelany.blogspot.com

Johnny C said...

John, I am but a student of the great master. The man who showed me what music can truly be, not a series of notes governed by tiranic rules, but a free, flowing sequence of sound that can touch all who hear it. 4'33 took John 8 weeks of preparation; originally it was meant to run for 4'14, but due to the nature of the first performance the soloist had to extend the cadenza at the end of the 2nd movement to compensae for the acoustics of the room. 4'33 is one of those works you can hear once and be humming all day...

John said...

And I was really hoping for a sequel, like 4'33 part II.