Changeset 33

Show
Ignore:
Timestamp:
05/09/07 22:13:44 (2 years ago)
Author:
gordonjcp
Message:

totally doesn't work but the glitchy noises are cool

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nekostring/trunk/src/neko_ensemble.c

    r32 r33  
    2727 
    2828  float delay_1, delay_2, delay_3; 
    29   float xomega = 6.2831852f * (0.5 / (float)sample_rate); 
    30   float yomega = 6.2831852f * (5.75 / (float)sample_rate); 
     29  //float xomega = 6.2831852f * (0.5 / (float)sample_rate); 
     30  //float yomega = 6.2831852f * (5.75 / (float)sample_rate); 
     31  float xomega = 1024 * (0.5 / (float)sample_rate); 
     32  float yomega = 1024 * (5.75 / (float)sample_rate); 
     33 
    3134  float dr =  0.5* 0.002 * (float)sample_rate * 0.5f;   // FIXME - identify this bit 
    3235          float x1 = synth->ens_x1; 
     
    4245        float d1,d2; 
    4346 
     47        // we don't need to do it this way 
     48        // it would be better if the lfo went up to 1024 
     49        //float mult = NUM_POINTS/6.28; 
     50 
    4451//printf("%f %f %f %f\n",x1,y1,xomega,yomega); 
    4552  for (sample = 0; sample < sample_count; sample++) 
     
    5360// I have no idea what I did here originally 
    5461// "select on test" is the order of the day 
    55                  
    56         d1=200+20*sin(x1)+1.0f; d2=sin(y1)+1.0f; 
    57         delay_1 = 1100 + (d1*depth1+d2*depth2 * dr); 
    58         d1=200+20*sin(x1+2.1)+1.0f; d2=0.5*sin(y1+2.1)+1.0f; 
    59         delay_2 = 1000 + (d1*depth1+d2*depth2 * dr); 
    60         d1=200+20*sin(x1+4.2)+1.0f; d2=0.5*sin(y1+4.2)+1.0f; 
    61         delay_3 = 1200 + (d1*depth1+d2*depth2 * dr); 
     62 
     63 
     64          // urgh.  Let's make a start 
     65          // we have two LFOs, a fast one for the vibrato and a slow one for the chorus 
     66          // we need to create three delays, each modulated by the LFOs but offset by 120 degrees 
     67           
     68          //d1=200+20*sin(x1)+1.0f; d2=sin(y1)+1.0f; 
     69          d1=200+20*sine_wave[(int)x1]+1.0f; d2=sine_wave[(int)y1]+1.0f; 
     70          delay_1 = 1100 + (d1*depth1+d2*depth2 * dr); 
     71          //d1=200+20*sin(x1+2.1)+1.0f; d2=0.5*sin(y1+2.1)+1.0f; 
     72          d1=200+20*sine_wave[(int)(x1+341) % 1024]+1.0f; d2=0.5*sine_wave[(int)(y1+341) % 1024]+1.0f; 
     73          delay_2 = 1000 + (d1*depth1+d2*depth2 * dr); 
     74          //d1=200+20*sin(x1+4.2)+1.0f; d2=0.5*sin(y1+4.2)+1.0f; 
     75          d1=200+20*sine_wave[(int)(x1+682) % 1024]+1.0f; d2=0.5*sine_wave[(int)(y1+682) % 1024]+1.0f; 
     76          delay_3 = 1200 + (d1*depth1+d2*depth2 * dr); 
    6277 
    6378// get two samples from the buffer 
     
    86101                x1+=xomega; 
    87102        y1+=yomega; 
    88         if (x1>6.28) x1-=6.28
    89         if (y1>6.28) y1-=6.28
     103        if (x1>1024) x1-=1024
     104        if (y1>1024) y1-=1024
    90105 
    91106 
  • nekostring/trunk/src/neko_synth.h

    r32 r33  
    3333 
    3434#define WAVE_POINTS 1024          /* must be a power of two */ 
     35 
     36static float sine_wave[], 
     37             triangle_wave[]; 
    3538 
    3639/* 
  • nekostring/trunk/src/neko_voice_render.c

    r32 r33  
    3131float        neko_pitch[128]; 
    3232 
    33 #define WAVE_POINTS 1024          /* must be a power of two */ 
    3433 
    3534static float sine_wave[4 + WAVE_POINTS + 1],