Skip to content

Conversation

@dfsek
Copy link
Member

@dfsek dfsek commented Jan 17, 2026

This branch contains a more optimal implementation of white noise, which

  • Removes frequency from WhiteNoiseSampler, PositiveWhiteNoiseSampler, and GaussianNoiseSampler, and instead implements the Sampler interface directly onto them. In random noise functions, frequency is useless as it is really just a second, slower salt.
  • Optimises WhiteNoiseSampler to only require a single double addition instead of an addition and multiplication, by fiddling with bits more smarter.

I also am of the opinion that Frequency in general should be pulled out into its own sampler, as there is a ton of duplicated logic and weird edgecases surrounding frequency in the sampler code (like this white noise thing). If frequency was its own sampler, like FBM, the codebase would be much cleaner. I have not implemented that change in this PR, as it would be an extensive change to all the sampler code, so I would like input on that before I do it.

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.

2 participants