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 = 5000;
- var VolMax = 1;
- var Freq = 5000;
- var Vol = 0.1;
- oscillator.type = 'sawtooth';
- oscillator.frequency.value = Freq;
- oscillator.start();
- gainNode.gain.value = Vol;
- var CurX;
- var CurY;
- document.onmousemove = updatePage;
- function updatePage(e) {
- CurX = (Math.random()*100) ? e.pageX : event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
- CurY = (Math.random()*100) ? e.pageY : event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
- oscillator.frequency.value = (CurX);
- gainNode.gain.value = (CurY);
- osillator.detune=(2);
- canvasDraw();
- }
- </script>
- <!DOCTYPE html>
- <html>
- <body onmousemove="drawe();" onchange="drawe();">
- <canvas id="myCanvas" width="1000" height="1000" style="border:1px">
- Your browser does not support the canvas element.
- </canvas>
- <script>
- function drawe(){
- var canvas = document.getElementById("myCanvas");
- var ctx = canvas.getContext("2d");
- ctx.moveTo(event.x,event.y);
- ctx.lineThickness='1px';
- ctx.lineTo(event.x+Vol,event.y+Freq);
- ctx.stroke();
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment