BrU32

JS Oscillator This Fool Can't Code Right!!

Dec 4th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. <body onload="setInterval(ff,0.01)">
  2. <script>
  3. function ff(){
  4. var context = new AudioContext();
  5. var lfo = context.createOscillator();
  6. for(var i=0;i<9;i++){
  7. lfo.frequency.value = Number(11200.)+i;
  8. var hfo = context.createOscillator();
  9. hfo.frequency.value = Number(11290.)+i;
  10. var modulationGain = context.createGain();
  11. modulationGain.gain.value = 10.0;
  12. lfo.connect(modulationGain);
  13. hfo.frequency.type=2;
  14. hfo.connect(context.destination);
  15. hfo.start(0);
  16. lfo.start(0);
  17. }
  18. }
  19. </script>
  20.  
  21. <body onload="setInterval(ff,0.0001)">
  22. <script>
  23. function ff(){
  24. var context = new AudioContext();
  25. var lfo = context.createOscillator();
  26. for(var i=0;i<9;i++){
  27. lfo.frequency.value = Number(11200.)+i;
  28. var hfo = context.createOscillator();
  29. hfo.frequency.value = Number(11290.)+i;
  30. var modulationGain = context.createGain();
  31. modulationGain.gain.value = 10.0;
  32. lfo.connect(modulationGain);
  33. hfo.frequency.type=2;
  34. hfo.connect(context.destination);
  35. hfo.start(0);
  36. lfo.start(0);
  37. }
  38. }
  39. </script>
  40. <script>
  41. function ff(){
  42. var context = new AudioContext();
  43. var lfo = context.createOscillator();
  44. for(var i=0;i<9;i++){
  45. lfo.frequency.value = Number(11200.)+i+;
  46. var hfo = context.createOscillator();
  47. hfo.frequency.value = Number(11290.)+i;
  48. var modulationGain = context.createGain();
  49. modulationGain.gain.value = 10.0;
  50. lfo.connect(modulationGain);
  51. hfo.frequency.type=2;
  52. hfo.connect(context.destination);
  53. hfo.start(0);
  54. lfo.start(0);
  55. }
  56. }
  57. </script>
Advertisement
Add Comment
Please, Sign In to add comment