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

WIP: Add random signals with common distributions #942

Draft
wants to merge 12 commits into
base: 2.0-beatmode-retired
Choose a base branch
from

Conversation

fbous
Copy link

@fbous fbous commented Aug 14, 2022

Added a few random signals for #935.

It's a work in progress and I didn't get to properly test the different signals for performance and correct distribution yet.

Questions that I have so far:

  1. Should the stuff be implemented in a separate file or in UI.hs? If the file Random.hs should be used, should I move the relevant functions from UI.hs there?
  2. Not sure what the best method is to generate independent RV. Methods I see so far:
  • Scaling the time-seed by an irrational number
  • Shifting the time-seed by a large and/or irrational number
  • Applying Xorshift multiple times
    Right now I'm using the first but maybe the last idea could be better?
  1. What other distributions would be useful / desired?

@yaxu
Copy link
Member

yaxu commented Aug 16, 2022

Fantastic!

  1. I've probably vote for the separate file as-is, and move the existing random-related functions there. It's a bit tricky though - as rand is a signal, perhaps it should be in with the other signals like sine, saw etc, currently in Core.hs. A Random.hs is tidy enough though, and the difference between UI and Core is not at all well defined in any case..

I don't have useful insights for the other questions as I'm no expert on this stuff..

Frederik N. A. Bous added 3 commits August 25, 2022 20:01
xorshift as a rng is meant to be applied multiple times consecutively
to generate a random sequence.
Applying xorshift to equidistant numbers once for each number
creates repeating patterns on different scales.
Thus a more elaborate hash function should be used
to avoid repetitiveness.
@yaxu
Copy link
Member

yaxu commented Aug 27, 2022

Is this ready to merge? It's kind of a breaking change but the next release will have other big changes so that's fine !

@fbous
Copy link
Author

fbous commented Aug 27, 2022

No, it's still a work in progress

I would say that Point 1 of #935 is finished but I haven't addressed Point 2 and 3 yet. Since they are loosely related I guess we could have separate pull requests for each if that is desirable, e.g. if the next release is scheduled soon and we want to include the new random signals there.

However, it seems the checks are still failing for this PR so this definitely has to be fixed before merge. When is the new release scheduled?

@yaxu
Copy link
Member

yaxu commented Aug 27, 2022

The next release isn't scheduled at the moment, there's a bit of discussion about it here https://club.tidalcycles.org/t/releasing-tidal-1-9-0/4241

So no rush

@yaxu
Copy link
Member

yaxu commented Sep 25, 2022

Well 1.9.x is out now. But we can do a new release whenever, and it could be 1.10 as a breaking change.

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