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

Introduce buffers to deal with Rubberband's variable output length #1

Merged
merged 2 commits into from
Jun 12, 2018

Conversation

johannes-mueller
Copy link
Contributor

There's retrieve_buffer where Rubberband puts its stuff in and there's
ring_buffer where we add retrieve_buffer's content to. Finally we take as
many samples we need from ring_buffer to the output buffer.

src/repitch.cc Outdated
const uint32_t pos = sb->read_pos;
if (pos < sb->write_pos && pos > sb->write_pos-len) {
const uint32_t d = len-(sb->write_pos-pos);
memcpy(dst+d, sb->data+pos, (len-d)*sizeof(float));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the destination not be cleared from dst ... dst+d here?

memset (dst, 0, d * sizeof(float));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would make sense, yes. However I don't hear any difference in the sound. Does Ardour give the LV2 plugins cleared output buffers?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by default Ardour/LV2 uses in-place. input-buffer == output buffer.

There's `retrieve_buffer` where Rubberband puts its stuff in and there's
`ring_buffer` where we add `retrieve_buffer`'s content to. Finally we take as
many samples we need from `ring_buffer` to the output buffer.
@x42 x42 merged commit c90cb8b into x42:master Jun 12, 2018
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

Successfully merging this pull request may close these issues.

2 participants