{
   "code" : "s.boot;\r\n(\r\n// see this for explanation: https://en.wikipedia.org/wiki/Binaural_beats\r\n\r\n// Wikipedia says binaural beats occur only below 1500hz of the primary frequency and with \r\n// differences of frequencies of under 40hz\r\n\r\n~delta = 1; // 0.5 - 2. deep sleep, unsconsciousness\r\n~theta = 5.5; // 4 - 7. Meditative, drowsy, sleeping. Memory, spatial learning\r\n~mu = 9; // 9 - 11. associated with voluntary movement\r\n~alpha = 10; // 7.5 - 12.5. Relaxed states of mind\r\n~beta1 = 14; // 12.5 - 16. Normal waking consciousness\r\n~beta2 = 18; // 16.5 - 20.\r\n~beta3 = 24; // 20.5 - 28\r\n~gamma = 35; // 32 - 100. Visual awareness, transcendental mental states\r\n\r\n// extra bonus vibrations:\r\n~schumann1 = 7.83;\r\n~schumann2 = 14.3;\r\n~schumann3 = 20.8;\r\n~schumann4 = 27.3;\r\n~schumann5 = 33.8;\r\n\r\n\r\n// the sound synth\r\nSynthDef(\\brainwave, {|prime = 200, diff = 10, fade = 15, primetime = 20, difftime = 30, level= 0.4, gate = 1|\r\n\tvar freqtransition = VarLag.kr(prime, primetime, 0, \\lin);\r\n\tvar links = SinOsc.ar(freqtransition);\r\n\tvar rechts = SinOsc.ar(freqtransition - VarLag.kr(diff, difftime, 0, \\lin));\r\n\tvar env = EnvGen.kr(Env.asr(fade, level, fade), gate, doneAction:2);\r\n\tOut.ar(0, [links, rechts] * env);\r\n}).add;\r\n)\r\n\r\na = Synth(\\brainwave, [\\prime, 200, \\diff, ~alpha]);\r\n\r\na.set(\\fade, 20) // set fade out time. The synth is automatically released when faded out\r\n\r\na.set(\\primetime, 40); // set transition time for primary frequency changes\r\n\r\na.set(\\difftime, 20); // set transition time for arriving at binaural beat target frequencies\r\n\r\na.set(\\prime, 100); // set to your favorite freqency.\r\n\r\na.set(\\diff, ~beta1) // set the desired brainwave frequency ;-)\r\n\r\na.release; // fade out and release the synth\r\n\r\n// here's my 'piece'. It starts at alpha and after 2 minutes slowly goes up to gamma\r\n\r\n// uncomment the following and choose a path for the resulting file\r\n// s.prepareForRecord('/Users/axel/Desktop/binaural.aiff')\r\n\r\n// now manipulate and run this routine to create a supercharged extra brainwave powered experience 4 free.\r\n(\r\nfork {\r\n\ts.record;\r\n\t1.wait;\r\n\ta = Synth(\\brainwave, [\\prime, 125.28, \\diff, ~alpha]);\r\n\t160.wait;\r\n\ta.set(\\difftime, ~gamma);\r\n\t60.wait;\r\n\ta.set(\\prime, 167.04);\r\n\t30.wait;\r\n\ta.release;\r\n\t16.wait;\r\n\ts.stopRecording;\r\n};\r\n)",
   "is_private" : null,
   "id" : "1-50W",
   "labels" : [
      "experimental",
      "science"
   ],
   "description" : "An experimental setup to create files of binaural beats attuned to human brainwave frequencies.",
   "ancestor_list" : [],
   "author" : "axl99",
   "name" : "Binaural Beats Experiment"
}
