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

Fix time precision issues with Psync and EventStreamPlayer #5891

Merged
merged 2 commits into from
Oct 26, 2022

Conversation

totalgee
Copy link
Contributor

@totalgee totalgee commented Oct 23, 2022

Purpose and Motivation

Fixes #4767.

Types of changes

  • Documentation
  • Bug fix

To-do list

  • Code is tested
  • All tests are passing
  • Updated documentation
  • This PR is ready for review

- add smallButNotZero method on SimpleNumber.
- incorporate PR supercollider#4801: Psync now rounds up time.
- add fix for supercollider#4767, related to time precision, causing Event doubling
  when redefining Pdefs.
@totalgee
Copy link
Contributor Author

I'd like to know whether there is somewhere I can add unit tests for this (not sure if playback things can be unit-tested?). Please advise and I will add them. Thanks!

@dyfer
Copy link
Member

dyfer commented Oct 23, 2022

Hi @totalgee
Here's an example of unit test that "plays" sound and checks for its correctness: https://github.com/supercollider/supercollider/blob/develop/testsuite/classlibrary/TestCoreUGens.sc
Please note that these particular tests are a bit abstracted to facilitate running multiple tests with a similar structure, but the main takeaway is that you need to set up a dedicated server, .bootSync it, then run <function>.loadToFloatArray and finally quit the server.
Any tests you add to the classlibrary directory will be run in the CI
Does that answer your question?

(PS I don't know what the macOS arm64 failure is about, it's not related to your PR, I'll look into it) EDIT: it worked on the second attempt

@totalgee
Copy link
Contributor Author

Thanks @dyfer, I'll add a few unit tests and push those when I can. I don't need the server/audio, just need to play some Pdefs on a TempoClock. I'll try it my way, then someone can correct me if they don't like it, or there's a simpler approach. (-;

@dyfer
Copy link
Member

dyfer commented Oct 24, 2022

There are definitely examples of Pattern tests in our UnitTests, feel free to take a look at them.

@totalgee
Copy link
Contributor Author

I just finished adding some unit tests that cover the time-related problems this fixes. I capture values out of playing Patterns (Pdefs) and compare them with what is expected.

@dyfer dyfer merged commit 1254171 into supercollider:develop Oct 26, 2022
@totalgee
Copy link
Contributor Author

Thanks!

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.

Pdef quantization doesn't work when set as source to an Ndef
3 participants