-
Notifications
You must be signed in to change notification settings - Fork 48
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
less deterministic random #36
Conversation
This is the wrong way to do this.
Instead: Add another argument to |
understood! i thought that adding another argument to orca_run would have been a problem bigger than those, but all those things are actually doable so i'll work on fix it =) all the 1-2-4 point are clear, just for 3, i make all those things, then i declare and initialize the random seed to pass locally into the |
Yeah. Leave the generation of the random seed up to whatever is calling |
sounds good, i will do it as soon as i have some mental stamina for this |
i was trying all the suggestion, but as the random seed i'm generating is just created once when i pass it to the I was thinking about using the generated random seed (that is always the same for each execution in your frame and position dependant hashing, what do you think would be the best way to do that? for example something like this, to avoid multiplying the seed by 0 on the first frame: Usz key = y * width + x;
key = hash32_shift_mult((y * width + x) ^ (((Tick_number+16)*extra_params->random_seed) << UINT32_C(16)));
Usz val = key % (max - min) + min; |
also, using the seed this way open up of keeping the possibility of a |
( i pushed those changes so you can give a look ) |
maybe another way could be :
it would be the equivalent of shifting the whole random coordinates using the seed, i like it more than the committed one |
this commit initialize a random seed on start and uses it in the random hashing function, without that the number generated by
R
would be the same each time the .orca file is restarted, try this before the commitsave the file, and start it, then close and restart it, you can see that the generated numbers are the same. That is a bad behavior for making generative music, so this commit fixes that.
As this is the first time i go outside the
sim.c
file, i'd like to @cancel to review this commit when he has time.