Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sound engine crashes when using playBuffer with negative speed #96

Closed
ales-tsurko opened this issue Feb 27, 2015 · 4 comments
Closed

Sound engine crashes when using playBuffer with negative speed #96

ales-tsurko opened this issue Feb 27, 2015 · 4 comments

Comments

@ales-tsurko
Copy link

Hi Colin! I don't know is it a bug or I do something wrong. But when I try to change playBuffer to negative speed (reverse playback) the sound is crashing when playing position reaches 0.
My synth is:

{
 id: "synth",
 ugen: "flock.ugen.playBuffer",
 buffer: {
  id: "sample",
  url: "/sample.mp3"
 },
 trigger: 0,
 loop: 1,
 speed: -1
}

Also it looks like with negative value playBuffer ignores start and end parameters. I use GUI element to set the start and end position, but with positive speed it's worked fine.

@colinbdclark
Copy link
Collaborator

Hi Ales! Yes, I can also reproduce this issue. It looks like the playBuffer unit generator doesn't currently support negative speed values. I'll try to whip something up soon to address this.

As a workaround in the meantime, is it possible that using flock.ugen.readBuffer and driving a flock.ugen.phasor backwards might do the trick?

@colinbdclark colinbdclark added this to the Flocking 0.1.1 milestone Feb 27, 2015
@ales-tsurko
Copy link
Author

Great! Thanks!
I've tried to make it with phasor in the playground through changing the increment to negative value or setting the start parameter bigger than the end, but again got crash... I just don't see any way to make the phasor backward, except of subtracting the output of the phasor from the sample length. Is it possible? And are there any other ways?

@colinbdclark
Copy link
Collaborator

I finally found a spare moment to add support for running flock.ugen.playBuffer backwards using a negative speed input. It's in the 0.1.x branch. If it works for you, I'll include it as part of the Flocking 0.1.1 release, along with some other buffer-related fixes.

@ales-tsurko
Copy link
Author

It works! Thanks!

colinbdclark added a commit that referenced this issue Mar 11, 2015
* 0.1.x:
  Updates build files for 0.1.1.
  Bumps Flocking version number to 0.1.1.
  gh-97: Adds support for raw arrays and bufDescs to all buffer ugens.
  gh-96: Adds additional unit tests for flock.ugen.playBuffer at different rates.
  Fixes gh-96 and gh-98. Adds support for backwards buffer playback.
colinbdclark added a commit that referenced this issue Mar 12, 2015
* master:
  Resolves gh-94: Documents how to create custom synth grades.
  Updates build files for 0.1.1.
  Bumps Flocking version number to 0.1.1.
  gh-97: Adds support for raw arrays and bufDescs to all buffer ugens.
  gh-96: Adds additional unit tests for flock.ugen.playBuffer at different rates.
  Fixes gh-96 and gh-98. Adds support for backwards buffer playback.

Conflicts:
	dist/flocking-all.js
	dist/flocking-all.min.js
	dist/flocking-no-jquery.js
	dist/flocking-no-jquery.min.js
	tests/flocking/js/ugen-tests.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants