diff options
Diffstat (limited to 'public/js/grid.js')
| -rw-r--r-- | public/js/grid.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/public/js/grid.js b/public/js/grid.js index eeae315..0a4aece 100644 --- a/public/js/grid.js +++ b/public/js/grid.js @@ -1,6 +1,6 @@ -var bufferSize = 65536 / 2; +var bufferSize = 4096; // 65536 / 2; var sampleRate = 44100; var latency = 1000 * bufferSize / sampleRate; var audioletReady = false; @@ -17,7 +17,7 @@ function Sampler (audiolet, url) { // first get the sample and load it into a buffer var buffer = new AudioletBuffer(1, 0); - buffer.load(sample, false); + buffer.load(url, false); // connect the buffer to a player and set up the objects we need this.trigger = new TriggerControl(this.audiolet); @@ -25,9 +25,9 @@ function Sampler (audiolet, url) { this.gain = new Gain(this.audiolet, 0.80); // trigger -> player -> gain -> OUTPUT - trigger.connect(player, 0, 1); - player.connect(gain); - gain.connect(this.audiolet.output); + this.trigger.connect(this.player, 0, 1); + this.player.connect(this.gain); + this.gain.connect(this.audiolet.output); this.mute = function(){ base.gain.setValue(0); @@ -39,6 +39,7 @@ function Sampler (audiolet, url) { function Sequencer (audiolet, instrument) { var base = this; + this.audiolet = audiolet; this.instrument = instrument; this.pattern = [0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0]; @@ -68,7 +69,8 @@ function AudioletApp () { this.sequencers.push(sequencer); } } - + +var Audio = new AudioletApp(); function Grid (app){ var base = this; @@ -84,9 +86,7 @@ function Grid (app){ tick = tempo; } base.toggle = toggle; - - - var Audio = new AudioletApp(); + var tog = 0; var playing = false; |
