Skip to content

Commit

Permalink
Fix noise generator (LMMS#7318)
Browse files Browse the repository at this point in the history
This noise generator doesn't work properly when multiple noise sources are being generated simultaneously.
  • Loading branch information
LostRobotMusic authored and FyiurAmron committed Jun 17, 2024
1 parent 8f039b7 commit 7176c56
Showing 1 changed file with 1 addition and 5 deletions.
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 @@ class LMMS_EXPORT Oscillator

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;
}

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

0 comments on commit 7176c56

Please sign in to comment.