zya / beet.js

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

Play/Pause beet layer #7

Closed guilhermecomum closed 5 years ago

guilhermecomum commented 5 years ago

Hi, first of all thank you for this awesome project <3 There is a way to toggle layer playback?

zya commented 5 years ago

Hi @guilhermecomum. You an pause, stop and start the sequencer. Which will apply those to all layers. https://github.com/zya/beet.js#beetpausetime

You should also be able to pause, stop and start each layer. I've not documented that, but I think it should work. Let me know if it does not.

https://github.com/zya/beet.js/blob/master/lib/layer.js#L29-L42

Note that, when you pause something and start it again, it wont necessarily be in sync any more with the rest of the layers. Unless you pause and play with some extra code to ensure they happen at the right time for syncing purposes.

guilhermecomum commented 5 years ago

Thank you very much!!

I'm using your library to make a tool to help people to learning Polyrhythm, you can check it out in: https://github.com/guilhermecomum/polymatic