Skip to content
This repository has been archived by the owner on May 16, 2023. It is now read-only.

play().stop() does not work #36

Closed
cpansprout opened this issue Oct 2, 2016 · 7 comments
Closed

play().stop() does not work #36

cpansprout opened this issue Oct 2, 2016 · 7 comments

Comments

@cpansprout
Copy link

Your main readme file says I can do this:

  // or stop only one
  clavinet.play('C4').stop(ac.currentTime + 0.5)

but it doesn’t work, because play(), an alias for start(), does not return start()’s return value.

Changing

  player.play = function (n, w, o) { player.start(n, w, o) }

to

  player.play = function (n, w, o) { return player.start(n, w, o) }

makes it work.

I tried to file a pull request, but it’s not showing up. In any case, it had a mistake in it, in that it stopped microtones from working, so if the pull request does show up at some point it should be discarded.

@danigb
Copy link
Owner

danigb commented Oct 2, 2016

Good catch! I'll address it shortly.
Thanks

@danigb danigb closed this as completed in d140bfe Oct 2, 2016
@danigb
Copy link
Owner

danigb commented Oct 2, 2016

Please feel free to reopen if doesn't work to you.
Regards,
Dani

@cpansprout
Copy link
Author

Unfortunately, it causes microtones to stop working. It seems (I don’t fully understand your code) that player.start gets redefined at some point (I see two instances of player.start = in the code), so player.play does need to remain a wrapper. It just needs to return the value that player.start returns. Alternatively, whichever code is redefining player.start could also redefine player.play at the same time.

@danigb
Copy link
Owner

danigb commented Oct 4, 2016

Ok. I'll take a look. Thanks, @cpansprout

@danigb danigb reopened this Oct 4, 2016
@danigb
Copy link
Owner

danigb commented Oct 6, 2016

Hi @cpansprout, I think I've fixed the issue. Do you mind to test it against master branch?
Thanks.

@cpansprout
Copy link
Author

Yes, I have tested it and it works. Thank you.

@danigb
Copy link
Owner

danigb commented Oct 12, 2016

Thanks!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants