// Betelgeuze ritual music // J. Nurminen 2009 // // My second chuck, ever :) // sacred plonky Impulse imp; JCRev rev; rev.mix(0.4); BPF filt; Chorus chorus; Gain gain; 0.80 => gain.gain; 0.9 => filt.gain; 1.0 => chorus.modFreq; 0.13 => chorus.modDepth; 0.4 => chorus.mix; // signal flow imp => filt => chorus => rev => gain => dac; // divine bass TriOsc osc; JCRev r2; Gain g2; ADSR adsr; adsr.set( 0::ms, 250::ms, 0, 0::ms); 0.15 => g2.gain; // signal flow osc => adsr => r2 => g2 => dac; // -------------------------------------------------------------------------- // melodies // plonky, D-D#-G-A-A# [74,75,79,81,82] @=> int plonkyNotes[]; // bass, D-G-A [38,43,45] @=> int bassNotes[]; // bass spork fun void bass() { if ( Std.rand2f(0,1) < 0.40 ) { adsr.keyOff(); // bass frequency Std.mtof(bassNotes[Std.rand2(0,bassNotes.cap()-1)]) => osc.freq; adsr.keyOn(); } } // plonky spork fun void plonky() { if ( Std.rand2f(0,1) < 0.6 ) { // melody parameters Std.rand2f(700, 1200) => filt.Q; Std.mtof(plonkyNotes[Std.rand2(0,plonkyNotes.cap()-1)]) => filt.freq; // velocity of instrument Std.rand2f(1000.0, 2500.0) => imp.next; } } // singing monks/chanting priest/modulated fart VoicForm voices; Gain g3; ResonZ reso; Echo e3Left; Echo e3Right; JCRev rev3; HPF derumble; rev3.mix(0.45); 70.0 => derumble.freq; voices => reso => e3Left => rev3 => derumble => g3 => dac.left; voices => reso => e3Right => rev3 => derumble => g3 => dac.right; Std.mtof(38) => reso.freq; 7.0 => reso.Q; 0.40 => g3.gain; // echoes 3::second => e3Left.max; 120::ms => e3Left.delay; 0.4 => e3Left.mix; 3::second => e3Right.max; 90::ms => e3Right.delay; 0.6 => e3Right.mix; // priestly singer 0.2 => voices.loudness; 0.8 => voices.voiced; 0.6 => voices.unVoiced; Std.mtof(31) => voices.freq; // Betelgeuze linguistics :) ["eee", "aaa", "uuu", "ooo"] @=> string vowels[]; ["rrr", "shh", "mmm", "zhh", "sss", "zzz", "thz", "ohh", "uhh"] @=> string consonants[]; fun void bunchOfMonks() { while(true) { // chant a holy word (in Betelgeuzian) voices.noteOn( .6 ); for (0 => int j; j < Std.rand2(3,10); j++) { // consonant consonants[Std.rand2(0, consonants.cap()-1)] => string s; // <<< s, "" >>>; // uncomment for karaoke mode s => voices.phoneme; Std.rand2f(40.0, 80.0)::ms => now; // vowel(s) for (0 => int i; i < Std.rand2(1,4); i++) { vowels[Std.rand2(0,vowels.cap()-1)] => string s; // <<< s,"" >>>; // uncomment for karaoke mode s => voices.phoneme; Std.rand2f(300.0, 630.0)::ms => now; } } voices.noteOff( .5 ); // <<< ".", "" >>>; // uncomment for karaoke mode // pause 2::second => now; } } spork ~ bunchOfMonks(); // time loop while (true) { bass(); plonky(); // wait a few random note durations 4::second / (2 << Std.rand2(0,3)) => now; }