// Michael Olsen // CCRMA ID: mjolsen // Composition Period: 10/3/2015 - 10/4/2015 // Homework #1: Composition portion /* This code includes functions that allow for additive synthesis of sinusoids based on parameters provided from different portions of the code. There is a triangle pad-type sound that is generated from taking 5 harmonics of a fundamental frequency which decay with alternating positive/negative amplitudes at a rate proportional to the inverse of the square of the harmonic number. There is also an additively created model of an inharmonic Javenese bell instrument called a bonang and then there is a simple single sinusoid sub-bass instrument. There is also all of the control structure necessary for the arrangement and performance of the entire composition written in the code that follows the function definitions /* this portion of the code contains functions that are needed for the composition */ /* this function creates a single sinusoid at rate f and gain g with ADSR envelope values provided by aTime, dTime, sTime and rTime */ fun void pGen(dur aTime,dur dTime, float sVal,dur sTime,dur rTime,float f,float g,int revOn, float revMix) { // declare UGens SinOsc s; ADSR env; NRev r; // if reverg on, route osc and adsr through reverb if (revOn == 1) { s => env => r => dac; r.mix(revMix); } else // don't { s => env => dac; } // set the freq and gain of the oscillator f => s.freq; g => s.gain; // set the ADSR values and start attack env.set(aTime,dTime,sVal,rTime); env.keyOn(); // advance clock through A,D,S state durations aTime+dTime+sTime => now; // start decay env.keyOff(); // advance clock through decay duration rTime => now; } /* this function creates a harmonic tone containing a fundamental and it's 4 next odd harmonics whose amplitudes roll off at a ratio inversely proportional to the square of their index numbers. The tone is then played based on the envelope values where the maximum gain of the entire sound is equal to gain g */ fun void padNoteGen(dur aTime,dur dTime,float sVal,dur sTime,dur rTime,float f,float g,int revOn,float revMix) { // spork all of the 5 harmonic partials for the specified duration for (0 => int i; i < 5; i++) { spork ~pGen(aTime,dTime,sVal,sTime,rTime,f*(2*(i+1)-1),g/(Math.pow(-1.0,i)*(Math.pow(2*(i+1)-1,2))),revOn,revMix); me.yield(); } // advance clock by specified duration aTime+dTime+sTime+rTime => now; } /* this function creates a inharmonic tone that mimics the sound of the Balinese banong instrument. Takes amplitude envelope parameters as well as fundamental pitch, gain value and reverb parameters */ fun void bonangNoteGen(dur aTime,dur dTime,float sVal,dur sTime,dur rTime,float f,float g,int revOn, float revMix) { /* Array holding frequency ratios and partial amplitudes for a Balinese banong. The frequency ratios were found in the book "Tuning, Timbre, Spectrum, Scale" by William A. Sethares */ [[0.00,1.52,3.46,3.92],[0.5,0.25,0.125,0.0625]] @=> float bonangData[][]; // spork all of the partials for the specified duration for (0 => int i; i < bonangData[0].size(); i++) { spork ~pGen(aTime,dTime,sVal,sTime,rTime,f*Math.pow(2,bonangData[0][i]),g*bonangData[1][i],revOn,revMix); me.yield(); } // advance clock by specified duration aTime+dTime+sTime+rTime => now; } // this function plays a 3/8 eighth note phrase on bonang notes fun void bonangPhrase1(dur aTime,dur dTime,float sVal,dur sTime,dur rTime,dur rTimeRev, float PelogNotes[],float ampVals[],dur eighthLength) { spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTimeRev,PelogNotes[0],ampVals[0],1,0.000025); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTime,PelogNotes[2],ampVals[1],0,0); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTime,PelogNotes[4],ampVals[2],0,0); eighthLength => now; } // this function plays a 4/8 eighth note phrase of bonang notes fun void bonangPhrase2(dur aTime,dur dTime,float sVal,dur sTime,dur rTime,dur rTimeRev, float PelogNotes[],float ampVals[],dur eighthLength) { spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTimeRev,PelogNotes[1],ampVals[0],1,0.000025); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTime,PelogNotes[2],ampVals[1],0,0); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTime,PelogNotes[1],ampVals[0],0,0); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTimeRev,PelogNotes[6],ampVals[1],1,0.000025); eighthLength => now; } // this function plays sub and bonang together for a 9/8 eighth note phrase fun void comboPhrase1(dur aTime,dur dTime,float sVal,dur sTime,dur rTime,dur rTimeRev,float PelogNotes[], float ampVals[],dur eighthLength,dur subATime,dur subDTime,float subSVal,dur subSTime, dur subRTime,float f,float g,int revOn,float revMix) { spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTimeRev,PelogNotes[0],ampVals[0],1,0.000025); me.yield(); spork ~pGen(subATime,subDTime,subSVal,subSTime,subRTime,f,g,revOn,revMix); me.yield(); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTime,PelogNotes[2],ampVals[1],0,0); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTime,PelogNotes[4],ampVals[2],0,0); eighthLength => now; } // this function plays sub and bonang together for a 10/8 eighth note phrase fun void comboPhrase2(dur aTime,dur dTime,float sVal,dur sTime,dur rTime,dur rTimeRev,float PelogNotes[], float ampVals[],dur eighthLength,dur subATime,dur subDTime,float subSVal,dur subSTime, dur subRTime,float f,float g,int revOn,float revMix) { spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTimeRev,PelogNotes[1],ampVals[0],1,0.000025); me.yield(); spork ~pGen(subATime,subDTime,subSVal,subSTime+eighthLength,subRTime,f,g,revOn,revMix); me.yield(); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTime,PelogNotes[2],ampVals[1],0,0); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTime,PelogNotes[1],ampVals[0],0,0); eighthLength => now; spork ~bonangNoteGen(aTime,dTime,sVal,sTime,rTimeRev,PelogNotes[6],ampVals[1],1,0.000025); eighthLength => now; } /* this portion of the code stores hard-coded values for ADSR, note frequencies, etc . . . */ /* store the values of the Gamelon Pelog scale for the demung octave kindly borrowed from: http://http://www.gamelansonoflion.org/GSOLspecs.html#tun */ [220*Math.pow(2,(5.0/12.0))+(3.0/10.0)*Math.pow(2,(1.0/12.0)), 220*Math.pow(2,(7.0/12.0)), 220*Math.pow(2,(2.0/3.0))+(9.0/20.0)*Math.pow(2,(1.0/12.0)), 440*Math.pow(2,(-1.0/12.0))+(1.0/5.0)*Math.pow(2,(1.0/12.0)), 440+(47.0/100.0)*Math.pow(2,(1.0/12.0)), 440*Math.pow(2,(1.0/6.0))-(2.0/5.0)*Math.pow(2,(1.0/12.0)), 440*Math.pow(2,(1.0/4.0))+(7.0/20.0)*Math.pow(2,(1.0/12.0))] @=> float PelogNotes[]; // set duration of an eighth note in ms 160::ms => dur eighthLength; // set durations of triplet and doublet quarter notes (3 * eighthLength) => dur beatLength1; (2 * eighthLength) => dur beatLength2; // ADSR values for the pad instrument 1000::ms => dur padATime; 250::ms => dur padDTime; 0.75 => float padSVal; 4.5::second => dur padSTime; 1.5::second => dur padRTime; float PadChordFreqs[3]; // set the pad's chord notes based on balong scale frequencies PelogNotes[1] => PadChordFreqs[0]; PelogNotes[2] => PadChordFreqs[1]; PelogNotes[6] => PadChordFreqs[2]; // sub-bass ADSR values 5::ms => dur subATime; 5::ms => dur subDTime; 0.8 => float subSVal; 25::ms => dur subRTime; 3*eighthLength-subATime-subDTime-subRTime-50::ms => dur subSTime; // bonang ADSR values 5::ms => dur aTime; 5::ms => dur dTime; 0.5 => float sVal; 25::ms => dur sTime; eighthLength + 300::ms => dur rTime; eighthLength + 1500::ms => dur rTimeRev; // set gain values for different values for expressivity 0.4375 => float dforte; 0.25 => float forte; 0.125 => float mezzoForte; // store these gain values in a couple of arrays [dforte,mezzoForte,mezzoForte] @=> float ampVals[]; [forte,mezzoForte,mezzoForte] @=> float ampVals2[]; // let's record this to a wavefile dac => WvOut2 out => blackhole; me.sourceDir() + "/OLSEN_Comp.wav" => string _capture; _capture => out.wavFilename; /* this is the beginning of the song structure and playing */ // build up from nothing bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.015625,0.004464,0.004464],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.03125,0.008929,0.008929],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.046875,0.013393,0.013393],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.0625,0.017857,0.017857],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.078125,0.022321,0.022321],eighthLength); bonangPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.09375,0.026786,0.026786],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.109375,0.03125,0.03125],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.125,0.035714,0.035714],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.140625,0.040179,0.040179],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.15625,0.044643,0.044643],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.171875,0.049107,0.049107],eighthLength); bonangPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.1875,0.053571,0.053571],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.203125,0.058036,0.058036],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.21875,0.0625,0.0625],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.234375,0.066964,0.066964],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.25,0.071429,0.071429],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.265625,0.075893,0.075893],eighthLength); bonangPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.28125,0.080357,0.080357],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.296875,0.084821,0.084821],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.3125,0.089286,0.089286],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.328125,0.09375,0.09375],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.34375,0.098214,0.098214],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.359375,0.10268,0.10268],eighthLength); bonangPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,[0.375,0.107143,0.107143],eighthLength); // repeat twice more for (0 => int i; i < 2; i++ ) { bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); bonangPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); } // now bring in the pad playing two different chords and repeat twice for (0 => int k; k < 2; k++ ) { // prepare the pad sound PelogNotes[6] => PadChordFreqs[2]; for (0 => int i; i < PadChordFreqs.size(); i++) { spork ~padNoteGen(padATime,padDTime,padSVal,padSTime,padRTime,PadChordFreqs[i],0.4/PadChordFreqs.size(),0,0.0); me.yield(); } // and continue with the bonang for (0 => int i; i < 2; i++ ) { bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); bonangPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); } // switch top note of pad PelogNotes[4] => PadChordFreqs[2]; for (0 => int i; i < PadChordFreqs.size(); i++) { spork ~padNoteGen(padATime,padDTime,padSVal,padSTime,padRTime,PadChordFreqs[i],0.4/PadChordFreqs.size(),0,0.0); me.yield(); } // and continue with the bonang for (0 => int i; i < 2; i++ ) { bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); bonangPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); } } // new loop structure that will include sub-bass sound for (0 => int k; k < 2; k++ ) { // restore top note of pad PelogNotes[6] => PadChordFreqs[2]; for (0 => int i; i < PadChordFreqs.size(); i++) { spork ~padNoteGen(padATime,padDTime,padSVal,padSTime,padRTime,PadChordFreqs[i],0.4/PadChordFreqs.size(),0,0.0); me.yield(); } // then bring in sub bass along with bonang and pad for (0 => int i; i < 4; i++ ) { if (i == 2) // change the top note of the pad half-way through structure { // switch top note of pad PelogNotes[4] => PadChordFreqs[2]; for (0 => int i; i < PadChordFreqs.size(); i++) { spork ~padNoteGen(padATime,padDTime,padSVal,padSTime,padRTime,PadChordFreqs[i],0.4/PadChordFreqs.size(),0,0.0); me.yield(); } } // and include the combined sub-bass/bonang patterns comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime+3*eighthLength,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[0],0.4,1,0.000000125); } } // repeat loop structure but this time with higher voicing of pad for (0 => int k; k < 2; k++ ) { // switch all pad notes 2*PelogNotes[2] => PadChordFreqs[0]; PelogNotes[6] => PadChordFreqs[1]; 2*PelogNotes[1] => PadChordFreqs[2]; for (0 => int i; i < PadChordFreqs.size(); i++) { spork ~padNoteGen(padATime,padDTime,padSVal,padSTime,padRTime,PadChordFreqs[i],0.3/PadChordFreqs.size(),0,0.0); me.yield(); } // continue sub bass along with bonang and pad for (0 => int i; i < 4; i++ ) { if (i == 2) { // change pad note half way through structure PelogNotes[4] => PadChordFreqs[0]; for (0 => int i; i < PadChordFreqs.size(); i++) { spork ~padNoteGen(padATime,padDTime,padSVal,padSTime,padRTime,PadChordFreqs[i],0.3/PadChordFreqs.size(),0,0.0); me.yield(); } } // continue with sub-bass/bonang patterns comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime+3*eighthLength,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[0],0.4,1,0.000000125); } } // final loop structure for (0 => int k; k < 2; k++ ) { // return pad notes to their original positions PelogNotes[1] => PadChordFreqs[0]; PelogNotes[2] => PadChordFreqs[1]; PelogNotes[6] => PadChordFreqs[2]; for (0 => int i; i < PadChordFreqs.size(); i++) { spork ~padNoteGen(padATime,padDTime,padSVal,padSTime,padRTime,PadChordFreqs[i],0.4/PadChordFreqs.size(),0,0.0); me.yield(); } // continue sub bass along with bonang and pad for (0 => int i; i < 4; i++ ) { if (i == 2) { // switch top note of pad when half way through structure PelogNotes[4] => PadChordFreqs[2]; for (0 => int i; i < PadChordFreqs.size(); i++) { spork ~padNoteGen(padATime,padDTime,padSVal,padSTime,padRTime,PadChordFreqs[i],0.4/PadChordFreqs.size(),0,0.0); me.yield(); } } // continue sub-bass/bonang structure comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime+3*eighthLength,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[0],0.4,1,0.000000125); } } // now just bass and balong for (0 => int i; i < 4; i++ ) { comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime+3*eighthLength,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[4],0.35,1,0.000000125); comboPhrase2(aTime,dTime,sVal,sTime,rTime,rTimeRev,PelogNotes,ampVals2,eighthLength, subATime,subDTime,subSVal,subSTime,subRTime,0.125*PelogNotes[0],0.4,1,0.000000125); } // and a happy little fade out . . . spork ~pGen(subATime,subDTime,subSVal,subSTime+7*beatLength1,subRTime+8*eighthLength,0.125*PelogNotes[4],0.35,1,0.000000125); me.yield(); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev+eighthLength,PelogNotes,ampVals,eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev+eighthLength,PelogNotes,[0.4375, 0.05357, 0.05357],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev+eighthLength,PelogNotes,[0.375, 0.125, 0.125],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev+eighthLength,PelogNotes,[0.3125, 0.08929, 0.08929],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev+eighthLength,PelogNotes,[0.25, 0.07143, 0.07143],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev+eighthLength,PelogNotes,[0.1875, 0.05357, 0.05357],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev+eighthLength,PelogNotes,[0.125, 0.03571, 0.03571],eighthLength); bonangPhrase1(aTime,dTime,sVal,sTime,rTime,rTimeRev+eighthLength,PelogNotes,[0.0625, 0.01786, 0.01786],eighthLength); 4*beatLength1 => now; // a little more time for the decays to fully sound out.closeFile();