Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

WIP: Add random signals with common distributions#942

Closed
fbous wants to merge 12 commits intotidalcycles:2.0-beatmode-retiredfrom
fbous:random
Closed

WIP: Add random signals with common distributions#942
fbous wants to merge 12 commits intotidalcycles:2.0-beatmode-retiredfrom
fbous:random

Conversation

@fbous
Copy link
Copy Markdown

@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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@yaxu
Copy link
Copy Markdown
Member

yaxu commented Jan 31, 2025

A couple of years on, do you still have this in mind?
It would need retargetting for the dev branch.

@fbous
Copy link
Copy Markdown
Author

fbous commented Feb 3, 2025

Thanks for checking in! I've tried to work on my PR a while ago but noticed that the target branch had evolved significantly and gave up again.

I think we can close this PR for now. If I ever get around working on Tidal again and it will still be relevant, I think it's easier to restart from a fresh branch and make a new PR. I'll keep the changes in my fork.

@fbous fbous closed this Feb 3, 2025
@yaxu
Copy link
Copy Markdown
Member

yaxu commented Feb 3, 2025

Apologies @fbous, a large development branch was abandoned, and a lot of reformatting has gone on on the new dev branch, but it should be much more stable from now, if/when you do get back to this.

@sss-create
Copy link
Copy Markdown
Collaborator

@yaxu looking at this and the 'normal' function I backported in #1101, maybe we should skip adding normal and focus on implementing foundational algorithms presented here as building blocks? as @fbous said at least part 1 of #935 seems to be ready, so checking how to incorporate changes from this PR into main could be an idea. If @fbous has no time or desire to do so, I could check -- with an open outcome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants