Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float f_1336 = 1336.0/48000.0;
- float f_697 = 697.0/48000.0;
- float f_770 = 770.0/48000.0;
- float f_852 = 852.0/48000.0;
- float f_941 = 941.0/48000.0;
- for (i=0; i<48000; i++)
- {
- float sample_base = amp*sin(2*PI*f_1336*i);
- if (i < one_fourth){
- sample = amp*sin(2*PI*f_697*i);
- tone = sample_base + sample;
- }
- if (one_fourth < i < 2*one_fourth){
- sample = amp*sin(2*PI*f_770*i);
- tone = sample_base + sample;
- }
- if (2*one_fourth < i < 3*one_fourth){
- sample = amp*sin(2*PI*f_852*i);
- tone = sample_base + sample;
- }
- if (3*one_fourth < i < 4*one_fourth){
- sample = amp*sin(2*PI*f_941*i);
- tone = sample_base + sample;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement