Advertisement
BrU32

Freq Oscillator Static Emulation

May 13th, 2016
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. <script>
  2. function RollSlott(){
  3. var Bar=parseFloat(Math.random()*101.9);
  4. var Barr=parseFloat(Math.random()*101.9);
  5.  
  6. document.body.innerHTML=(Bar+":"+Barr);
  7. var PlayLen=80;
  8. if(Bar!=0){
  9. Bar--
  10. }else if(Bar!=101){
  11. Bar++
  12. }
  13. var context = new AudioContext();
  14. oscillator=context.createOscillator();
  15. oscillator.type = 'sine';
  16. oscillator.frequency.value = Bar;
  17. oscillator.connect(context.destination);
  18. oscillator.start(0);
  19. oscillator.stop(PlayLen);
  20. oscillator.disconnect(PlayLen);
  21. }
  22. </script>
  23. <button onclick="script:
  24. var rolls=10;
  25. while(rolls!=0){
  26. rolls--;
  27. var Timer1 = setTimeout ('RollSlott();',0.0001);
  28. var Timer1 = setTimeout ('RollSlott();',0.002)
  29. var Timer1 = setTimeout ('RollSlott();',0.03)
  30. var Timer1 = setTimeout ('RollSlott();',0.04)
  31. var Timer1 = setTimeout ('RollSlott();',0.5)
  32. }">Roll Static Test Now!!</button>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement