Homework 2 - Alex Han

Play!

Based on the 4 against 3 example. This piece uses a 5 against 4 polyrhythm, using four FM timbres running through Chorus, Reverb, and Panning. I adjusted the IsoRhythm class to add additional control and variation. The interOnsetInterval is now an argument, which I varied in each spork. I also made the notes de-tune progressively more and more as each shred progresses. I made my piece by sporking several shreds starting from a slow, gradual creeping sound erupting into sudden chaos in the middle, and returning to relative calm at the end.

////////////////////////////////////////////////////
suggestion (copy this whole and replace the live code)
IsoRhythm iso[3]; spork ~iso[0].play(30::second, 0.97, 160::ms); 1::second => now; spork ~iso[1].play(29::second, 0.96, 150::ms); 1::second => now; spork ~iso[2].play(48::second, 0.95, 140::ms); 30::second => now; IsoRhythm iso2[3]; spork ~iso2[0].play(30::second, 0.97, 160::ms); 1::second => now; spork ~iso2[1].play(29::second, 0.96, 150::ms); 1::second => now; spork ~iso2[2].play(28::second, 0.95, 140::ms); 30::second => now;
////////////////////////////////////////////////////
live code
global Event playRiff; class IsoRhythm { // array to hold midi pitches (key numbers) // these will be converted into the carrier frequencies [67, 68, 72, 74, 77] @=> int keyNum[]; // how many pitches are in the array keyNum.cap() => int nPitches; 4 => int nInsts; FM fm[nInsts]; new FMVoices @=> fm[0]; new BeeThree @=> fm[1]; new Rhodey @=> fm[2]; new HevyMetl @=> fm[3]; Pan2 stereo[nInsts]; for (0 => int i; i < nInsts; i++) fm[i] => stereo[i] => dac; 2 => int nChans; Chorus crs[nChans]; NRev rev[nChans]; for (0 => int i; i < nInsts; i++){ for (0 => int ch; ch < nChans; ch++) { stereo[i].chan(ch) => crs[ch] => rev[ch] => dac.chan(ch); } for (0 => int i; i < nInsts; i++) fm[i].gain(0.05); } 100::ms => dur duration; 100::ms => dur duration0; 200::ms => dur duration1; 50::ms => dur duration2; 20::ms => dur duration3; fun void play( dur interOnsetInterval, dur howLong, float accel, dur minInterOnsetInterval) { // initial interOnsetInterval (inverse of tempo) //1000::ms => dur interOnsetInterval; // index for which pitch is next 0 => int p; // index for which instrument is next 0 => int i; now => time beg; beg + howLong => time end; while (now < end) { Std.mtof(keyNum[p]+12.0) + Math.random2f(-50.0,50.0) * (end-now)/howLong=> fm[i].freq; stereo[i].pan( (i%nInsts - 1) ); //crs[0].modDepth * 5.0 => crs[0].modDepth; //crs[1].modDepth * (end-now)/howLong => crs[1].modDepth; //rev[0].modDepth * (end-now)/howLong => rev[0].modDepth; //rev[1].modDepth * (end-now)/howLong => rev[1].modDepth; /* for (0 => int i; i < nInsts; i++){ for (0 => int ch; ch < nChans; ch++) { crs[ch].modDepth } } */ fm[i].noteOn(1.0); duration => now; fm[i].noteOff(1.0); // increment pitch and instrument p++; i++; // cycle pitches through full array nPitches %=> p; // cycle instruments through full array nInsts %=> i; // advance time by interOnsetInterval and calculate the next interval interOnsetInterval => now; // accelerate if (interOnsetInterval > minInterOnsetInterval) interOnsetInterval * accel=> interOnsetInterval; else // can't go faster than minInterOnsetInterval minInterOnsetInterval => interOnsetInterval; } } } // end of isoRhythm class definition IsoRhythm iso; // instantiate an IsoRhythm object spork ~ iso.play(1000::ms, 25::second, .99, 40::ms); 25::second => now; spork ~ iso.play(500::ms, 20::second, .4, 5::ms); 20::second => now; spork ~ iso.play(1500::ms, 10::second, .8, 5::ms); 10::second => now; spork ~ iso.play(500::ms, 30::second, .2, 1::ms); 30::second => now; spork ~ iso.play(1000::ms, 5::second, .99, 40::ms); 5::second => now; 1::week => now;