message: Make noiseArrays generate samples lazily
  * Make noiseArrays generate samples lazily
  * getter -> get
  * Create noiseBuffers instead of arrays
  fixes
diff: @@ -185,8 +185,12 @@ define(["../core/Tone", "../source/Source", "../core/Buffer",
  * @private
  * @type {Array}
  */
  - var _noiseArrays = {
  - "pink" : (function(){
  + var _noiseBuffers = {};
  + var _noiseCache = {};
  +
  + Object.defineProperty(_noiseBuffers, "pink", {
  + get : function(){
  + if (!_noiseCache.pink){
  var buffer = [];
  for (var channelNum = 0; channelNum < channels; channelNum++){
  var channel = new Float32Array(bufferLength);
  @@ -206,9 +210,15 @@ define(["../core/Tone", "../source/Source", "../core/Buffer",
  b6 = white * 0.115926;
  }
  }
  - return buffer;
  - }()),
  - "brown" : (function(){
  + _noiseCache.pink = new Tone.Buffer().fromArray(buffer);
  + }
  + return _noiseCache.pink;
  + }
  + });
  +
  + Object.defineProperty(_noiseBuffers, "brown", {
  + get : function(){
  + if (!_noiseCache.brown){
  var buffer = [];
  for (var channelNum = 0; channelNum < channels; channelNum++){
  var channel = new Float32Array(bufferLength);
  @@ -221,9 +231,15 @@ define(["../core/Tone", "../source/Source", "../core/Buffer",
  channel[i] *= 3.5; // (roughly) compensate for gain
  }
  }
  - return buffer;
  - })(),
  - "white" : (function(){
  + _noiseCache.brown = new Tone.Buffer().fromArray(buffer);
  + }
  + return _noiseCache.brown;
  + }
  + });
  +
  + Object.defineProperty(_noiseBuffers, "white", {
  + get : function(){
  + if (!_noiseCache.white){
  var buffer = [];
  for (var channelNum = 0; channelNum < channels; channelNum++){
  var channel = new Float32Array(bufferLength);
  @@ -232,28 +248,11 @@ define(["../core/Tone", "../source/Source", "../core/Buffer",
  channel[i] = Math.random() * 2 - 1;
  }
  }
  - return buffer;
  - }())
  - };
  -
  - /**
  - * static noise buffers
  - * @static
  - * @private
  - * @type {Tone.Buffer}
  - */
  - var _noiseBuffers = {};
  -
  - //create the Tone.Buffers
  - function createBuffers(){
  - for (var type in _noiseArrays){
  - _noiseBuffers[type] = new Tone.Buffer().fromArray(_noiseArrays[type]);
  + _noiseCache.white = new Tone.Buffer().fromArray(buffer);
  }
  + return _noiseCache.white;
  }
  -
  - //create the noise buffers
  - Tone.getContext(createBuffers);
  - Tone.Context.on("init", createBuffers);
  + });
  return Tone.Noise;
  });
  