zya / beet.js

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

Use array concat for Beet.add(layer); #4

Closed rmwxiong closed 8 years ago

rmwxiong commented 8 years ago

Allows multiple layers to be added as multiple arguments.

beet.add(layer1, layer2, layer3);

Adds some convenience, instead of requiring the use of an array.

[layer1, layer2, layer3].forEach(beet.add);
zya commented 8 years ago

It will definitely be very useful to be able to say beet.add(layer1, layer2, ...). but I don't think your solution will work.

arguments is not quite an array. it is an 'array-like' object. check the fiddle below to see that is not working.

https://jsfiddle.net/ehsanziya/t58ds4nj/ https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/arguments

I am interested in adding this feature to the add method. so feel free to open fix this pull request or ideally open a new fresh one.

zya commented 8 years ago

fixed in 1.7.0