/* Krishan Kumar Final Project December 2015 */ HevyMetl topVoice => Gain master => dac; topVoice=> Delay delay => Gain guitar => delay; delay => master; // vocals for harmony VoicForm vocals[4]; NRev vocalsRev => master; for( 0 => int i; i < vocals.cap(); i++) { vocals[i] => vocalsRev; (.5/vocals.cap()) => vocals[i].gain; } [36, 48, 51, 55] @=> int backtrack[]; .5 => vocalsRev.mix; for( 0 => int i; i < vocals.cap(); i++) { .03 => vocals[i].vibratoGain; "ahh" => vocals[i].phoneme; Std.mtof(backtrack[i]) => vocals[i].freq; } //strings Bowed strings[3]; NRev stringsRev => master; for( 0 => int i; i < strings.cap(); i++) { strings[i] => stringsRev; (.5/strings.cap()) => strings[i].gain; } [55,58,62] @=> int orchestra[]; .5 => stringsRev.mix; for( 0 => int i; i < strings.cap(); i++) { .03 => strings[i].vibratoGain; Std.mtof(orchestra[i]) => strings[i].freq; Math.random2f(0.0,1.0) => strings[i].bowPressure; Math.random2f(0.0,0.5) => strings[i].bowPosition; Math.random2f(0.0,1.0) => strings[i].volume; Math.random2f(0.0, 1.0) => strings[i].startBowing; Math.random2f(0.0, 0.5) => strings[i].stopBowing; } //percussion Shakers shaker => master; fun void percuss() { Math.random2(1,4) => shaker.preset; Math.random2f(50.0,110) => shaker.objects; Math.random2f(.8,1.0) => shaker.decay; shaker.noteOn(Math.random2f(0.0, 4.0)); } [72,74,75,77,79,80,82] @=> int melody[]; .15 => float tempo; tempo::second => delay.max; tempo::second => delay.delay; .5 => guitar.gain; .7 => master.gain; dac => WvOut2 out => blackhole; me.sourceDir() + "Kumar_fp.wav" => string _capture; _capture => out.wavFilename; 2::second => now; now + 1::minute => time later; while (now int i; i < melody.cap(); i++) { Std.mtof(melody[Math.random2(0,melody.cap()-1)]) => topVoice.freq; topVoice.noteOn(Math.randomf()); percuss(); (0.5*tempo)::second=> now; if (Math.random2(1,5) == 1) { percuss(); } (0.5*tempo)::second => now; } } 2::second => now; out.closeFile();