changeset 200:bd2db29d33f3

Use random() instead of arc4random() for portability
author Jamie Bullock <jamie@jamiebullock.com>
date Sun, 23 Feb 2014 21:31:22 +0000
parents 15fde6ea8a99
children ae2225b96ae1
files examples/simpletest/simpletest.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/examples/simpletest/simpletest.c	Tue Feb 18 20:18:44 2014 +0000
+++ b/examples/simpletest/simpletest.c	Sun Feb 23 21:31:22 2014 +0000
@@ -78,7 +78,7 @@
                 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 @@
     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 @@
     {
         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);