diff options
author | Jamie Bullock <jamie@jamiebullock.com> | 2014-02-23 21:31:22 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@jamiebullock.com> | 2014-02-23 21:32:23 +0000 |
commit | 68438bf7197649eca1f7dca33e7a20bbba1bbc59 (patch) | |
tree | 68ed03736f3c9bcb05856ee0afab1aab3a66410d /examples | |
parent | ffcf1903a1e7df4d56b0e6b931cc38ea6de217a2 (diff) | |
download | LibXtract-68438bf7197649eca1f7dca33e7a20bbba1bbc59.tar.gz LibXtract-68438bf7197649eca1f7dca33e7a20bbba1bbc59.tar.bz2 LibXtract-68438bf7197649eca1f7dca33e7a20bbba1bbc59.zip |
Use random() instead of arc4random() for portability
Diffstat (limited to 'examples')
-rw-r--r-- | examples/simpletest/simpletest.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/examples/simpletest/simpletest.c b/examples/simpletest/simpletest.c index 443de22..df068c2 100644 --- a/examples/simpletest/simpletest.c +++ b/examples/simpletest/simpletest.c @@ -78,7 +78,7 @@ void fill_wavetable(const float frequency, waveform_type type) wavetable[i] = ((phase / (double)PERIOD) * 2) - 1.; break; case NOISE: - wavetable[i] = (arc4random_uniform(1000) / 500.0) - 1; + wavetable[i] = ((random() % 1000) / 500.0) - 1; break; } } @@ -114,7 +114,9 @@ int main(void) xtract_mel_filter mel_filters; fill_wavetable(344.53125f, NOISE); // 344.53125f = 128 samples @ 44100 Hz + /* print_wavetable(); + */ /* get the F0 */ xtract[XTRACT_WAVELET_F0](wavetable, BLOCKSIZE, &samplerate, &f0); @@ -136,7 +138,7 @@ int main(void) { printf("\nUnable to get lowest value, all values below threshold?\n\n"); } - exit(0); + /* create the window function */ window = xtract_init_window(BLOCKSIZE, XTRACT_HANN); xtract_windowed(wavetable, BLOCKSIZE, window, windowed); |