From 68438bf7197649eca1f7dca33e7a20bbba1bbc59 Mon Sep 17 00:00:00 2001 From: Jamie Bullock Date: Sun, 23 Feb 2014 21:31:22 +0000 Subject: Use random() instead of arc4random() for portability --- examples/simpletest/simpletest.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'examples/simpletest') 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); -- cgit v1.2.3