This is written for the bytebeat thing here. 

http://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html

This is meant to be played at the 44k setting. For other sample rates, the SAMPRATE value must be changed. I rendered about a minute but there's a few LFOs going that will cause the sound to change subtly for quite a bit longer. I dunno how long to render.

-- THE PROGRAM --

TAU = 2 * 3.141592, 
SAMPRATE = 44000,
CIRBUFSIZE = floor(SAMPRATE * 3),
TEMPOISH = SAMPRATE / 10, 
SECOND = t / TEMPOISH, 
BEAT = t % TEMPOISH / TEMPOISH, 
MEASURE = (floor(SECOND / 8)) % 4,
FREQ = (70 * (pow(1.5, MEASURE))),
FREQ = FREQ * pow(1.122462, floor((SECOND / 32) % 4)),
NOTE = floor(SECOND % 3 + 1) * FREQ + FREQ, 

CircularBuffer = (function makeCircularBufferCls() {
    var CircularBuffer = function(size) {
        this.buff = [];
        this.size = size;
    };
    CircularBuffer.prototype.get = function(idx) {
        return this.buff[idx % this.size] || 0;
    };
    CircularBuffer.prototype.set = function(idx, val) {
        this.buff[idx % this.size] = val;
    };
    return CircularBuffer;
})(),
buff = (function() {
    if (typeof glob == "undefined" || glob == null) { 
        glob = new CircularBuffer(CIRBUFSIZE); 
    } 
    return glob;
})(),
lfo = function(t, bottom, top, seconds) {
    var depth = top - bottom;
    var maX = depth;
    var range = depth * 2;
    var timeUnit = SAMPRATE * seconds;
    return top - abs(maX - range * (t % timeUnit / timeUnit));
},
ramplfo = function(t, bottom, top, seconds) {
    var depth = top - bottom;
    return bottom + depth * (t % (seconds * SAMPRATE) / (seconds * SAMPRATE))
},
FMFREQ = NOTE + floor((ramplfo(t, 0, 4, 16))) * NOTE, 
wetsig = buff.get(t),
dry = sin((t + sin(t * FMFREQ * TAU / SAMPRATE) * (15 - (pow(BEAT, 0.5) * 15)) * lfo(t, 0.5, 1, 10) + wetsig * lfo(t, 0.25, 0.5, 100)) * NOTE * TAU / SAMPRATE) * (60 - pow(BEAT, 0.55) * 55) * min(1, t/16/SAMPRATE),
tot = dry + wetsig * lfo(t, 0, 0.4, 30),
buff.set(t, dry),
128 + tot 


-- END PROGRAM --

Also using this link works.

http://greggman.com/downloads/examples/html5bytebeat/html5bytebeat.html#t=0&e=0&s=44100&bb=5d000001005706000000000000002a1046ed2b112f32f9499f37f8bef0aa00da9e1e9694ea166768436c1b40fcd79ecfa013171d909ba7ac6a66202e3614d8cc36e76bdfda26e7389f19b0ab6b28aa2ed6172c34b75155319a5194206346b4d98b09ac0db49a92b1e2600f13733531d76489d6ac23f2d33fe9315ce92596dbf3f5a0a6c7b177673376815c346097bca64e8c68fd4ea380ae718bd407bbf6ee7d0225718a9a592d57e765fb1367360267d579a59ed1175d49ce3a59c86d0572375644d146e5441381be7b639c620796f342baa0f1182fc285f9efbf917c70f99f85e99b5e0ab483c2edbca2e54f8feb58e4779f820ee172d9001cd6ee36f7caa68a36356ea45b7d3f6a3285f5e033044ff64f96ff2b088edafa667b7988664f28bdbc24ff12efac864da345b62165350c1e672e27ab9f98089151cd2210b5d20d08b6917eab453ef23517fb30042594a85b9a8e1fdadbe6a3bbde68cd76e165c8ff7b14a9768082146aa701795193cc540b612ef095ac032aca8769dac16137a6f1701c6c745caf7743c43a02f059b543a0f16768349e48c1e3280262edf8e34ce300707181d7f4cfb1dd9c0338329130ebae28640f17eb5e8e09c1c0d084666ceed9d72908de066f961e788cc3c7b4d1713696d6f4dc282bd0873e3f7d718ef7696146b277e99cdfaf3fb98a91b26a6d736bff0394a2c196a39c17b31a4b39baf5adde9259039d7b7d0b8442e06882a2e0fa12340d3b8762befc3ab57dad0f4e2c478dfb39fff7bfa0b2c571bc90c34cb1cc4cdd934e2be0893649775068e2d61d135f8341204c485e72ecaf4a33dd335b737ab7742bb8d9d022a9ca3ff97e0c863ac8a4215d7062b86238e9544775aa177f0c5aad6747b77c50ab394b06e1da61a82c82ce3835dbcceac6a1a4200075bd1ae92823bc0b29cb0a791f9449fd16aa236bc881a28ac699e90cfca7412c2def74f181d3b46b49baffe0b9a29f
