Discuss Scratch

PackersRuleGoPack
Scratcher
1000+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

m99900 wrote:

try this version then….

<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body onkeyup="myFunction2(event)" onkeydown="myFunction(event)">

<script type="text/javascript">
function myFunction(w){n=w.which}function myFunction2(w){n=0}"use strict";var beepbox;
(function(w){var I=function(){function d(b){this._bits=[];this._readIndex=0;this._base64=b}d.prototype.load=function(b){var c=this;b.split("").forEach(function(a){a=c._base64.indexOf(a);c._bits.push(0!=(a&32));c._bits.push(0!=(a&16));c._bits.push(0!=(a&8));c._bits.push(0!=(a&4));c._bits.push(0!=(a&2));c._bits.push(0!=(a&1))})};d.prototype.addPadding=function(){for(;0!=this._bits.length%6;)this._bits.push(!1)};d.prototype.skipPadding=function(){this._readIndex+=5-(this._readIndex+5)%6};d.prototype.write=
function(b,c){for(b--;0<=b;)this._bits.push(1==(c>>b&1)),b--};d.prototype.read=function(b){for(var c=0;0<b;)c<<=1,c+=this._bits[this._readIndex++]?1:0,b--;return c};d.prototype.writeLongTail=function(b,c,a){if(a<b)throw Error("value out of bounds");a-=b;for(b=c;a>=1<<b;)this._bits.push(!0),a-=1<<b,b++;for(this._bits.push(!1);0<b;)b--,this._bits.push(0!=(a&1<<b))};d.prototype.readLongTail=function(b,c){for(var a=b,d=c;this._bits[this._readIndex++];)a+=1<<d,d++;for(;0<d;)d--,this._bits[this._readIndex++]&&
(a+=1<<d);return a};d.prototype.writePartDuration=function(b){this.writeLongTail(1,2,b)};d.prototype.readPartDuration=function(){return this.readLongTail(1,2)};d.prototype.writePinCount=function(b){this.writeLongTail(1,0,b)};d.prototype.readPinCount=function(){return this.readLongTail(1,0)};d.prototype.writeNoteInterval=function(b){0>b?(this.write(1,1),this.writeLongTail(1,3,-b)):(this.write(1,0),this.writeLongTail(1,3,b))};d.prototype.readNoteInterval=function(){return this.read(1)?-this.readLongTail(1,
3):this.readLongTail(1,3)};d.prototype.concat=function(b){this._bits=this._bits.concat(b._bits)};d.prototype.toString=function(){this._bits.concat([!1,!1,!1,!1,!1,!1]);for(var b="",c=0;c<this._bits.length;c+=6){var a=0;this._bits[c+0]&&(a+=32);this._bits[c+1]&&(a+=16);this._bits[c+2]&&(a+=8);this._bits[c+3]&&(a+=4);this._bits[c+4]&&(a+=2);this._bits[c+5]&&(a+=1);b+=this._base64[a]}return b};d.prototype.traceBits=function(){};return d}();w.BitField=I;var f=function(){function d(){}d.scaleNames="easy :);easy :(;island :);island :(;blues :);blues :(;normal :);normal :(;romani :);romani :(;enigma;expert".split(";");
d.scaleFlags=[[!0,!1,!0,!1,!0,!1,!1,!0,!1,!0,!1,!1],[!0,!1,!1,!0,!1,!0,!1,!0,!1,!1,!0,!1],[!0,!1,!1,!1,!0,!0,!1,!0,!1,!1,!1,!0],[!0,!0,!1,!0,!1,!1,!1,!0,!0,!1,!1,!1],[!0,!1,!1,!0,!0,!1,!1,!0,!1,!0,!0,!1],[!0,!1,!1,!0,!1,!0,!0,!0,!1,!1,!0,!1],[!0,!1,!0,!1,!0,!0,!1,!0,!1,!0,!1,!0],[!0,!1,!0,!0,!1,!0,!1,!0,!0,!1,!0,!1],[!0,!0,!1,!1,!0,!0,!1,!0,!0,!1,!0,!1],[!0,!1,!0,!0,!1,!1,!0,!0,!0,!1,!1,!0],[!0,!1,!0,!1,!0,!1,!0,!1,!0,!1,!0,!1],[!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0,!0]];d.pianoScaleFlags=[!0,!1,!0,!1,
!0,!0,!1,!0,!1,!0,!1,!0];d.keyNames="B A# A G# G F# F E D# D C# C".split(" ");d.keyTransposes=[23,22,21,20,19,18,17,16,15,14,13,12];d.tempoNames="molasses slow leisurely moderate steady brisk hasty fast strenuous grueling hyper ludicrous".split(" ");d.beatsMin=3;d.beatsMax=12;d.barsMin=1;d.barsMax=128;d.patternsMin=1;d.patternsMax=32;d.instrumentsMin=1;d.instrumentsMax=10;d.partNames=["triples","standard"];d.partCounts=[3,4];d.noteNames="C C# D D# E F F# G G# A A# B".split(" ");d.waveNames="triangle;square;pulse wide;pulse narrow;sawtooth;double saw;double pulse;spiky;plateau".split(";");
d.waveVolumes=[1,.5,.5,.5,.65,.5,.4,.4,.94];d.drumNames=["retro","white"];d.drumVolumes=[.25,1];d.filterNames="sustain sharp;sustain medium;sustain soft;decay sharp;decay medium;decay soft".split(";");d.filterBases=[2,3.5,5,1,2.5,4];d.filterDecays=[0,0,0,10,7,4];d.filterVolumes=[.4,.7,1,.5,.75,1];d.attackNames=["binary","sudden","smooth","slide"];d.effectNames="none;vibrato light;vibrato delayed;vibrato heavy;tremelo light;tremelo heavy".split(";");d.effectVibratos=[0,.15,.3,.45,0,0];d.effectTremelos=
[0,0,0,0,.25,.5];d.chorusNames="union;shimmer;hum;honky tonk;dissonant;fifths;octaves".split(";");d.chorusValues=[0,.02,.05,.1,.25,3.5,6];d.chorusOffsets=[0,0,0,0,0,3.5,6];d.chorusVolumes=[.7,.8,1,1,.9,.9,.8];d.volumeNames="loudest loud medium quiet quietest mute".split(" ");d.volumeValues=[0,.5,1,1.5,2,-1];d.channelVolumes=[.27,.27,.27,.19];d.drumInterval=6;d.numChannels=4;d.drumCount=11;d.noteCount=37;d.maxPitch=84;return d}();w.Music=f;var P=function(){return function(d,b,c){this.interval=d;this.time=
b;this.volume=c}}();w.TonePin=P;var ia=function(){return function(d,b,c,a,f){void 0===f&&(f=!1);this.notes=[d];this.pins=[new P(0,0,a),new P(0,c-b,f?0:a)];this.start=b;this.end=c}}();w.Tone=ia;var l=function(){function d(){this.tones=[];this.instrument=0}d.prototype.cloneTones=function(){var b=[];this.tones.forEach(function(c){var a=new ia(-1,c.start,c.end,3);a.notes=c.notes.concat();a.pins=[];c.pins.forEach(function(b){a.pins.push(new P(b.interval,b.time,b.volume))});b.push(a)});return b};return d}();
w.BarPattern=l;var R=function(){function d(b){void 0===b&&(b=null);null!=b?this.fromString(b,!1):this.initToDefault(!1)}d.prototype.initToDefault=function(b){void 0===b&&(b=!1);b||(this.channelPatterns=[[new l,new l,new l,new l,new l,new l,new l,new l],[new l,new l,new l,new l,new l,new l,new l,new l],[new l,new l,new l,new l,new l,new l,new l,new l],[new l,new l,new l,new l,new l,new l,new l,new l]]);this.channelBars=[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]];this.channelOctaves=[3,2,1,0];this.instrumentVolumes=[[0],[0],[0],[0]];this.instrumentWaves=[[1],[1],[1],[1]];this.instrumentFilters=[[0],[0],[0],[0]];this.instrumentAttacks=[[1],[1],[1],[1]];this.instrumentEffects=[[0],[0],[0],[0]];this.instrumentChorus=[[0],[0],[0],[0]];this.scale=0;this.key=f.keyNames.length-1;this.loopStart=0;this.loopLength=4;this.tempo=7;this.beats=8;this.bars=16;this.patterns=8;this.parts=4;this.instruments=1};d.prototype.toString=
function(){var b=this,c,a,p,g,t=d._newBase64;g="#"+t[d._latestVersion];g+="s"+t[this.scale];g+="k"+t[this.key];g+="l"+t[this.loopStart>>6]+t[this.loopStart&63];g+="e"+t[this.loopLength-1>>6]+t[this.loopLength-1&63];g+="t"+t[this.tempo];g+="a"+t[this.beats-1];g+="g"+t[this.bars-1>>6]+t[this.bars-1&63];g+="j"+t[this.patterns-1];g+="i"+t[this.instruments-1];g+="r"+t[f.partCounts.indexOf(this.parts)];g+="w";for(c=0;c<f.numChannels;c++)for(a=0;a<this.instruments;a++)g+=t[this.instrumentWaves[c][a]];g+=
"f";for(c=0;c<f.numChannels;c++)for(a=0;a<this.instruments;a++)g+=t[this.instrumentFilters[c][a]];g+="d";for(c=0;c<f.numChannels;c++)for(a=0;a<this.instruments;a++)g+=t[this.instrumentAttacks[c][a]];g+="c";for(c=0;c<f.numChannels;c++)for(a=0;a<this.instruments;a++)g+=t[this.instrumentEffects[c][a]];g+="h";for(c=0;c<f.numChannels;c++)for(a=0;a<this.instruments;a++)g+=t[this.instrumentChorus[c][a]];g+="v";for(c=0;c<f.numChannels;c++)for(a=0;a<this.instruments;a++)g+=t[this.instrumentVolumes[c][a]];
g+="o";for(c=0;c<f.numChannels;c++)g+=t[this.channelOctaves[c]];g+="b";p=new I(t);for(var h=0;1<<h<this.patterns+1;)h++;for(c=0;c<f.numChannels;c++)for(a=0;a<this.bars;a++)p.write(h,this.channelBars[c][a]);g+=p.toString();g+="p";p=new I(t);for(var e=0;1<<e<this.instruments;)e++;for(c=0;c<f.numChannels;c++){var h=3==c?0:12*this.channelOctaves[c],l=(3==c?4:12)+h,k=3==c?[4,6,7,2,3,8,0,10]:[12,19,24,31,36,7,0],v=[];for(a=0;a<k.length;a++)k[a]+=h;this.channelPatterns[c].forEach(function(c){p.write(e,c.instrument);
if(0<c.tones.length){p.write(1,1);var d=0;c.tones.forEach(function(b){b.start>d&&(p.write(2,0),p.writePartDuration(b.start-d));var c=new I(t);for(a=1;a<b.notes.length;a++)c.write(1,1);4>b.notes.length&&c.write(1,0);c.writePinCount(b.pins.length-1);c.write(2,b.pins[0].volume);var f=0,e=b.notes[0],g=e,h=[];for(a=1;a<b.pins.length;a++){var m=b.pins[a],r=e+m.interval;g!=r?(c.write(1,1),h.push(r),g=r):c.write(1,0);c.writePartDuration(m.time-f);f=m.time;c.write(2,m.volume)}f=c.toString();e=v.indexOf(f);
-1==e?(p.write(2,1),p.concat(c)):(p.write(1,1),p.writeLongTail(0,0,e),v.splice(e,1));v.unshift(f);10<v.length&&v.pop();c=b.notes.concat(h);for(a=0;a<c.length;a++){h=c[a];f=k.indexOf(h);if(-1==f){f=0;e=l;if(e<h)for(;e!=h;)e++,-1==k.indexOf(e)&&f++;else for(;e!=h;)e--,-1==k.indexOf(e)&&f--;p.write(1,0);p.writeNoteInterval(f)}else p.write(1,1),p.write(3,f),k.splice(f,1);k.unshift(h);8<k.length&&k.pop();l=a==b.notes.length-1?b.notes[0]:h}d=b.end},b);d<b.beats*b.parts&&(p.write(2,0),p.writePartDuration(b.beats*
b.parts-d))}else p.write(1,0)})}c=p.toString();for(var h=c.length,x="";0<h;)x=t[h&63]+x,h>>=6;g+=t[x.length];return g=g+x+c};d.prototype.fromString=function(b,c){void 0===c&&(c=!1);this.initToDefault(c);if(null!=b&&0!=b.length){"#"==b.charAt(0)&&(b=b.substring(1));var a=0,p=d._newBase64.indexOf(b.charAt(a++));if(!(-1==p||p>d._latestVersion||p<d._oldestVersion)){var g=3>p,t=4>p,p=5>p,h=g?d._oldBase64:d._newBase64;g&&(this.instrumentAttacks=[[0],[0],[0],[0]]);for(g&&(this.instrumentWaves=[[1],[1],[1],
[0]]);a<b.length;){var e=b.charAt(a++),q,k,v;if("s"==e)this.scale=h.indexOf(b.charAt(a++)),g&&10==this.scale&&(this.scale=11);else if("k"==e)this.key=h.indexOf(b.charAt(a++));else if("l"==e)this.loopStart=p?h.indexOf(b.charAt(a++)):(h.indexOf(b.charAt(a++))<<6)+h.indexOf(b.charAt(a++));else if("e"==e)this.loopLength=p?h.indexOf(b.charAt(a++)):(h.indexOf(b.charAt(a++))<<6)+h.indexOf(b.charAt(a++))+1;else if("t"==e)this.tempo=t?[1,4,7,10][h.indexOf(b.charAt(a++))]:h.indexOf(b.charAt(a++)),this.tempo=
Math.max(0,Math.min(f.tempoNames.length,this.tempo));else if("a"==e)this.beats=g?[6,7,8,9,10][h.indexOf(b.charAt(a++))]:h.indexOf(b.charAt(a++))+1,this.beats=Math.max(f.beatsMin,Math.min(f.beatsMax,this.beats));else if("g"==e)this.bars=(h.indexOf(b.charAt(a++))<<6)+h.indexOf(b.charAt(a++))+1,this.bars=Math.max(f.barsMin,Math.min(f.barsMax,this.bars));else if("j"==e)this.patterns=h.indexOf(b.charAt(a++))+1,this.patterns=Math.max(f.patternsMin,Math.min(f.patternsMax,this.patterns));else if("i"==e)this.instruments=
h.indexOf(b.charAt(a++))+1,this.instruments=Math.max(f.instrumentsMin,Math.min(f.instrumentsMax,this.instruments));else if("r"==e)this.parts=f.partCounts[h.indexOf(b.charAt(a++))];else if("w"==e)if(g)e=h.indexOf(b.charAt(a++)),this.instrumentWaves[e][0]=this._clip(0,f.waveNames.length,h.indexOf(b.charAt(a++)));else for(e=0;e<f.numChannels;e++)for(k=0;k<this.instruments;k++)this.instrumentWaves[e][k]=this._clip(0,f.waveNames.length,h.indexOf(b.charAt(a++)));else if("f"==e)if(g)e=h.indexOf(b.charAt(a++)),
this.instrumentFilters[e][0]=[0,2,3,5][this._clip(0,f.filterNames.length,h.indexOf(b.charAt(a++)))];else for(e=0;e<f.numChannels;e++)for(k=0;k<this.instruments;k++)this.instrumentFilters[e][k]=this._clip(0,f.filterNames.length,h.indexOf(b.charAt(a++)));else if("d"==e)if(g)e=h.indexOf(b.charAt(a++)),this.instrumentAttacks[e][0]=this._clip(0,f.attackNames.length,h.indexOf(b.charAt(a++)));else for(e=0;e<f.numChannels;e++)for(k=0;k<this.instruments;k++)this.instrumentAttacks[e][k]=this._clip(0,f.attackNames.length,
h.indexOf(b.charAt(a++)));else if("c"==e)if(g)e=h.indexOf(b.charAt(a++)),this.instrumentEffects[e][0]=this._clip(0,f.effectNames.length,h.indexOf(b.charAt(a++))),1==this.instrumentEffects[e][0]?this.instrumentEffects[e][0]=3:3==this.instrumentEffects[e][0]&&(this.instrumentEffects[e][0]=5);else for(e=0;e<f.numChannels;e++)for(k=0;k<this.instruments;k++)this.instrumentEffects[e][k]=this._clip(0,f.effectNames.length,h.indexOf(b.charAt(a++)));else if("h"==e)if(g)e=h.indexOf(b.charAt(a++)),this.instrumentChorus[e][0]=
this._clip(0,f.chorusNames.length,h.indexOf(b.charAt(a++)));else for(e=0;e<f.numChannels;e++)for(k=0;k<this.instruments;k++)this.instrumentChorus[e][k]=this._clip(0,f.chorusNames.length,h.indexOf(b.charAt(a++)));else if("v"==e)if(g)e=h.indexOf(b.charAt(a++)),this.instrumentVolumes[e][0]=this._clip(0,f.volumeNames.length,h.indexOf(b.charAt(a++)));else for(e=0;e<f.numChannels;e++)for(k=0;k<this.instruments;k++)this.instrumentVolumes[e][k]=this._clip(0,f.volumeNames.length,h.indexOf(b.charAt(a++)));
else if("o"==e)if(g)e=h.indexOf(b.charAt(a++)),this.channelOctaves[e]=this._clip(0,5,h.indexOf(b.charAt(a++)));else for(e=0;e<f.numChannels;e++)this.channelOctaves[e]=this._clip(0,5,h.indexOf(b.charAt(a++)));else if("b"==e){var x;if(g){var e=h.indexOf(b.charAt(a++)),r=h.indexOf(b.charAt(a++));x=Math.ceil(.5*r);q=new I(h);q.load(b.substr(a,x));for(k=0;k<r;k++)this.channelBars[e][k]=q.read(3)+1}else if(p){for(r=0;1<<r<this.patterns;)r++;q=new I(h);x=Math.ceil(f.numChannels*this.bars*r/6);q.load(b.substr(a,
x));for(e=0;e<f.numChannels;e++)for(k=0;k<this.bars;k++)this.channelBars[e][k]=q.read(r)+1}else{for(r=0;1<<r<this.patterns+1;)r++;q=new I(h);x=Math.ceil(f.numChannels*this.bars*r/6);q.load(b.substr(a,x));for(e=0;e<f.numChannels;e++)for(k=0;k<this.bars;k++)this.channelBars[e][k]=q.read(r)}a+=x}else if("p"==e){k=0;if(g)e=h.indexOf(b.charAt(a++)),h.indexOf(b.charAt(a++)),k=h.indexOf(b.charAt(a++)),k<<=6,k+=h.indexOf(b.charAt(a++));else for(e=0,q=h.indexOf(b.charAt(a++));0<q;)k<<=6,k+=h.indexOf(b.charAt(a++)),
q--;q=new I(h);q.load(b.substr(a,k));a+=k;if(!c){for(x=0;1<<x<this.instruments;)x++;for(;;){this.channelPatterns[e]=[];var w=3==e?0:12*this.channelOctaves[e],F=null,Wa=null,C=(3==e?4:12)+w,r=3==e?[4,6,7,2,3,8,0,10]:[12,19,24,31,36,7,0],Q=[];for(k=0;k<r.length;k++)r[k]+=w;for(k=0;k<this.patterns;k++)if(w=new l,w.instrument=q.read(x),this.channelPatterns[e][k]=w,g||0!=q.read(1)){for(var A=0,Xa=[];A<this.beats*this.parts;){var m=1==q.read(1),J=!1;v=0;m?v=q.readLongTail(0,0):J=1==q.read(1);if(m||J){if(m)m=
Q[v],Q.splice(v,1);else{for(m={noteCount:1};4>m.noteCount&&1==q.read(1);)m.noteCount++;m.pinCount=q.readPinCount();m.initialVolume=q.read(2);m.pins=[];m.length=0;for(v=m.bendCount=0;v<m.pinCount;v++)J={},J.pitchBend=1==q.read(1),J.pitchBend&&m.bendCount++,m.length+=q.readPartDuration(),J.time=m.length,J.volume=q.read(2),m.pins.push(J)}Q.unshift(m);10<Q.length&&Q.pop();F=new ia(0,A,A+m.length,m.initialVolume);F.notes=[];F.pins.length=1;var Z=[];for(v=0;v<m.noteCount+m.bendCount;v++){if(1!=q.read(1)){for(A=
q.readNoteInterval();0<A;){for(C++;-1!=r.indexOf(C);)C++;A--}for(;0>A;){for(C--;-1!=r.indexOf(C);)C--;A++}}else A=q.read(3),C=r[A],r.splice(A,1);r.unshift(C);8<r.length&&r.pop();v<m.noteCount?F.notes.push(C):Z.push(C);C=v==m.noteCount-1?F.notes[0]:C}Z.unshift(F.notes[0]);m.pins.forEach(function(a){a.pitchBend&&Z.shift();Wa=new P(Z[0]-F.notes[0],a.time,a.volume);F.pins.push(Wa)});A=F.end;Xa.push(F)}else m=q.readPartDuration(),A+=m}w.tones=Xa}if(g)break;else if(e++,e>=f.numChannels)break}}}}}}};d.prototype._clip=
function(b,c,a){--c;return a<=c?a>=b?a:b:c};d.prototype.getPattern=function(b,c){var a=this.channelBars[b][c];return 0==a?null:this.channelPatterns[b][a-1]};d.prototype.getPatternInstrument=function(b,c){var a=this.getPattern(b,c);return null==a?0:a.instrument};d._oldestVersion=2;d._latestVersion=5;d._oldBase64="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ._".split("");d._newBase64="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_".split("");return d}();w.Song=R;
var Va=function(){function d(b){void 0===b&&(b=null);this.samplesPerSecond=44100;this._effectDuration=.14;this._effectAngle=2*Math.PI/(this._effectDuration*this.samplesPerSecond);this._effectYMult=2*Math.cos(this._effectAngle);this._limitDecay=1/(2*this.samplesPerSecond);this._waves=[new Float64Array([1/15,.2,5/15,7/15,.6,11/15,13/15,1,1,13/15,11/15,.6,7/15,5/15,.2,1/15,-1/15,-.2,-5/15,-7/15,-.6,-11/15,-13/15,-1,-1,-13/15,-11/15,-.6,-7/15,-5/15,-.2,-1/15]),new Float64Array([1,-1]),new Float64Array([1,
-1,-1,-1]),new Float64Array([1,-1,-1,-1,-1,-1,-1,-1]),new Float64Array([1/31,3/31,5/31,7/31,9/31,11/31,13/31,15/31,17/31,19/31,21/31,23/31,25/31,27/31,29/31,1,-1,-29/31,-27/31,-25/31,-23/31,-21/31,-19/31,-17/31,-15/31,-13/31,-11/31,-9/31,-7/31,-5/31,-3/31,-1/31]),new Float64Array([0,-.2,-.4,-.6,-.8,-1,1,-.8,-.6,-.4,-.2,1,.8,.6,.4,.2]),new Float64Array([1,1,1,1,1,-1,-1,-1,1,1,1,1,-1,-1,-1,-1]),new Float64Array([1,-1,1,-1,1,0]),new Float64Array([0,.2,.4,.5,.6,.7,.8,.85,.9,.95,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,.95,.9,.85,.8,.7,.6,.5,.4,.2,0,-.2,-.4,-.5,-.6,-.7,-.8,-.85,-.9,-.95,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-.95,-.9,-.85,-.8,-.7,-.6,-.5,-.4,-.2])];this._drumWaves=[new Float64Array(32767),new Float64Array(32767)];this.song=null;this.pianoPressed=this.stutterPressed=!1;this.pianoChannel=this.pianoNote=0;this.enableIntro=!0;this.enableOutro=!1;this.loopCount=-1;this.volume=1;this._arpeggioSamples=this._arpeggio=this._part=this._beat=this._bar=this._playhead=0;this._paused=!0;this._drumSample=this._drumPeriod=
this._bassSample=this._bassPeriodB=this._bassPeriodA=this._harmonySample=this._harmonyPeriodB=this._harmonyPeriodA=this._leadSample=this._leadPeriodB=this._leadPeriodA=0;this._drumSignal=1;this._stillGoing=!1;this._limit=this._effectPeriod=0;var c;this._waves.forEach(function(a){var b=0;for(c=0;c<a.length;c++)b+=a[c];b/=a.length;for(c=0;c<a.length;c++)a[c]-=b});this._drumWaves.forEach(function(a,b){if(0==b){var d=1;for(c=0;32767>c;c++){a[c]=2*(d&1)-1;var f=d>>1;1==(d+f&1)&&(f+=16384);d=f}}else if(1==
b)for(c=0;32767>c;c++)a[c]=2*Math.random()-1});null!=b&&this.setSong(b)}Object.defineProperty(d.prototype,"playing",{get:function(){return!this._paused},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"playhead",{get:function(){return this._playhead},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"totalSamples",{get:function(){if(null==this.song)return 0;var b=4*this._getSamplesPerArpeggio()*this.song.parts*this.song.beats,c=this.loopCount;0>c&&(c=1);c*=this.song.loopLength;
this.enableIntro&&(c+=this.song.loopStart);this.enableOutro&&(c+=this.song.bars-(this.song.loopStart+this.song.loopLength));return c*b},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"totalSeconds",{get:function(){return this.totalSamples/this.samplesPerSecond},enumerable:!0,configurable:!0});Object.defineProperty(d.prototype,"totalBars",{get:function(){return null==this.song?0:this.song.bars},enumerable:!0,configurable:!0});d.prototype.setSong=function(b){"string"==typeof b?this.song=
new R(b):b instanceof R&&(this.song=b)};d.prototype.play=function(){if(this._paused){this._paused=!1;var b=window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.oAudioContext||window.msAudioContext;this._audioCtx=this._audioCtx||new b;this._scriptNode=this._audioCtx.createScriptProcessor?this._audioCtx.createScriptProcessor(2048,0,1):this._audioCtx.createJavaScriptNode(2048,0,1);this._scriptNode.onaudioprocess=this._onSampleData.bind(this);this._scriptNode.channelCountMode=
"explicit";this._scriptNode.channelInterpretation="speakers";this._scriptNode.connect(this._audioCtx.destination);this.samplesPerSecond=this._audioCtx.sampleRate;this._effectAngle=2*Math.PI/(this._effectDuration*this.samplesPerSecond);this._effectYMult=2*Math.cos(this._effectAngle);this._limitDecay=1/(2*this.samplesPerSecond)}};d.prototype.pause=function(){this._paused||(this._paused=!0,this._scriptNode.disconnect(this._audioCtx.destination),this._audioCtx.close&&(this._audioCtx.close(),this._audioCtx=
null),this._scriptNode=null)};d.prototype.snapToStart=function(){this._bar=0;this.enableIntro=!0;this.snapToBar()};d.prototype.snapToBar=function(){this._playhead=this._bar;this._effectPeriod=this._arpeggioSamples=this._arpeggio=this._part=this._beat=0};d.prototype.nextBar=function(){var b=this._bar;this._bar++;this._bar>=this.song.bars&&(this._bar=this.song.loopStart);if(this._bar>=this.song.loopStart+this.song.loopLength||this._bar>=this.song.bars)this._bar=this.song.loopStart;this._playhead+=this._bar-
b};d.prototype.prevBar=function(){var b=this._bar;this._bar--;0>this._bar&&(this._bar=this.song.bars-1);this._bar<this.song.loopStart&&(this.enableIntro=!0);if(this._bar>=this.song.loopStart+this.song.loopLength||this._bar>=this.song.bars)this._bar=this.song.loopStart+this.song.loopLength-1;this._playhead+=this._bar-b};d.prototype._onSampleData=function(b){b=b.outputBuffer;var c=b.getChannelData(0);this.synthesize(c,b.length)};d.prototype.synthesize=function(b,c){var a=this,d=0,g;if(this.stutterPressed){var l=
this._bar,h=this._beat,e=this._part,q=this._arpeggio,k=this._arpeggioSamples,v=this._leadPeriodA,x=this._leadPeriodB,r=this._leadSample,w=this._harmonyPeriodA,F=this._harmonyPeriodB,I=this._harmonySample,C=this._bassPeriodA,Q=this._bassPeriodB,A=this._bassSample,P=this._drumPeriod,m=this._drumSample,J=this._drumSignal,Z=this._effectPeriod,ia=this._limit;g=function(){a._bar=l;a._beat=h;a._part=e;a._arpeggio=q;a._arpeggioSamples=k;a._leadPeriodA=v;a._leadPeriodB=x;a._leadSample=r;a._harmonyPeriodA=
w;a._harmonyPeriodB=F;a._harmonySample=I;a._bassPeriodA=C;a._bassPeriodB=Q;a._bassSample=A;a._drumPeriod=P;a._drumSample=m;a._drumSignal=J;a._effectPeriod=Z;a._limit=ia}}var D,oa=1/this.samplesPerSecond,H=this._getSamplesPerArpeggio();if(null==this.song)for(D=0;D<c;D++)b[D]=0;else{if(0==this._arpeggioSamples||this._arpeggioSamples>H)this._arpeggioSamples=H;this._part>=this.song.parts&&(this._beat++,this._arpeggio=this._part=0,this._arpeggioSamples=H);this._beat>=this.song.beats&&(this._bar++,this._arpeggio=
this._part=this._beat=0,this._arpeggioSamples=H,-1==this.loopCount&&(this._bar<this.song.loopStart&&!this.enableIntro&&(this._bar=this.song.loopStart),this._bar>=this.song.loopStart+this.song.loopLength&&!this.enableOutro&&(this._bar=this.song.loopStart)));this._bar>=this.song.bars&&(this._bar=this.song.loopStart,this.enableOutro=!1);this._bar>=this.song.loopStart&&(this.enableIntro=!1);var R,Ha,Ia,Ja,pa,qa,ra,Ya,Ka,La,Ma,Za,$a,ab,sa,bb,cb,db,eb,fb,gb,hb,ib,jb,kb=function(){var b=a.song.getPatternInstrument(0,
a._bar),c=a.song.getPatternInstrument(1,a._bar),d=a.song.getPatternInstrument(2,a._bar),e=a.song.getPatternInstrument(3,a._bar);R=f.channelVolumes[0]*(5==a.song.instrumentVolumes[0][b]?0:Math.pow(2,-f.volumeValues[a.song.instrumentVolumes[0][b]]))*f.waveVolumes[a.song.instrumentWaves[0][b]]*f.filterVolumes[a.song.instrumentFilters[0][b]]*f.chorusVolumes[a.song.instrumentChorus[0][b]]*.5;Ha=f.channelVolumes[1]*(5==a.song.instrumentVolumes[1][c]?0:Math.pow(2,-f.volumeValues[a.song.instrumentVolumes[1][c]]))*
f.waveVolumes[a.song.instrumentWaves[1][c]]*f.filterVolumes[a.song.instrumentFilters[1][c]]*f.chorusVolumes[a.song.instrumentChorus[0][c]]*.5;Ia=f.channelVolumes[2]*(5==a.song.instrumentVolumes[2][d]?0:Math.pow(2,-f.volumeValues[a.song.instrumentVolumes[2][d]]))*f.waveVolumes[a.song.instrumentWaves[2][d]]*f.filterVolumes[a.song.instrumentFilters[2][d]]*f.chorusVolumes[a.song.instrumentChorus[0][d]]*.5;Ja=f.channelVolumes[3]*(5==a.song.instrumentVolumes[3][e]?0:Math.pow(2,-f.volumeValues[a.song.instrumentVolumes[3][e]]))*
f.drumVolumes[a.song.instrumentWaves[3][e]];pa=a._waves[a.song.instrumentWaves[0][b]];qa=a._waves[a.song.instrumentWaves[1][c]];ra=a._waves[a.song.instrumentWaves[2][d]];Ya=a._drumWaves[a.song.instrumentWaves[3][e]];Ka=pa.length;La=qa.length;Ma=ra.length;Za=Math.pow(2,-f.filterBases[a.song.instrumentFilters[0][b]]);$a=Math.pow(2,-f.filterBases[a.song.instrumentFilters[1][c]]);ab=Math.pow(2,-f.filterBases[a.song.instrumentFilters[2][d]]);sa=1;bb=f.effectTremelos[a.song.instrumentEffects[0][b]];cb=
f.effectTremelos[a.song.instrumentEffects[1][c]];db=f.effectTremelos[a.song.instrumentEffects[2][d]];eb=Math.pow(2,(f.chorusOffsets[a.song.instrumentChorus[0][b]]+f.chorusValues[a.song.instrumentChorus[0][b]])/12);fb=Math.pow(2,(f.chorusOffsets[a.song.instrumentChorus[1][c]]+f.chorusValues[a.song.instrumentChorus[1][c]])/12);gb=Math.pow(2,(f.chorusOffsets[a.song.instrumentChorus[2][d]]+f.chorusValues[a.song.instrumentChorus[2][d]])/12);hb=Math.pow(2,(f.chorusOffsets[a.song.instrumentChorus[0][b]]-
f.chorusValues[a.song.instrumentChorus[0][b]])/12);ib=Math.pow(2,(f.chorusOffsets[a.song.instrumentChorus[1][c]]-f.chorusValues[a.song.instrumentChorus[1][c]])/12);jb=Math.pow(2,(f.chorusOffsets[a.song.instrumentChorus[2][d]]-f.chorusValues[a.song.instrumentChorus[2][d]])/12);0==a.song.instrumentChorus[0][b]&&(a._leadPeriodB=a._leadPeriodA);0==a.song.instrumentChorus[1][c]&&(a._harmonyPeriodB=a._harmonyPeriodA);0==a.song.instrumentChorus[2][d]&&(a._bassPeriodB=a._bassPeriodA)};for(kb();0<c;){var K;
K=this._arpeggioSamples<=c?this._arpeggioSamples:c;c-=K;this._arpeggioSamples-=K;for(var ja,lb,ta,mb,ua,nb,ob,ka,pb,va,qb,wa,rb,sb,la,tb,xa,ub,ya,vb,wb,za,xb,Aa,yb,L=this._part+this._beat*this.song.parts,y=0;4>y;y++){var z=this.song.getPattern(y,this._bar),aa=null==z?0:this.song.instrumentAttacks[y][z.instrument],u=null,E=null,M=null;if(null!=z)for(D=0;D<z.tones.length;D++)if(z.tones[D].end<=L)E=z.tones[D];else if(z.tones[D].start<=L&&z.tones[D].end>L)u=z.tones[D];else if(z.tones[D].start>L){M=z.tones[D];
break}null!=u&&null!=E&&E.end!=u.start&&(E=null);null!=u&&null!=M&&M.start!=u.end&&(M=null);var Na=3==y?69:f.keyTransposes[this.song.key],ba=3==y?f.drumInterval:1,S,T,U,V,W,ca,da,ma=!1;if(this.pianoPressed&&y==this.pianoChannel){var zb=this._frequencyFromPitch(Na+this.pianoNote*ba),Ba;3==y?0<this.song.instrumentWaves[3][z.instrument]?(sa=Math.min(1,zb*oa*8),Ba=24):Ba=60:Ba=48;S=zb*oa;T=1;U=Math.pow(2,-this.pianoNote*ba/Ba);V=0;ca=W=1;da=Math.pow(2,f.effectVibratos[this.song.instrumentEffects[y][z.instrument]]/
12)-1}else if(null==u)V=U=T=S=0,ca=W=1,da=0,ma=!0;else{var X;X=2==u.notes.length?u.notes[this._arpeggio>>1]:3==u.notes.length?u.notes[3==this._arpeggio?1:this._arpeggio]:4==u.notes.length?u.notes[this._arpeggio]:u.notes[0];var N=null,O=null;u.pins.every(function(a){if(a.time+u.start<=L)N=a;else return O=a,!1;return!0},this);var Ab=4*u.start,Va=4*u.end,Ca=4*(u.start+N.time),Bb=4*(u.start+O.time),Oa=4*L+this._arpeggio,Cb=4*L+this._arpeggio+1,ea=(Oa-Ca)/(Bb-Ca),fa=(Cb-Ca)/(Bb-Ca),ga=N.volume*(1-ea)+
O.volume*ea,Da=N.volume*(1-fa)+O.volume*fa,Pa=N.interval*(1-ea)+O.interval*ea,Qa=N.interval*(1-fa)+O.interval*fa,Ra=N.time*(1-ea)+O.time*ea,Ea=N.time*(1-fa)+O.time*fa,Sa=!1;Oa==Ab&&(0==aa?Sa=!0:2==aa?ga=0:3==aa&&(null==E||1<E.notes.length||1<u.notes.length?ga=0:0==E.pins[E.pins.length-1].volume||0==u.pins[0].volume?ga=0:(Pa=.5*(E.notes[0]+E.pins[E.pins.length-1].interval-X),Ra=.5*E.pins[E.pins.length-1].time,Sa=!0)));Cb==Va&&(1==aa||2==aa?Da=0:3==aa&&(null==M||1<M.notes.length||1<u.notes.length?Da=
0:0==u.pins[u.pins.length-1].volume||0==M.pins[0].volume?ga=0:(Qa=.5*(M.notes[0]+u.pins[u.pins.length-1].interval-X),Ea*=.5)));var Y=1-(this._arpeggioSamples+K)/H,ha=1-this._arpeggioSamples/H,Db=Pa*(1-Y)+Qa*Y,Eb=Pa*(1-ha)+Qa*ha,Kb=Ra*(1-Y)+Ea*Y,Lb=Ra*(1-ha)+Ea*ha,Ta=this._frequencyFromPitch(Na+(X+Db)*ba),Mb=this._frequencyFromPitch(Na+(X+Eb)*ba),na;3==y?0<this.song.instrumentWaves[3][z.instrument]?(sa=Math.min(1,Ta*oa*8),na=24):na=60:na=48;var Fa=Math.pow(2,-(X+Db)*ba/na),Ua=Math.pow(2,-(X+Eb)*ba/
na),Fa=Fa*this._volumeConversion(ga*(1-Y)+Da*Y),Ua=Ua*this._volumeConversion(ga*(1-ha)+Da*ha),Nb=Mb/Ta;S=Ta*oa;T=Math.pow(Nb,1/K);U=Fa;V=(Ua-Fa)/K;0!=(Oa+Y-Ab)*H/this.samplesPerSecond||Sa||(ma=!0);var Fb=f.filterDecays[this.song.instrumentFilters[y][z.instrument]];W=Math.pow(2,-Fb*Kb*4*H/this.samplesPerSecond);ca=Math.pow(Math.pow(2,-Fb*Lb*4*H/this.samplesPerSecond)/W,1/K);da=2==this.song.instrumentEffects[y][z.instrument]&&3>L-u.start?0:Math.pow(2,f.effectVibratos[this.song.instrumentEffects[y][z.instrument]]/
12)-1}0==y?(ja=S,lb=T,ta=U*R,mb=V*R,ua=W*Za,nb=ca,ob=da,ma&&(this._leadPeriodB=this._leadPeriodA=this._leadSample=0)):1==y?(ka=S,pb=T,va=U*Ha,qb=V*Ha,wa=W*$a,rb=ca,sb=da,ma&&(this._harmonyPeriodB=this._harmonyPeriodA=this._harmonySample=0)):2==y?(la=S,tb=T,xa=U*Ia,ub=V*Ia,ya=W*ab,vb=ca,wb=da,ma&&(this._bassPeriodB=this._bassPeriodA=this._bassSample=0)):3==y&&(za=S/32767,xb=T,Aa=U*Ja,yb=V*Ja)}for(var G=Math.sin(this._effectPeriod),Ga=Math.sin(this._effectPeriod-this._effectAngle);0<K;){var B=0,Gb=
1+ob*G,Hb=1+sb*G,Ib=1+wb*G,Ob=1+bb*(G-1),Pb=1+cb*(G-1),Qb=1+db*(G-1),Rb=G,G=this._effectYMult*G-Ga,Ga=Rb;this._leadSample+=((pa[Math.floor(this._leadPeriodA*Ka)]+pa[Math.floor(this._leadPeriodB*Ka)])*ta*Ob-this._leadSample)*ua;ta+=mb;this._leadPeriodA+=ja*Gb*eb;this._leadPeriodB+=ja*Gb*hb;ja*=lb;this._leadPeriodA-=Math.floor(this._leadPeriodA);this._leadPeriodB-=Math.floor(this._leadPeriodB);ua*=nb;B+=this._leadSample;this._harmonySample+=((qa[Math.floor(this._harmonyPeriodA*La)]+qa[Math.floor(this._harmonyPeriodB*
La)])*va*Pb-this._harmonySample)*wa;va+=qb;this._harmonyPeriodA+=ka*Hb*fb;this._harmonyPeriodB+=ka*Hb*ib;ka*=pb;this._harmonyPeriodA-=Math.floor(this._harmonyPeriodA);this._harmonyPeriodB-=Math.floor(this._harmonyPeriodB);wa*=rb;B+=this._harmonySample;this._bassSample+=((ra[Math.floor(this._bassPeriodA*Ma)]+ra[Math.floor(this._bassPeriodB*Ma)])*xa*Qb-this._bassSample)*ya;xa+=ub;this._bassPeriodA+=la*Ib*gb;this._bassPeriodB+=la*Ib*jb;la*=tb;this._bassPeriodA-=Math.floor(this._bassPeriodA);this._bassPeriodB-=
Math.floor(this._bassPeriodB);ya*=vb;B+=this._bassSample;this._drumSample+=(Ya[Math.floor(32767*this._drumPeriod)]*Aa-this._drumSample)*sa;Aa+=yb;this._drumPeriod+=za;za*=xb;this._drumPeriod-=Math.floor(this._drumPeriod);var B=B+this._drumSample,Jb=0>B?-B:B;this._limit-=this._limitDecay;this._limit<Jb&&(this._limit=Jb);B/=.75*this._limit+.25;B*=this.volume;b[d]=B;d+=1;K--}this._effectPeriod=this._effectYMult*G-Ga>Ga?Math.asin(G):Math.PI-Math.asin(G);0==this._arpeggioSamples&&(this._arpeggio++,this._arpeggioSamples=
H,4==this._arpeggio&&(this._arpeggio=0,this._part++,this._part==this.song.parts&&(this._part=0,this._beat++,this._beat==this.song.beats&&(this._effectPeriod=this._beat=0,this._bar++,this._bar<this.song.loopStart?this.enableIntro||(this._bar=this.song.loopStart):this.enableIntro=!1,this._bar>=this.song.loopStart+this.song.loopLength&&(0<this.loopCount&&this.loopCount--,0!=this.loopCount&&(this._bar=this.song.loopStart)),this._bar>=this.song.bars&&(this._bar=this.song.loopStart,this.enableOutro=!1),
kb()))))}this.stutterPressed&&g();this._playhead=(((this._arpeggio+1-this._arpeggioSamples/H)/4+this._part)/this.song.parts+this._beat)/this.song.beats+this._bar}};d.prototype._frequencyFromPitch=function(b){return 440*Math.pow(2,(b-69)/12)};d.prototype._volumeConversion=function(b){return Math.pow(b/3,1.5)};d.prototype._getSamplesPerArpeggio=function(){return null==this.song?0:Math.floor(this.samplesPerSecond/(120*Math.pow(2,(-4+this.song.tempo)/9)/60*this.song.parts*4))};return d}();w.Synth=Va})(beepbox||
(beepbox={}));
</script>
<canvas id="myCanvas" width="600" height="600" style="border:1px solid #d3d3d3;"/>
<img id="boss" width="0" height="0" src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAAgCAYAAACVf3P1AAACqElEQVR4Xu2YYW7DMAiFW+1s08487WxTp3Sz5DJseIAdt6a/GgXzePAlcXK95C87cGIHridqp3R24OIF8PbXQ28e6yhG6x/5e940+lIOq/djnUbfk19a69a3gnMX/vh6uxf4+f5dCrXmk4zS8zP0e+Cg+tEQovpof6X4MH0EGEp7Oabwua+KhvuZ+pwHj35ETzz6ElCa80P0tQDWVzD9fxRf8rTiNAZ7MTP1W/C1PGr9eyCc6Z+bwzB9LYDsI5Cp1JoPBZTefaO3ANIj06Iv5UR6YNFH8kuxYfoWYG5070eOLTklw/X5Gfrd/Z/RfxSAM/x3n0ZG/2xOBJZ/1DMvIbUIklsD4Gx9CoxHPwI+j76mv1LMEH0tJA/iwhUwAsKz9As4Hv1w+F6p/xoAm+TTS6b6HBMJYeqTRhcAX6H/JgAP47QJDfjqN0TpFt86z254U//3G2z5PWv/JQC5Ty4FKroZPnLVsHCfLVAIz9Z/ePmpDu5emZcvzj/qmWrWfSznEH3PFmB4/yUAD8Otb0DlHL3L9eKRYXCNa70Y1D4065A6WkBo/Ft1ehBSr73+lzwWCDV9LBdcq/+iLgog2lCxgEZC67pefSNyov2wxEfVjeRBYl09TwAtSMxdMw2GytY0TQlA7haLtN+y3rJGU9OovBpta0xkzdpc2jiNJzGXBGBrnxMi3kkiFq4pgFzRdK8EpjgtPKIXaA40nmuOKocGwAKhNtaz8e1t+D0ERD1SPDV41nrrt6y3rIHnh0CFFITEujaxiqlG1aKQGhpi9WFdZ73xQOsQAId2N5Pv2YEEcM+5L+M6AVxmFHsWkgDuOfdlXCeAy4xiz0ISwD3nvozrBHCZUexZSAK459yXcZ0ALjOKPQtJAPec+zKuE8BlRrFnIQngnnNfxvUPDTJFMNinF1wAAAAASUVORK5CYIIA'/>
<img id="norm" width="0" height="0" src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAaAAAAAgCAYAAABU8aw1AAADQ0lEQVR4Xu3d4W7DIAxG0e79H3pTtCEhCxKbYD6G7n6uaY2PHUwqTfv68IMAAggggIBA4EsQk5AIIIAAAgh8GEA0AQIIIICARIABJGEnKAIIIIAAA4geQAABBBCQCDCAJOwERQABBBBgANEDCCCAAAISAQaQhJ2gCCCAAAIMIHoAAQQQQEAiwACSsBMUAQQQQIABRA8ggAACCEgERgfQ9+fT/CPW3u9nJ6eOf+VzraH+GbUctVHHrw1W517MioEq/mjteB8CCHSGiBfGDoEVw6eOcRc/ay120+9ZZW2I6vh1vuoBqIzfq0NW3e/uyaxe9+wDtYMi93IIUsWuD0KKNShrPyX3UbS7jXD0M70Nf33+U/yMwng3/5LHbAd1/Lvhk5VzrydUA8Bbg9m19zisimnXknGvefaCKRtgJFDnWvJvfxvmoh1p2vprD3sCyv5KpBfvStYOppHcnk6adqO1+WaeCFufvTJ+62uvVi/Mdm9teLbede2z4nuHz8phnNlvrg3k7zCYZe5Zg3IAKGPbA6GqBq8MoouO3ITRz/Y2m+e6skF5r/VcF8n9xPh2APXMMuruefrK3Ph7g9bze09vea+J9GB2HXgC+RV4tQF7C39z3b+OH23SkqziKzDvBpix+fc2wOK3+iTae/KJ1nO0/20flCeQVfHtjZ95E0Y2/ZbnLJORdcyKfdcnmfZP/bn6vuutR2Wgijvt6SvaoPXG03rv0+tPDeV9vQefXZCnjd++7s0nct3qU7dd251xtr89dVuLaD+PuNcHnF4/ZByCGEDtaq3qud2GzxFPoG9u2N5GGLmpR659arin10ditp6ArF328PF+vve6Nw4t42z31vCpn0BXPIV5cvRcM2K/6wAayeWU92TVOuqzyzqi6+Yf0oXFeAMCGgEGkMadqIkCb56AEpfFRyOAAAIInC7AADq9wuSHAAIIbCrAANq0MCwLAQQQOF2AAXR6hckPAQQQ2FSAAbRpYVgWAgggcLoAA+j0CpMfAgggsKkAA2jTwrAsBBBA4HQBBtDpFSY/BBBAYFMBBtCmhWFZCCCAwOkCDKDTK0x+CCCAwKYCDKBNC8OyEEAAgdMFGECnV5j8EEAAgU0FfgBfnZQh2vgnDwAAAABJRU5ErkJgggAA'/>
<video autoplay="true" id="song" width="0" height="0" loop=""><source src="http://audio.ngfiles.com/449000/449117_8_bit_Final_Stage_Part_2__.mp3" type="audio/mpeg"></video>
<script>
function math_random_int(b,d){if(b>d){var a=b;b=d;d=a}return Math.floor(Math.random()*(d-b+1)+b)}var n=0;function M(b){return b}function centerIMG(b,d,a,e,f,g,h){c=document.getElementById("myCanvas");ctx=c.getContext("2d");void 0!==g?ctx.drawImage(b,d-g/2,a-h/2,e,f):ctx.drawImage(b,d-e/2,a-f/2)}function newframe(){c=document.getElementById("myCanvas");ctx=c.getContext("2d");ctx.fillStyle="#ffffff";ctx.fillRect(0,0,600,600);test=[!1,!1,!1]}
function imgDataToDataURL(b){var d=document.createElement("canvas");d.width=d.height=100;d.getContext("2d").putImageData(b,0,0);return d.toDataURL()}function dataURLtoImg(b){var d=new Image;d.src=b;return d}function w2t(b){for(var d=b.data,a=0;a<d.length;a+=4)255==d[a+0]&&255==d[a+1]&&255==d[a+2]&&(d[a+3]=0,d[a+1]=0,d[a+0]=0,d[a+2]=0);b.data=d;d=new Image;d.src=imgDataToDataURL(b);return d}
var song3=document.getElementById("song").pause(),song4=new beepbox.Synth("5sbk8l00e06t0a7g0fj7i0r0w1111f0000d1111c0000h0000v0200o3210b4x974h4h4h4i4B014h4h4h0hw34h4h4h0x8Rsh4h4h4p25TIN-5j31OwY2OFpxS6VzS9up-VjC7oyrSfCXKi7Hc_gKpLLbcJ0eg1I3A0HgU6WVwckOP0NdhPb1iluOYi4oc2PmK766Fiu1-MXCG4hM6QFeZw0B7Icf_msNQ54DItgiwv7IQ74ncf0MK0F1QlcldXDx885dj7orWqqkMMF2D4aqo3bOtJJtdldldldl9yChFM43cdcjbB87q0P7Jk4wC2x40FzZ1kMlc5jnjj8SbcuH1ox0V1oPb3kx5qXPkgig2oo0geoUqo8dGF53AfcTaIHwo2C1cjwg0agkwF1i2Q5eGBc2sD9OsD9OsD9OsD9FwpyhUcWDoFF1i2C118kR0GGFFAoaX00g082A5oa21SaWGMkwH1j0g5U0"),INV=
1,gameover=0,phealth=5,*=0,requsests=[],maxrequsests=1,lxy=[1,50],shot=0,test=[!1,!1,!1],center=[],length=[],c=document.getElementById("myCanvas"),ctx=c.getContext("2d"),img1=document.getElementById("boss"),img2=document.getElementById("norm");ctx.drawImage(img1,0,0,560,112);var graphics=[w2t(ctx.getImageData(0,0,112,112)),w2t(ctx.getImageData(112,0,224,112)),w2t(ctx.getImageData(224,0,336,112)),w2t(ctx.getImageData(336,0,448,112)),w2t(ctx.getImageData(448,0,560,112))];newframe();
ctx.drawImage(img2,0,0);var game=[w2t(ctx.getImageData(0,0,32,32)),w2t(ctx.getImageData(32,0,32,32)),w2t(ctx.getImageData(64,0,32,32)),w2t(ctx.getImageData(96,0,32,32)),w2t(ctx.getImageData(128,0,32,32)),w2t(ctx.getImageData(160,0,32,32)),w2t(ctx.getImageData(192,0,32,32)),w2t(ctx.getImageData(224,0,32,32)),w2t(ctx.getImageData(256,0,32,32)),w2t(ctx.getImageData(288,0,32,32)),w2t(ctx.getImageData(320,0,32,32)),w2t(ctx.getImageData(352,0,32,32)),w2t(ctx.getImageData(384,0,32,32))];newframe();
var level={create:function(b,d){for(var a=[],e=0,f=0;d>=f;){for(a.push(["E"]);e<b;)e++,a[a.length-1].push("E");f++;e=0}return a},arraymove:function(b,d){if(1==b)for(var a=0;a<d.length;)d[a].unshift(d[a].pop()),a++;else if(2==b)for(a=0;a<d.length;)d[a].push(d[a].shift()),a++;else d.unshift(d.pop());return d},updatecomponents:function(b,d,a){INV=0;"array"==typeof a&&alert("test");for(var e=0,f=0;e<b.length-1;){for(;f<b[1].length-1;)"E"!=b[e][f]&&(INV++,11==f&&(test[2]=!0),1==f&&(test[1]=!0),17==e&&
(test[0]=!0,phealth=0),"1"==b[e][f][0]?(1==d?1==b[e][f][2]?(centerIMG(game[0],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256),b[e][f][2]=2):(centerIMG(game[1],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256),b[e][f][2]=1):1==b[e][f][2]?centerIMG(game[0],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256):centerIMG(game[1],M(f*M(M(center[0]/
2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256),25==math_random_int(20,60)&&1!==d&&lazer.makeR(M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),2,e),a[0]<M(f*M(M(center[0]/2)+length[0])-length[0])+25&&a[0]>M(f*M(M(center[0]/2)+length[0])-length[0])-25&&a[1]<M(e*M(M(center[1]/2)+length[1])-length[0])+25&&a[1]>M(e*M(M(center[1]/2)+length[1])-length[1])-25&&(shot=1,--b[e][f][1],0<=b[e][f][1]&&(b[e][f]="E"))):"2"==b[e][f][0]?(1==
d?1==b[e][f][2]?(centerIMG(game[3],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256),b[e][f][2]=2):(centerIMG(game[2],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256),b[e][f][2]=1):1==b[e][f][2]?centerIMG(game[3],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256):centerIMG(game[2],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/
2)+length[1])-length[1]),256,256,256,256),25==math_random_int(20,50)&&1!==d&&lazer.makeR(M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),1,e),a[0]<M(f*M(M(center[0]/2)+length[0])-length[0])+25&&a[0]>M(f*M(M(center[0]/2)+length[0])-length[0])-25&&a[1]<M(e*M(M(center[1]/2)+length[1])-length[0])+25&&a[1]>M(e*M(M(center[1]/2)+length[1])-length[1])-25&&(shot=1,--b[e][f][1],0<=b[e][f][1]&&(b[e][f]="E"))):"3"==b[e][f][0]&&(1==d?1==b[e][f][2]?(centerIMG(game[4],M(f*M(M(center[0]/
2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256),b[e][f][2]=2):(centerIMG(game[5],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256),b[e][f][2]=1):1==b[e][f][2]?centerIMG(game[4],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256):centerIMG(game[5],M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),256,256,256,256),25==math_random_int(20,
70)&&1!==d&&lazer.makeR(M(f*M(M(center[0]/2)+length[0])-length[0]),M(e*M(M(center[1]/2)+length[1])-length[1]),math_random_int(1,2),e),a[0]<M(f*M(M(center[0]/2)+length[0])-length[0])+25&&a[0]>M(f*M(M(center[0]/2)+length[0])-length[0])-25&&a[1]<M(e*M(M(center[1]/2)+length[1])-length[0])+25&&a[1]>M(e*M(M(center[1]/2)+length[1])-length[1])-25&&(shot=1,--b[e][f][1],0<=b[e][f][1]&&(b[e][f]="E")))),f++;f=0;e++}return b},add:function(b,d){d[b[0]][b[1]]=[b[2],b[3],b[4]];return d},setcenterAndLength:function(b,
d){center=[b[0],b[1]];length=[d[0],d[1]]}},CRETURE={_1:function(b,d,a){var e=[b,""].join("");return[a[1],a[0],e,d,1==b?1:2==b?3:5]}},lazer={setMR:function(b){maxrequsests=b},makeR:function(b,d,a,e){if(0==requsests.length)"P"!==a?requsests.push([b,d,a,e,0]):requsests.push([b,d,a,e]);else if(!(requsests.length>maxrequsests&&"P"!==a)){for(var f=!1,g=0;g<requsests.length;){if(e==requsests[g][3]){f=!0;break}g++}f||requsests.push([b,d,a,e])}},runR:function(b,d){if(void 0==b||null==b)b=2;for(var a=0,e=[0,
0];a<requsests.length;)"P"==requsests[a][2]?(e=[requsests[a][0],requsests[a][1]],centerIMG(game[12],requsests[a][0]-43,requsests[a][1],128,128,128,128),requsests[a][1]-=b,1==shot&&(requsests.splice(a,1),shot=0),0>requsests[a][1]&&requsests.splice(a,1)):1==requsests[a][2]?(0==requsests[a][4]?(centerIMG(game[8],requsests[a][0]-43,requsests[a][1],128,128,128,128),requsests[a][4]=1):(centerIMG(game[9],requsests[a][0]-43,requsests[a][1],128,128,128,128),requsests[a][4]=0),console.log(d[1]),requsests[a][1]+=
b-1,d[0]+18>requsests[a][0]&&d[0]-18<requsests[a][0]&&d[1]+12>requsests[a][0]&&d[1]-12<requsests[a][1]&&(requsests.splice(a,1),*=1),600<requsests[a][1]&&void 0!==requsests[a]&&requsests.splice(a,1)):2==requsests[a][2]&&(0==requsests[a][4]?(centerIMG(game[10],requsests[a][0]-43,requsests[a][1],128,128,128,128),requsests[a][4]=1):(centerIMG(game[11],requsests[a][0]-43,requsests[a][1],128,128,128,128),requsests[a][4]=0),requsests[a][1]+=b+1,d[0]+15>requsests[a][0]&&d[0]-15<requsests[a][0]&&d[1]+
12>requsests[a][0]&&d[1]-12<requsests[a][1]&&(requsests.splice(a,1),*=1),600<requsests[a][1]&&void 0!==requsests[a]&&requsests.splice(a,1)),a++;return e}},CHAR={Rarchar:function(b,d){0==gameover&&(centerIMG(game[7],b,600,256,256,256,256),"beh"!==d&&("a"==d?b-=5:"d"==d?b+=5:lazer.makeR(b,570,"P",-1)),1==*&&(--phealth,*=0,0>=phealth&&(gameover=1)));return b}};level.setcenterAndLength([300,260],[-105,-105]);
for(var tyz=level.create(13,50),ZZT=0;8>ZZT;)ZZT++,tyz=level.add(CRETURE._1("3",1,[ZZT,1]),tyz),tyz=level.add(CRETURE._1("2",1,[ZZT,2]),tyz),tyz=level.add(CRETURE._1("2",1,[ZZT,3]),tyz),tyz=level.add(CRETURE._1("1",1,[ZZT,4]),tyz),tyz=level.add(CRETURE._1("1",1,[ZZT,5]),tyz);lazer.setMR(1);var tic=0,mode=1,XXX=315,R=[0,0];
function runner(){1<=phealth&&0!==INV?(n=68==n?"d":65==n?"a":87==n?"beh":83==n?"s":"beh",newframe(),ctx.fillStyle="#FF0000",ctx.fillText(phealth,10,10),XXX=CHAR.Rarchar(XXX,n),R=lazer.runR(3,[XXX,600]),100==tic?(tyz=level.updatecomponents(tyz,1,R),3>mode?1==mode?(tyz=level.arraymove(1,tyz),1==test[2]&&(mode=2)):(tyz=level.arraymove(3,tyz),mode=4):4==mode?(tyz=level.arraymove(2,tyz),1==test[1]&&(mode=5)):(tyz=level.arraymove(3,tyz),mode=1),tic=0):(lazer.runR(3,[XXX,600]),tyz=level.updatecomponents(tyz,
0,R)),tic++):0>=phealth?(ctx.fillStyle="#FF0000",ctx.font="italic small-caps bold 70px arial, sans-serif",ctx.fillText("GAME OVER",40,300)):(ctx.fillStyle="green",ctx.font="italic small-caps bold 70px arial, sans-serif",ctx.fillText("GG you win",40,300))}tyz=level.updatecomponents(tyz,0,[90,90]);newframe();var run=setInterval(runner,10);

</script>
</body>
</html>
Sorry! Still can't get it!
m99900
Scratcher
48 posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

look at that post again I made an edit
PackersRuleGoPack
Scratcher
1000+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

m99900 wrote:

look at that post again I made an edit
Wow! I am impressed! That is amazing! If I could choose, I would accept you, but we should wait for coke11! Do you have a Trello and Github account?
m99900
Scratcher
48 posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

ya
makethebrainhappy
Scratcher
1000+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

Austinato wrote:

So does everyone approve of keeping the main Wiki and making special “Language/Article” (i.e. Espanol/Drop“) articles for each language?

And I'm still confused what language ”dach" is.

Thanks for reading,
Austinato

Dach is an abbreviation for a German Language Wiki
algmwc5
Scratcher
100+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

i can help translate!
Translator
What language can you translate English to? Indonesian
Why do you want this position? I'm a native speaker
PackersRuleGoPack
Scratcher
1000+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

algmwc5 wrote:

i can help translate!
Translator
What language can you translate English to? Indonesian
Why do you want this position? I'm a native speaker
Hmm ok! I think we could use you! Please wait for coke11 to approve
golden-scratch
Scratcher
500+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

PackersRuleGoPack wrote:

Hmm ok! I think we could use you! Please wait for coke11 to approve

It's a bit rude to say you are going to “use” someone
pioutch
Scratcher
85 posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

why nobody reply my request for a translator-job?
golden-scratch
Scratcher
500+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

pioutch wrote:

why nobody reply my request for a translator-job?
Sorry for the wait. I have commented on your application, and I will now notify coke to check it out on our private trello board.
Thank you for your DragonDrop interest.

-golden
pioutch
Scratcher
85 posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

golden-scratch wrote:

pioutch wrote:

why nobody reply my request for a translator-job?
Sorry for the wait. I have commented on your application, and I will now notify coke to check it out on our private trello board.
Thank you for your DragonDrop interest.

-golden

Thank you.
Scratch on!
NaturalmotionStudios
Scratcher
100+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

Austinato wrote:

NaturalmotionStudios wrote:

makethebrainhappy wrote:

Favicon: It's not a dragon but it represents our purpose well



Credit to www.softicons.com
We have a favicon.

Also the website manager app is coming along well!
I believe MTBH is speaking/suggesting a favicon for the Wiki. Right now, it's the default Wikia one.

Oh, we have one for the website though. I'm using it for the Website Manager app.
pioutch
Scratcher
85 posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

NaturalmotionStudios wrote:

Austinato wrote:

NaturalmotionStudios wrote:

makethebrainhappy wrote:

Favicon: It's not a dragon but it represents our purpose well



Credit to www.softicons.com
We have a favicon.

Also the website manager app is coming along well!
I believe MTBH is speaking/suggesting a favicon for the Wiki. Right now, it's the default Wikia one.

Oh, we have one for the website though. I'm using it for the Website Manager app.
I think the favicon have to be a computermouse, they clicks on a dragon.
NaturalmotionStudios
Scratcher
100+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

pioutch wrote:

I think the favicon have to be a computermouse, they clicks on a dragon.
The what now? ._.
pioutch
Scratcher
85 posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

NaturalmotionStudios wrote:

pioutch wrote:

I think the favicon have to be a computermouse, they clicks on a dragon.
The what now? ._.
sorry, please forget this!
MegaByteCorporations
Scratcher
1000+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

Wow.
pioutch
Scratcher
85 posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

MegaByteCorporations wrote:

Wow.
what do you mean?
pioutch
Scratcher
85 posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

Austinato wrote:

So does everyone approve of keeping the main Wiki and making special “Language/Article” (i.e. Espanol/Drop“) articles for each language?

And I'm still confused what language ”dach" is.

Thanks for reading,
Austinato

Dach is none language. Dach is the short cut for: Deutschland (germany), Austria and Schweiz (
Switzerland)
Scratch on!
pioutch
Scratcher
85 posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

pioutch wrote:

Austinato wrote:

So does everyone approve of keeping the main Wiki and making special “Language/Article” (i.e. Espanol/Drop“) articles for each language?

And I'm still confused what language ”dach" is.

Thanks for reading,
Austinato

Dach is none language. Dach is the short cut for: Deutschland (germany), Austria and Schweiz (
Switzerland)
Scratch on!
This mean: Countrys, where the people speak german.
Austinato
Scratcher
1000+ posts

<< DragonDrop | RECRUITING DEVELOPERS | Help us code a website where you can make your own free websites! >>

pioutch wrote:

Dach is none language. Dach is the short cut for: Deutschland (germany), Austria and Schweiz (
Switzerland)
Scratch on!
- - -
This mean: Countrys, where the people speak german.
Ah okay, does everyone agree with having one Wiki and making “Da/Drop” pages for alternate languages? Meaning for the page titled “Drop”, it would be like this:

English = Drop
Espanol = Esp/Drop
German = Da/Drop

etc.

Powered by DjangoBB