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 TripleOscillator's white noise generator #7318

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions include/Oscillator.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@

static inline sample_t noiseSample( const float )
{
// Precise implementation
// return 1.0f - rand() * 2.0f / RAND_MAX;

// Fast implementation
return 1.0f - fast_rand() * 2.0f / FAST_RAND_MAX;
return 1.0f - rand() * 2.0f / RAND_MAX;

Check notice on line 166 in include/Oscillator.h

View check run for this annotation

codefactor.io / CodeFactor

include/Oscillator.h#L166

Consider using rand_r(...) instead of rand(...) for improved thread safety. (runtime/threadsafe_fn)
}

static sample_t userWaveSample(const SampleBuffer* buffer, const float sample)
Expand Down
Loading