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 time fixes #668

Merged
merged 4 commits into from Aug 23, 2023
Merged

Midi time fixes #668

merged 4 commits into from Aug 23, 2023

Conversation

daslyfe
Copy link
Collaborator

@daslyfe daslyfe commented Aug 19, 2023

  • implement the note offset more accurately using the method recommended by the api "If time is a string prefixed with "+" and followed by a number, the message will be delayed by that many milliseconds."

  • use the Note constructor as recommended by the api docs

  • fix small issue where listeners would sometimes not trigger or trigger many times and spam the console with the device initialization log message

  • default to first IAC device if no devices is specified in pat.midi() and an IAC device exists.

  • adjust the duration offset slightly (from -5 to -10) to improve note glitching issues due to inconsistent duration/note off messages from the WebMidi API (this seems to be worse in firefox than chromium

@felixroos
Copy link
Collaborator

amazing! have you tested this new timing logic over longer periods of time? i don't fully remember why the old logic became what it is, but there were some long term timing problems (clock drifting?)

@daslyfe
Copy link
Collaborator Author

daslyfe commented Aug 21, 2023

amazing! have you tested this new timing logic over longer periods of time? i don't fully remember why the old logic became what it is, but there were some long term timing problems (clock drifting?)

It shouldn't drift out of time, because it just sends an offset value at the point that the note was triggered (instead of a full timestamp). I have been working on a music sketch all day that uses webmidi, osc, and the audio engine and they all seem to be keeping consistent time with each other.

@felixroos felixroos merged commit f20c5a1 into tidalcycles:main Aug 23, 2023
1 check passed
@daslyfe daslyfe deleted the midi_time_fixes branch January 21, 2024 22:21
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.

None yet

2 participants