Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var audioCtx=new AudioContext();
- var oscillator = audioCtx.createOscillator();
- var gainNode = audioCtx.createGain();
- oscillator.connect(gainNode);
- gainNode.connect(audioCtx.destination);
- var WIDTH = window.innerWidth;
- var HEIGHT = window.innerHeight;
- var FreqMax = 300;
- var VolMax = 10.0;
- var Freq = 0;
- var Vol = 10.0;
- oscillator.type = 'sine';
- oscillator.frequency.value = Math.random()*Freq;
- oscillator.start();
- gainNode.gain.value = Math.random()*Vol;
- var CurX;
- var CurY;
- document.onmousemove = updatePage;
- function updatePage(e) {
- CurX = (window.Event) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
- CurY = (window.Event) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
- oscillator.frequency.value = (CurX/WIDTH) * FreqMax;
- gainNode.gain.value = (CurY/HEIGHT) * VolMax;
- osillator.detune=(0);
- canvasDraw();
- }
- </script>
- <html>
- <body onmousemove="drawe();
- drawf();" background-color="white">
- <canvas id="myCanvas" width="1000" height="1000" style="background:black;">
- </canvas>
- <script>
- function drawe(){
- var text = "";
- var possible = "FABCGDE0123456789";
- var canvas = document.getElementById("myCanvas");
- var ctx = canvas.getContext("2d");
- for(var i1=1;i1<20;i1++){
- Line=Math.random()*CurX;
- if(event.y>i1){
- Line1=Math.random()*CurY;
- }
- ctx.beginPath(Line1,Line1);
- ctx.moveTo(Line,Line1);
- for(var i=0; i!=6; i++)
- text+=possible.charAt(Math.floor(Math.random()*possible.length));
- ctx.strokeStyle='#'+text;
- text='';
- ctx.lineTo(event.x,event.y);
- ctx.stroke()
- ctx.paint();
- ctx.clear();
- }
- }
- </script>
Add Comment
Please, Sign In to add comment