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

How to send output and have the timestamps be honored? #7

Open
DanTulovsky opened this issue Apr 12, 2014 · 0 comments
Open

How to send output and have the timestamps be honored? #7

DanTulovsky opened this issue Apr 12, 2014 · 0 comments

Comments

@DanTulovsky
Copy link

Hi.

Thank you for writing this. I am playing around and have a question. I can send output using WriteShort, and then sleep until sending the next event.

But, what I really have is a []portmidi.Event, which already include timestamp information. It seems like I should be able to just call:

out, err := portmidi.NewOutputStream(output, 1024, 0)
out.Write(events) # events is []portmidi.Event recorded just before this call.

and have it play. But the timing isn't respected, so everything goes very quickly.

I tried setting the latency in the NewOutputStream call to various values (based on the C code, that's the only time that timestamps are actually used), but that doesn't seem to work. (I thought that setting it to portmidi.Time() would offset it correctly from the reads I did just before...)

Do you know how I can pass in a list of Events and just have them played with the timing information honored? It seems silly that I would have to do that in my code :)

Thank you
Dan

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

1 participant