Changeset 33
- Timestamp:
- 05/09/07 22:13:44 (2 years ago)
- Files:
-
- nekostring/trunk/src/neko_ensemble.c (modified) (4 diffs)
- nekostring/trunk/src/neko_synth.h (modified) (1 diff)
- nekostring/trunk/src/neko_voice_render.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
nekostring/trunk/src/neko_ensemble.c
r32 r33 27 27 28 28 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 31 34 float dr = 0.5* 0.002 * (float)sample_rate * 0.5f; // FIXME - identify this bit 32 35 float x1 = synth->ens_x1; … … 42 45 float d1,d2; 43 46 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 44 51 //printf("%f %f %f %f\n",x1,y1,xomega,yomega); 45 52 for (sample = 0; sample < sample_count; sample++) … … 53 60 // I have no idea what I did here originally 54 61 // "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); 62 77 63 78 // get two samples from the buffer … … 86 101 x1+=xomega; 87 102 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; 90 105 91 106 nekostring/trunk/src/neko_synth.h
r32 r33 33 33 34 34 #define WAVE_POINTS 1024 /* must be a power of two */ 35 36 static float sine_wave[], 37 triangle_wave[]; 35 38 36 39 /* nekostring/trunk/src/neko_voice_render.c
r32 r33 31 31 float neko_pitch[128]; 32 32 33 #define WAVE_POINTS 1024 /* must be a power of two */34 33 35 34 static float sine_wave[4 + WAVE_POINTS + 1],