summaryrefslogtreecommitdiff
path: root/public/js/grid.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2012-09-24 17:54:41 -0400
committerJules Laplace <jules@okfoc.us>2012-09-24 17:54:41 -0400
commitc3c112aee29a0358e628ba4434592fcbc56135ea (patch)
tree5bc4385b0d0123dc6da219585a7ffd14851c4420 /public/js/grid.js
parente8db5488d2be5af228c45f9eb13c884e365ed2c2 (diff)
too-large buffer was the issue
Diffstat (limited to 'public/js/grid.js')
-rw-r--r--public/js/grid.js18
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;