zya / beet.js

Polyrhythmic Sequencer library for Web Audio API.
http://zya.github.io/beet.js
MIT License
114 stars 17 forks source link

Fix undefined context reference in utils #2

Closed rmwxiong closed 4 years ago

rmwxiong commented 8 years ago

The utils load method seems to expect a global context object. The other approach might be to add a context argument to the method.

module.exports.load = function (path, success, failure, context) {
  context = context || window.context || new AudioContext();
  ...
}
zya commented 8 years ago

good catch. But not sure if creating a new context is the best solution for it. We need to somehow pass in the Beet context to the utils module.

I'm still not sure about having the utils as part of the library. What do you think? Does it seem useful to you?

zya commented 4 years ago

This was addressed in the latest release 1.8.0