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

MIDI latency #76

Open
tuia23 opened this issue May 2, 2023 · 1 comment
Open

MIDI latency #76

tuia23 opened this issue May 2, 2023 · 1 comment

Comments

@tuia23
Copy link

tuia23 commented May 2, 2023

The TSF library is working really well. However, I notice a significant latency between the note command and the note actually playing. In other MIDI libraries, this issue could be solved by simply reducing the size of a buffer, but I don't find this option in TSF. What could I do to reduce the latency?

@ell1e
Copy link
Contributor

ell1e commented May 7, 2023

How exactly are you using it? Basically, if you tsf_render_... too much in advance (can be both too much in terms of buffer size, and in terms of time when you let it sit for too long before you move your render result into whatever audio library you're using for actual output) then you'll get latency. Also, I think lowering TSF_RENDER_EFFECTSAMPLEBLOCK and TSF_RENDER_SHORTBUFFERBLOCK could help but I could be wrong, these default to 64 and 512 and the latter needs to be a multiple of the former. (You can define these to new values before including the tsf headers, and that should override it then.) Maybe some of that helps you figure out what is going on?

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