zya / beet.js

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

Support string sequence when creating layers #3

Closed rmwxiong closed 8 years ago

rmwxiong commented 8 years ago

Lets you pass in '0110', for instance.

Use:

  var kick  = beet.layer('10001000', playKick);
  var snare = beet.layer('00100010', playSnare);
  var hat   = beet.layer('10101010', playSnare);
zya commented 8 years ago

I have been thinking about this feature. But I think it needs to be an option for creating 'pattern' objects.

var kickPattern = beet.pattern('10001000');
var kickLayer = beet.layer(kickPattern, callback);

This will then give you other pattern features such as shift and update or any future methods. If you agree, please update this pull request or create a new one with added tests to the Pattern constructor tests and updated documentation.

If you don't agree, I am open to suggestions how to handle this feature.

zya commented 8 years ago

the new feature was added to beet.pattern in version 1.6.0 fa9fe0b77ba6eb34082bcf1f672a3750ab044aa2. so closing it.