beeplay icon indicating copy to clipboard operation
beeplay copied to clipboard

Better Chaining: play should return a reference to itself.

Open JAStanton opened this issue 10 years ago • 2 comments

Something like this http://codepen.io/JAStanton/pen/inoBb

var intro = beeplay({bpm: 120}).play(null, 2)('D#5', 1/4)('E5', 1/4);

JAStanton avatar Jun 08 '14 20:06 JAStanton

Actually looking at your source I see what you're doing and why. Maybe make an alias function called p or something that calls into play?

beeplay(...).p(...)(...);

or

beeplay(...)(...)(...);

Though I understand this might be a bit limiting

JAStanton avatar Jun 08 '14 20:06 JAStanton

Hello :smiley_cat: I play to change like this:

var obj = [['C4', 1/4], ['D4', 1/4], ['E4', 1/4]];
var obj2 = [['E4', 1/4], ['F#4', 1/4], ['G4', 1/4]];

var b = beeplay({key: 'C', bpm: 120})
  .play(obj)
  .set({'key': 'Em', bpm: 80})
  .play(obj2);

Writing play chain will a way to do debug.

watilde avatar Jun 09 '14 01:06 watilde